| Index: src/compiler/ppc/instruction-selector-ppc.cc
|
| diff --git a/src/compiler/ppc/instruction-selector-ppc.cc b/src/compiler/ppc/instruction-selector-ppc.cc
|
| index ff7199a223f5a780fe2f80314d508629e915849a..26dae650256a2ae3e5e0032a027ba5ac0c2e6ec0 100644
|
| --- a/src/compiler/ppc/instruction-selector-ppc.cc
|
| +++ b/src/compiler/ppc/instruction-selector-ppc.cc
|
| @@ -1602,21 +1602,22 @@ void VisitFloat64Compare(InstructionSelector* selector, Node* node,
|
| void VisitWordCompareZero(InstructionSelector* selector, Node* user,
|
| Node* value, InstructionCode opcode,
|
| 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 VisitWord32Compare(selector, value, cont);
|
| - }
|
| case IrOpcode::kInt32LessThan:
|
| cont->OverwriteAndNegateIfEqual(kSignedLessThan);
|
| return VisitWord32Compare(selector, value, cont);
|
| @@ -1738,7 +1739,6 @@ void VisitWordCompareZero(InstructionSelector* selector, Node* user,
|
| default:
|
| break;
|
| }
|
| - break;
|
| }
|
|
|
| // Branch could not be combined with a compare, emit compare against 0.
|
|
|