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

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

Issue 852633002: add register allocator regression test (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 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: 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 12dedbdd7316a308602238b8f763cde48f16e4b5..e198c74ec2d39c32903bf0cdbd0808936c69fc46 100644
--- a/test/unittests/compiler/register-allocator-unittest.cc
+++ b/test/unittests/compiler/register-allocator-unittest.cc
@@ -432,6 +432,40 @@ TEST_F(RegisterAllocatorTest, RegressionSpillTwice) {
}
+TEST_F(RegisterAllocatorTest, RegressionLoadConstantBeforeSpill) {
+ StartBlock();
+ // Fill registers.
+ VReg values[kDefaultNRegs];
+ for (size_t i = arraysize(values); i > 0; --i) {
+ values[i - 1] = Define(Reg(static_cast<int>(i - 1)));
+ }
+ auto c = DefineConstant();
+ auto to_spill = Define(Reg());
+ EndBlock(Jump(1));
+
+ {
+ StartLoop(1);
+
+ StartBlock();
+ // Create a use for c in second half of prev block's last gap
+ Phi(c);
+ for (size_t i = arraysize(values); i > 0; --i) {
+ Phi(values[i - 1]);
+ }
+ EndBlock(Jump(1));
+
+ EndLoop();
+ }
+
+ StartBlock();
+ // Force c to split within to_spill's definition.
+ EmitI(Reg(c));
+ EmitI(Reg(to_spill));
+ EndBlock(Last());
+
+ Allocate();
+}
+
} // namespace compiler
} // namespace internal
} // namespace v8
« 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