Chromium Code Reviews| Index: src/compiler/x64/instruction-selector-x64.cc |
| diff --git a/src/compiler/x64/instruction-selector-x64.cc b/src/compiler/x64/instruction-selector-x64.cc |
| index bc8c13c07a0153546a1220ca74295e934d2672c5..935459243a4a5dd2bb25b4b77b251e49bdb70f92 100644 |
| --- a/src/compiler/x64/instruction-selector-x64.cc |
| +++ b/src/compiler/x64/instruction-selector-x64.cc |
| @@ -1449,17 +1449,26 @@ void InstructionSelector::VisitBranch(Node* branch, BasicBlock* tbranch, |
| case IrOpcode::kWord32Equal: |
| case IrOpcode::kWord64Equal: { |
| Int64BinopMatcher m(value); |
| + bool is_word64 = value->opcode() == IrOpcode::kWord64Equal; |
| if (m.right().Is(0)) { |
| user = value; |
| value = m.left().node(); |
| - cont.Negate(); |
| - continue; |
| + switch (value->opcode()) { |
| + case IrOpcode::kLoad: |
|
Benedikt Meurer
2016/02/11 05:13:53
This looks rather hacky to me, esp. hunting for Lo
epertoso
2016/02/11 13:47:47
Yeah, I traced back the issue to the use of Word64
|
| + case IrOpcode::kPhi: |
| + cont.OverwriteAndNegateIfEqual(kEqual); |
| + return VisitCompareZero(this, value, |
| + is_word64 ? kX64Cmp : kX64Cmp32, &cont); |
| + default: |
| + cont.Negate(); |
| + continue; |
| + } |
| } |
| cont.OverwriteAndNegateIfEqual(kEqual); |
| - return VisitWordCompare( |
| - this, value, |
| - value->opcode() == IrOpcode::kWord64Equal ? kX64Cmp : kX64Cmp32, |
| - &cont); |
| + if (is_word64) { |
| + return VisitWord64Compare(this, value, &cont); |
| + } |
| + return VisitWordCompare(this, value, kX64Cmp32, &cont); |
| } |
| case IrOpcode::kInt32LessThan: |
| cont.OverwriteAndNegateIfEqual(kSignedLessThan); |
| @@ -1542,12 +1551,6 @@ void InstructionSelector::VisitBranch(Node* branch, BasicBlock* tbranch, |
| return VisitWordCompare(this, value, kX64Test32, &cont); |
| case IrOpcode::kWord64And: |
| return VisitWordCompare(this, value, kX64Test, &cont); |
| - case IrOpcode::kLoad: |
| - if (LoadRepresentationOf(value->op()).representation() == |
| - MachineRepresentation::kWord64) { |
| - return VisitCompareZero(this, value, kX64Cmp, &cont); |
| - } |
| - break; |
| default: |
| break; |
| } |
| @@ -1555,7 +1558,7 @@ void InstructionSelector::VisitBranch(Node* branch, BasicBlock* tbranch, |
| } |
| // Branch could not be combined with a compare, emit compare against 0. |
| - VisitCompareZero(this, value, kX64Cmp32, &cont); |
| + VisitCompareZero(this, value, kX64Cmp, &cont); |
| } |