Index: src/compiler/arm/instruction-selector-arm.cc |
diff --git a/src/compiler/arm/instruction-selector-arm.cc b/src/compiler/arm/instruction-selector-arm.cc |
index a2f2d23f7c40aa9448ecd5381cf4723571138970..5279d1eec1e31bba0863b4a88e8cf93c4b2a1d45 100644 |
--- a/src/compiler/arm/instruction-selector-arm.cc |
+++ b/src/compiler/arm/instruction-selector-arm.cc |
@@ -1876,21 +1876,22 @@ void VisitWordCompare(InstructionSelector* selector, Node* node, |
// Shared routine for word comparisons against zero. |
void VisitWordCompareZero(InstructionSelector* selector, Node* user, |
Node* value, FlagsContinuation* cont) { |
- while (selector->CanCover(user, value)) { |
+ // Try to combine with comparisons against 0 by simply inverting the branch. |
+ while (value->opcode() == IrOpcode::kWord32Equal && |
+ selector->CanCover(user, value)) { |
+ Int32BinopMatcher m(value); |
+ if (!m.right().Is(0)) break; |
+ |
+ user = value; |
+ value = m.left().node(); |
+ cont->Negate(); |
+ } |
+ |
+ if (selector->CanCover(user, value)) { |
switch (value->opcode()) { |
- case IrOpcode::kWord32Equal: { |
- // Combine with comparisons against 0 by simply inverting the |
- // continuation. |
- Int32BinopMatcher m(value); |
- if (m.right().Is(0)) { |
- user = value; |
- value = m.left().node(); |
- cont->Negate(); |
- continue; |
- } |
+ case IrOpcode::kWord32Equal: |
cont->OverwriteAndNegateIfEqual(kEqual); |
return VisitWordCompare(selector, value, cont); |
- } |
case IrOpcode::kInt32LessThan: |
cont->OverwriteAndNegateIfEqual(kSignedLessThan); |
return VisitWordCompare(selector, value, cont); |
@@ -1974,7 +1975,6 @@ void VisitWordCompareZero(InstructionSelector* selector, Node* user, |
default: |
break; |
} |
- break; |
} |
if (user->opcode() == IrOpcode::kWord32Equal) { |