Scheduler checks that end block doesn't have successors.

R=jarin@chromium.org
TEST=cctest/test-scheduler/RPOLoop

Review URL: https://codereview.chromium.org/710333002

Cr-Commit-Position: refs/heads/master@{#25281}
git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@25281 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 5e8399cb
......@@ -534,9 +534,9 @@ class SpecialRPONumberer : public ZoneObject {
// Computes the special reverse-post-order for the main control flow graph,
// that is for the graph spanned between the schedule's start and end blocks.
void ComputeSpecialRPO() {
DCHECK(schedule_->end()->SuccessorCount() == 0);
DCHECK_EQ(NULL, order_); // Main order does not exist yet.
// TODO(mstarzinger): Should use Schedule::end() after tests are fixed.
ComputeAndInsertSpecialRPO(schedule_->start(), NULL);
ComputeAndInsertSpecialRPO(schedule_->start(), schedule_->end());
}
// Computes the special reverse-post-order for a partial control flow graph,
......
......@@ -201,12 +201,13 @@ TEST(RPOSelfLoop) {
TEST(RPOEntryLoop) {
HandleAndZoneScope scope;
Schedule schedule(scope.main_zone());
schedule.AddSuccessorForTesting(schedule.start(), schedule.end());
schedule.AddSuccessorForTesting(schedule.end(), schedule.start());
BasicBlock* body = schedule.NewBasicBlock();
schedule.AddSuccessorForTesting(schedule.start(), body);
schedule.AddSuccessorForTesting(body, schedule.start());
BasicBlockVector* order =
Scheduler::ComputeSpecialRPO(scope.main_zone(), &schedule);
CheckRPONumbers(order, 2, true);
BasicBlock* loop[] = {schedule.start(), schedule.end()};
BasicBlock* loop[] = {schedule.start(), body};
CheckLoop(order, loop, 2);
}
......@@ -648,7 +649,7 @@ TEST(RPOLoopMultibackedge) {
BasicBlock* A = schedule.start();
BasicBlock* B = schedule.NewBasicBlock();
BasicBlock* C = schedule.NewBasicBlock();
BasicBlock* D = schedule.end();
BasicBlock* D = schedule.NewBasicBlock();
BasicBlock* E = schedule.NewBasicBlock();
schedule.AddSuccessorForTesting(A, B);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment