Index: src/compiler/arm64/instruction-selector-arm64.cc |
diff --git a/src/compiler/arm64/instruction-selector-arm64.cc b/src/compiler/arm64/instruction-selector-arm64.cc |
index 151d1aa8b7eac05d1612c657a833c2e0695d0133..aba7eb0189e1bb960624f8f7a4e2ba47a505b222 100644 |
--- a/src/compiler/arm64/instruction-selector-arm64.cc |
+++ b/src/compiler/arm64/instruction-selector-arm64.cc |
@@ -1270,8 +1270,11 @@ void InstructionSelector::VisitBranch(Node* branch, BasicBlock* tbranch, |
} |
} |
- // Branch could not be combined with a compare, emit compare against 0. |
- VisitWord32Test(this, value, &cont); |
+ // Branch could not be combined with a compare, compare against 0 and branch. |
+ DCHECK((cont.condition() == kEqual) || (cont.condition() == kNotEqual)); |
+ ArchOpcode opcode = (cont.condition() == kEqual) ? kArm64Cbz32 : kArm64Cbnz32; |
+ Emit(opcode, NULL, g.UseRegister(value), g.Label(cont.true_block()), |
+ g.Label(cont.false_block()))->MarkAsControl(); |
} |