From: bmeurer@chromium.org Date: Wed, 5 Nov 2014 10:43:42 +0000 (+0000) Subject: [turbofan] Propagate "deferredness" to dominated basic blocks. X-Git-Tag: upstream/4.7.83~5885 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0c1a545a9359d343627e1ef67715966ecba4c52c;p=platform%2Fupstream%2Fv8.git [turbofan] Propagate "deferredness" to dominated basic blocks. TEST=cctest/test-scheduler R=mstarzinger@chromium.org Review URL: https://codereview.chromium.org/686273005 Cr-Commit-Position: refs/heads/master@{#25141} git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@25141 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- diff --git a/src/compiler/scheduler.cc b/src/compiler/scheduler.cc index c43ed81..9d0d730 100644 --- a/src/compiler/scheduler.cc +++ b/src/compiler/scheduler.cc @@ -415,8 +415,6 @@ class CFGBuilder { IrOpcode::kIfFalse); // Consider branch hints. - // TODO(turbofan): Propagate the deferred flag to all blocks dominated by - // this IfTrue/IfFalse later. switch (BranchHintOf(branch->op())) { case BranchHint::kNone: break; @@ -1061,6 +1059,8 @@ void Scheduler::GenerateImmediateDominatorTree() { } current->set_dominator(dominator); current->set_dominator_depth(dominator->dominator_depth() + 1); + // Propagate "deferredness" of the dominator. + if (dominator->deferred()) current->set_deferred(true); Trace("Block B%d's idom is B%d, depth = %d\n", current->id().ToInt(), dominator->id().ToInt(), current->dominator_depth()); } diff --git a/test/cctest/compiler/test-scheduler.cc b/test/cctest/compiler/test-scheduler.cc index 3a0103d..5f5c9d1 100644 --- a/test/cctest/compiler/test-scheduler.cc +++ b/test/cctest/compiler/test-scheduler.cc @@ -34,6 +34,17 @@ static void CheckRPONumbers(BasicBlockVector* order, size_t expected, CHECK_EQ(NULL, order->at(i)->loop_header()); } } + int number = 0; + for (auto const block : *order) { + if (block->deferred()) continue; + CHECK_EQ(number, block->ao_number()); + ++number; + } + for (auto const block : *order) { + if (!block->deferred()) continue; + CHECK_EQ(number, block->ao_number()); + ++number; + } } @@ -155,6 +166,7 @@ TEST(RPOLine) { BasicBlock* last = schedule.start(); for (int j = 0; j < i; j++) { BasicBlock* block = schedule.NewBasicBlock(); + block->set_deferred(i & 1); schedule.AddGoto(last, block); last = block; }