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

Unified Diff: src/compiler/x64/instruction-selector-x64.cc

Issue 1685183003: [turbofan] Fix a bug in the RawMachineAssembler (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 10 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 | « no previous file | test/cctest/compiler/test-branch-combine.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
}
« no previous file with comments | « no previous file | test/cctest/compiler/test-branch-combine.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698