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

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

Issue 2662123004: [turbofan][x64] Fix instruction selection for Word32Equal. (Closed)
Patch Set: Address comment as per offline discussion. Created 3 years, 11 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 | no next file » | 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 4c213793f71a59fb313bdca64886a8832d5da0b5..d5ce91d4f56576931ea5b1fdda89fbaae0fec3f4 100644
--- a/src/compiler/x64/instruction-selector-x64.cc
+++ b/src/compiler/x64/instruction-selector-x64.cc
@@ -2071,12 +2071,8 @@ void VisitWordCompareZero(InstructionSelector* selector, Node* user,
break;
case IrOpcode::kInt32Sub:
return VisitWordCompare(selector, value, kX64Cmp32, cont);
- case IrOpcode::kInt64Sub:
- return VisitWord64Compare(selector, value, cont);
case IrOpcode::kWord32And:
return VisitWordCompare(selector, value, kX64Test32, cont);
- case IrOpcode::kWord64And:
- return VisitWordCompare(selector, value, kX64Test, cont);
default:
break;
}
@@ -2155,32 +2151,7 @@ void InstructionSelector::VisitWord32Equal(Node* const node) {
FlagsContinuation cont = FlagsContinuation::ForSet(kEqual, node);
Int32BinopMatcher m(user);
if (m.right().Is(0)) {
- Node* value = m.left().node();
-
- // Try to combine with comparisons against 0 by simply inverting the branch.
- while (CanCover(user, value) && value->opcode() == IrOpcode::kWord32Equal) {
- Int32BinopMatcher m(value);
- if (m.right().Is(0)) {
- user = value;
- value = m.left().node();
- cont.Negate();
- } else {
- break;
- }
- }
-
- // Try to combine the branch with a comparison.
- if (CanCover(user, value)) {
- switch (value->opcode()) {
- case IrOpcode::kInt32Sub:
- return VisitWordCompare(this, value, kX64Cmp32, &cont);
- case IrOpcode::kWord32And:
- return VisitWordCompare(this, value, kX64Test32, &cont);
- default:
- break;
- }
- }
- return VisitCompareZero(this, value, kX64Cmp32, &cont);
+ return VisitWordCompareZero(this, m.node(), m.left().node(), &cont);
}
VisitWordCompare(this, node, kX64Cmp32, &cont);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698