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

Unified Diff: test/unittests/compiler/register-allocator-unittest.cc

Issue 798363007: [turbofan] use START and END gap positions for constraints (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 6 years 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/register-allocator.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/unittests/compiler/register-allocator-unittest.cc
diff --git a/test/unittests/compiler/register-allocator-unittest.cc b/test/unittests/compiler/register-allocator-unittest.cc
index 8c90b4c4f3603068464e76be2607fdbbc2af8bd4..12dedbdd7316a308602238b8f763cde48f16e4b5 100644
--- a/test/unittests/compiler/register-allocator-unittest.cc
+++ b/test/unittests/compiler/register-allocator-unittest.cc
@@ -394,6 +394,44 @@ TEST_F(RegisterAllocatorTest, NestedDiamondPhiMergeDifferent) {
Allocate();
}
+
+TEST_F(RegisterAllocatorTest, RegressionSplitBeforeAndMove) {
+ StartBlock();
+
+ // Fill registers.
+ VReg values[kDefaultNRegs];
+ for (size_t i = 0; i < arraysize(values); ++i) {
+ if (i == 0 || i == 1) continue; // Leave a hole for c_1 to take.
+ values[i] = Define(Reg(static_cast<int>(i)));
+ }
+
+ auto c_0 = DefineConstant();
+ auto c_1 = DefineConstant();
+
+ EmitOI(Reg(1), Reg(c_0, 0), UniqueReg(c_1));
+
+ // Use previous values to force c_1 to split before the previous instruction.
+ for (size_t i = 0; i < arraysize(values); ++i) {
+ if (i == 0 || i == 1) continue;
+ EmitI(Reg(values[i], static_cast<int>(i)));
+ }
+
+ EndBlock(Last());
+
+ Allocate();
+}
+
+
+TEST_F(RegisterAllocatorTest, RegressionSpillTwice) {
+ StartBlock();
+ auto p_0 = Parameter(Reg(1));
+ EmitCall(Slot(-2), Unique(p_0), Reg(p_0, 1));
+ EndBlock(Last());
+
+ Allocate();
+}
+
+
} // namespace compiler
} // namespace internal
} // namespace v8
« no previous file with comments | « src/compiler/register-allocator.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698