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

Unified Diff: test/cctest/compiler/test-branch-combine.cc

Issue 2008493002: [x64/ia32] Deal with the non-transitivity of InstructionSelector::CanCover() when folding loads int… (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Update. Created 4 years, 7 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 | « src/compiler/x64/instruction-selector-x64.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/compiler/test-branch-combine.cc
diff --git a/test/cctest/compiler/test-branch-combine.cc b/test/cctest/compiler/test-branch-combine.cc
index c3b4308a93ed275c54630428687f1acc5386e4f3..c5c41667a02f76c4ac2f4f9b415e10afe3971533 100644
--- a/test/cctest/compiler/test-branch-combine.cc
+++ b/test/cctest/compiler/test-branch-combine.cc
@@ -457,6 +457,27 @@ TEST(BranchCombineFloat64Compares) {
}
}
+TEST(BranchCombineEffectLevel) {
+ // Test that the load doesn't get folded into the branch, as there's a store
+ // between them. See http://crbug.com/611976.
+ int32_t input = 0;
+
+ RawMachineAssemblerTester<int32_t> m;
+ Node* a = m.LoadFromPointer(&input, MachineType::Int32());
+ Node* compare = m.Word32And(a, m.Int32Constant(1));
+ Node* equal = m.Word32Equal(compare, m.Int32Constant(0));
+ m.StoreToPointer(&input, MachineRepresentation::kWord32, m.Int32Constant(1));
+
+ RawMachineLabel blocka, blockb;
+ m.Branch(equal, &blocka, &blockb);
+ m.Bind(&blocka);
+ m.Return(m.Int32Constant(42));
+ m.Bind(&blockb);
+ m.Return(m.Int32Constant(0));
+
+ CHECK_EQ(42, m.Call());
+}
+
} // namespace compiler
} // namespace internal
} // namespace v8
« no previous file with comments | « src/compiler/x64/instruction-selector-x64.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698