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

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

Issue 2167643002: [Turbofan] Make the -0 deopt case more efficient in multiplication. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 5 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
Index: src/compiler/machine-operator-reducer.cc
diff --git a/src/compiler/machine-operator-reducer.cc b/src/compiler/machine-operator-reducer.cc
index fd402ee1c7fecbea37ff222c6d57d9d188eb343a..4e2a3777b1d9b7ea162533119ad7229427ff9477 100644
--- a/src/compiler/machine-operator-reducer.cc
+++ b/src/compiler/machine-operator-reducer.cc
@@ -264,6 +264,16 @@ Reduction MachineOperatorReducer::Reduce(Node* node) {
return ReplaceBool(m.left().Value() < m.right().Value());
}
if (m.LeftEqualsRight()) return ReplaceBool(false); // x < x => false
+ if (m.left().IsWord32Or() && m.right().Is(0)) { // (X | Y) < 0 ...
+ // This targets the check for -0 after multiplication.
Benedikt Meurer 2016/07/20 17:37:44 This is a detail that is not necessarily relevant.
+ Int32BinopMatcher mleftmatcher(m.left().node());
+ if ((mleftmatcher.left().HasValue() &&
Benedikt Meurer 2016/07/20 17:37:44 Please add a IsNegative() helper to the Int32Match
+ mleftmatcher.left().Value() < 0) ||
+ (mleftmatcher.right().HasValue() &&
+ mleftmatcher.right().Value() < 0)) {
+ return ReplaceBool(true); // and X < 0 or Y < 0 => true
+ }
+ }
break;
}
case IrOpcode::kInt32LessThanOrEqual: {
« no previous file with comments | « no previous file | test/mjsunit/compiler/math-mul.js » ('j') | test/unittests/compiler/machine-operator-reducer-unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698