Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(127)

Unified Diff: src/compiler/machine-operator-reducer.cc

Issue 689883003: Fix bug in optimization of Uint32LessThan. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Add TODO(turbofan) Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | test/mjsunit/asm/uint32-less-than-shift.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/machine-operator-reducer.cc
diff --git a/src/compiler/machine-operator-reducer.cc b/src/compiler/machine-operator-reducer.cc
index 98873c3f1e3bfe02b61f9713160fb7b16b3db5a6..3803af5e34f99dfb64de1b6180c3fa5781e3c8d6 100644
--- a/src/compiler/machine-operator-reducer.cc
+++ b/src/compiler/machine-operator-reducer.cc
@@ -370,15 +370,16 @@ Reduction MachineOperatorReducer::Reduce(Node* node) {
if (m.left().IsWord32Sar() && m.right().HasValue()) {
Int32BinopMatcher mleft(m.left().node());
if (mleft.right().HasValue()) {
- // (x >> K) < C => x < (C << K) | (2^K - 1)
+ // (x >> K) < C => x < (C << K)
// when C < (M >> K)
const uint32_t c = m.right().Value();
const uint32_t k = mleft.right().Value() & 0x1f;
if (c < static_cast<uint32_t>(kMaxInt >> k)) {
node->ReplaceInput(0, mleft.left().node());
- node->ReplaceInput(1, Uint32Constant((c << k) | ((1 << k) - 1)));
+ node->ReplaceInput(1, Uint32Constant(c << k));
return Changed(node);
}
+ // TODO(turbofan): else the comparison is always true.
}
}
break;
« no previous file with comments | « no previous file | test/mjsunit/asm/uint32-less-than-shift.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698