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

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

Issue 704463004: [turbofan] Turn various diamonds into selects. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fix cctest. Created 6 years, 1 month 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 | « src/compiler/js-builtin-reducer.cc ('k') | test/cctest/compiler/test-changes-lowering.cc » ('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 d1a275d56a07e4289934941122cac808c6cddd6d..2134c711ee581027690788e03c04e1dee11471eb 100644
--- a/src/compiler/machine-operator-reducer.cc
+++ b/src/compiler/machine-operator-reducer.cc
@@ -638,13 +638,12 @@ Reduction MachineOperatorReducer::ReduceInt32Mod(Node* node) {
if (base::bits::IsPowerOfTwo32(divisor)) {
uint32_t const mask = divisor - 1;
Node* const zero = Int32Constant(0);
-
- Node* check =
- graph()->NewNode(machine()->Int32LessThan(), dividend, zero);
- Diamond d(graph(), common(), check, BranchHint::kFalse);
- Node* neg = Int32Sub(zero, Word32And(Int32Sub(zero, dividend), mask));
- Node* pos = Word32And(dividend, mask);
- d.OverwriteWithPhi(node, kMachInt32, neg, pos);
+ node->set_op(common()->Select(kMachInt32, BranchHint::kFalse));
+ node->ReplaceInput(
+ 0, graph()->NewNode(machine()->Int32LessThan(), dividend, zero));
+ node->ReplaceInput(
+ 1, Int32Sub(zero, Word32And(Int32Sub(zero, dividend), mask)));
+ node->ReplaceInput(2, Word32And(dividend, mask));
} else {
Node* quotient = Int32Div(dividend, divisor);
node->set_op(machine()->Int32Sub());
« no previous file with comments | « src/compiler/js-builtin-reducer.cc ('k') | test/cctest/compiler/test-changes-lowering.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698