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

Unified Diff: src/compiler/scheduler.cc

Issue 865393004: [turbofan] Move GetCommonDominator to BasicBlock. (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 | « src/compiler/scheduler.h ('k') | test/unittests/compiler/schedule-unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/scheduler.cc
diff --git a/src/compiler/scheduler.cc b/src/compiler/scheduler.cc
index 59a01406910c558c16f03d8d90666dfbd6a010f5..57696b7acd1aa88c892533ac0b14cd0a5f0d1265 100644
--- a/src/compiler/scheduler.cc
+++ b/src/compiler/scheduler.cc
@@ -208,20 +208,6 @@ void Scheduler::DecrementUnscheduledUseCount(Node* node, int index,
}
-BasicBlock* Scheduler::GetCommonDominator(BasicBlock* b1, BasicBlock* b2) {
- while (b1 != b2) {
- int32_t b1_depth = b1->dominator_depth();
- int32_t b2_depth = b2->dominator_depth();
- if (b1_depth < b2_depth) {
- b2 = b2->dominator();
- } else {
- b1 = b1->dominator();
- }
- }
- return b1;
-}
-
-
// -----------------------------------------------------------------------------
// Phase 1: Build control-flow graph.
@@ -1042,7 +1028,7 @@ void Scheduler::PropagateImmediateDominators(BasicBlock* block) {
for (++pred; pred != end; ++pred) {
// Don't examine backwards edges.
if ((*pred)->dominator_depth() < 0) continue;
- dominator = GetCommonDominator(dominator, *pred);
+ dominator = BasicBlock::GetCommonDominator(dominator, *pred);
}
block->set_dominator(dominator);
block->set_dominator_depth(dominator->dominator_depth() + 1);
@@ -1195,7 +1181,7 @@ class ScheduleEarlyNodeVisitor {
#if DEBUG
bool InsideSameDominatorChain(BasicBlock* b1, BasicBlock* b2) {
- BasicBlock* dominator = scheduler_->GetCommonDominator(b1, b2);
+ BasicBlock* dominator = BasicBlock::GetCommonDominator(b1, b2);
return dominator == b1 || dominator == b2;
}
#endif
@@ -1277,7 +1263,7 @@ class ScheduleLateNodeVisitor {
// The schedule early block dominates the schedule late block.
BasicBlock* min_block = scheduler_->GetData(node)->minimum_block_;
- DCHECK_EQ(min_block, scheduler_->GetCommonDominator(block, min_block));
+ DCHECK_EQ(min_block, BasicBlock::GetCommonDominator(block, min_block));
Trace("Schedule late of #%d:%s is B%d at loop depth %d, minimum = B%d\n",
node->id(), node->op()->mnemonic(), block->id().ToInt(),
block->loop_depth(), min_block->id().ToInt());
@@ -1319,7 +1305,7 @@ class ScheduleLateNodeVisitor {
BasicBlock* use_block = GetBlockForUse(edge);
block = block == NULL ? use_block : use_block == NULL
? block
- : scheduler_->GetCommonDominator(
+ : BasicBlock::GetCommonDominator(
block, use_block);
}
return block;
« no previous file with comments | « src/compiler/scheduler.h ('k') | test/unittests/compiler/schedule-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698