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

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

Issue 704153002: [turbofan] phis cannot take registers as inputs (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 1 month 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 | « test/mjsunit/compiler/regress-register-allocator3.js ('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 b1597c186511b8a4a63616e54fa2d5815fbd2dcf..dbcdedb7981072f86c18715ee6eaa6e506bd7b34 100644
--- a/test/unittests/compiler/register-allocator-unittest.cc
+++ b/test/unittests/compiler/register-allocator-unittest.cc
@@ -453,6 +453,61 @@ TEST_F(RegisterAllocatorTest, SimpleBranch) {
Allocate();
}
+
+TEST_F(RegisterAllocatorTest, RegressionPhisNeedTooManyRegisters) {
+ const size_t kNumRegs = 3;
+ const size_t kParams = kNumRegs + 1;
+ int parameters[kParams];
+
+ // Override number of registers.
+ SetNumRegs(kNumRegs, kNumRegs);
+
+ // Initial block.
+ StartBlock();
+ int constant = DefineConstant();
+ for (size_t i = 0; i < arraysize(parameters); ++i) {
+ parameters[i] = DefineConstant();
+ }
+ EndBlock();
+
+ PhiInstruction* phis[kParams];
+ {
+ StartLoop(2);
+
+ // Loop header.
+ StartBlock();
+
+ for (size_t i = 0; i < arraysize(parameters); ++i) {
+ phis[i] = Phi(parameters[i]);
+ }
+
+ // Perform some computations.
+ // something like phi[i] += const
+ for (size_t i = 0; i < arraysize(parameters); ++i) {
+ int result = NewReg();
+ EmitFRU(result, phis[i]->virtual_register(), constant);
+ phis[i]->operands().push_back(result);
+ }
+
+ EndBlock(Branch(DefineConstant(), 1, 2));
+
+ // Jump back to loop header.
+ StartBlock();
+ EndBlock(Jump(-1));
+
+ EndLoop();
+ }
+
+ // End block.
+ StartLastBlock();
+
+ // Return sum.
+ Return(DefineConstant());
+ EndBlock();
+
+ Allocate();
+}
+
} // namespace compiler
} // namespace internal
} // namespace v8
« no previous file with comments | « test/mjsunit/compiler/regress-register-allocator3.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698