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

Unified Diff: src/compiler/simplified-lowering.cc

Issue 2135123002: [turbofan] Eliminate a few redundant bounds checks. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix BranchElimination to play well with the other reducers. 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
« no previous file with comments | « src/compiler/pipeline.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/simplified-lowering.cc
diff --git a/src/compiler/simplified-lowering.cc b/src/compiler/simplified-lowering.cc
index d1c56dd886b14a5d2cf967c4b1d18bbe2078e25e..39d473e7a9687b68dcec17eac8a67fdf34284d07 100644
--- a/src/compiler/simplified-lowering.cc
+++ b/src/compiler/simplified-lowering.cc
@@ -1270,16 +1270,16 @@ class RepresentationSelector {
case IrOpcode::kNumberLessThan:
case IrOpcode::kNumberLessThanOrEqual: {
// Number comparisons reduce to integer comparisons for integer inputs.
- if (TypeOf(node->InputAt(0))->Is(Type::Signed32()) &&
- TypeOf(node->InputAt(1))->Is(Type::Signed32())) {
- // => signed Int32Cmp
- VisitInt32Cmp(node);
- if (lower()) NodeProperties::ChangeOp(node, Int32Op(node));
- } else if (TypeOf(node->InputAt(0))->Is(Type::Unsigned32()) &&
- TypeOf(node->InputAt(1))->Is(Type::Unsigned32())) {
+ if (TypeOf(node->InputAt(0))->Is(Type::Unsigned32()) &&
+ TypeOf(node->InputAt(1))->Is(Type::Unsigned32())) {
// => unsigned Int32Cmp
VisitUint32Cmp(node);
if (lower()) NodeProperties::ChangeOp(node, Uint32Op(node));
+ } else if (TypeOf(node->InputAt(0))->Is(Type::Signed32()) &&
+ TypeOf(node->InputAt(1))->Is(Type::Signed32())) {
+ // => signed Int32Cmp
+ VisitInt32Cmp(node);
+ if (lower()) NodeProperties::ChangeOp(node, Int32Op(node));
} else {
// => Float64Cmp
VisitFloat64Cmp(node);
@@ -1296,18 +1296,18 @@ class RepresentationSelector {
case IrOpcode::kSpeculativeNumberLessThanOrEqual:
case IrOpcode::kSpeculativeNumberEqual: {
// Number comparisons reduce to integer comparisons for integer inputs.
- if (TypeOf(node->InputAt(0))->Is(Type::Signed32()) &&
- TypeOf(node->InputAt(1))->Is(Type::Signed32())) {
- // => signed Int32Cmp
- VisitInt32Cmp(node);
- if (lower()) ChangeToPureOp(node, Int32Op(node));
- return;
- } else if (TypeOf(node->InputAt(0))->Is(Type::Unsigned32()) &&
- TypeOf(node->InputAt(1))->Is(Type::Unsigned32())) {
+ if (TypeOf(node->InputAt(0))->Is(Type::Unsigned32()) &&
+ TypeOf(node->InputAt(1))->Is(Type::Unsigned32())) {
// => unsigned Int32Cmp
VisitUint32Cmp(node);
if (lower()) ChangeToPureOp(node, Uint32Op(node));
return;
+ } else if (TypeOf(node->InputAt(0))->Is(Type::Signed32()) &&
+ TypeOf(node->InputAt(1))->Is(Type::Signed32())) {
+ // => signed Int32Cmp
+ VisitInt32Cmp(node);
+ if (lower()) ChangeToPureOp(node, Int32Op(node));
+ return;
}
// Try to use type feedback.
CompareOperationHints::Hint hint = CompareOperationHintOf(node->op());
« no previous file with comments | « src/compiler/pipeline.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698