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

Unified Diff: test/unittests/compiler/scheduler-unittest.cc

Issue 1123213002: [turbofan] Connect non-terminating loops via Terminate. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 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 | « test/unittests/compiler/node-test-utils.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/scheduler-unittest.cc
diff --git a/test/unittests/compiler/scheduler-unittest.cc b/test/unittests/compiler/scheduler-unittest.cc
index 22b04ef9ec17d4e8ff01ce66191626a61443eea4..4de15492b201b52a5ddaa6bcbc6d13d8dd8fcdc1 100644
--- a/test/unittests/compiler/scheduler-unittest.cc
+++ b/test/unittests/compiler/scheduler-unittest.cc
@@ -2467,6 +2467,29 @@ TARGET_TEST_F(SchedulerTest, FloatingSwitch) {
ComputeAndVerifySchedule(16);
}
+
+TARGET_TEST_F(SchedulerTest, Terminate) {
+ Node* start = graph()->NewNode(common()->Start(1));
+ graph()->SetStart(start);
+
+ Node* loop = graph()->NewNode(common()->Loop(2), start, start);
+ loop->ReplaceInput(1, loop); // self loop, NTL.
+
+ Node* effect = graph()->NewNode(common()->EffectPhi(1), start, loop);
+
+ Node* terminate = graph()->NewNode(common()->Terminate(), effect, loop);
+ effect->ReplaceInput(1, terminate);
+
+ Node* end = graph()->NewNode(common()->End(), terminate);
+
+ graph()->SetEnd(end);
+
+ Schedule* schedule = ComputeAndVerifySchedule(6);
+ BasicBlock* block = schedule->block(loop);
+ EXPECT_EQ(block, schedule->block(effect));
+ EXPECT_GE(block->rpo_number(), 0);
+}
+
} // namespace compiler
} // namespace internal
} // namespace v8
« no previous file with comments | « test/unittests/compiler/node-test-utils.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698