[turbofan] Positive dividends are heavily favored for Int32Mod.
authorbmeurer@chromium.org <bmeurer@chromium.org>
Mon, 3 Nov 2014 10:44:23 +0000 (10:44 +0000)
committerbmeurer@chromium.org <bmeurer@chromium.org>
Mon, 3 Nov 2014 10:44:44 +0000 (10:44 +0000)
Mark negative dividend case as deferred, as modulus by power of two with
negative dividend almost never appears in practice.

R=dcarney@chromium.org

Review URL: https://codereview.chromium.org/699573002

Cr-Commit-Position: refs/heads/master@{#25065}
git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@25065 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

src/compiler/machine-operator-reducer.cc

index 1f73262..836ddd1 100644 (file)
@@ -654,8 +654,8 @@ Reduction MachineOperatorReducer::ReduceInt32Mod(Node* node) {
 
       Node* check =
           graph()->NewNode(machine()->Int32LessThan(), dividend, zero);
-      Node* branch =
-          graph()->NewNode(common()->Branch(), check, graph()->start());
+      Node* branch = graph()->NewNode(common()->Branch(BranchHint::kFalse),
+                                      check, graph()->start());
 
       Node* if_true = graph()->NewNode(common()->IfTrue(), branch);
       Node* neg = Int32Sub(zero, Word32And(Int32Sub(zero, dividend), mask));