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

Unified Diff: src/compiler/scheduler.cc

Issue 761673004: Start immediate dominator propagation at entry to floating control. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Addressed comments. 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 | « src/compiler/scheduler.h ('k') | no next file » | 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 0f3b4c4248dea93856a6c4a2a7b677f8c0abfba7..33e6ca49283c67ba32dd3113aa9c40629aada249 100644
--- a/src/compiler/scheduler.cc
+++ b/src/compiler/scheduler.cc
@@ -1037,15 +1037,8 @@ void Scheduler::ComputeSpecialRPONumbering() {
}
-void Scheduler::GenerateImmediateDominatorTree() {
- Trace("--- IMMEDIATE BLOCK DOMINATORS -----------------------------\n");
-
- // TODO(danno): Consider using Lengauer & Tarjan's if this becomes too slow.
-
- // Build the block dominator tree.
- schedule_->start()->set_dominator_depth(0);
- BasicBlock* second = schedule_->start()->rpo_next();
- for (BasicBlock* block = second; block != NULL; block = block->rpo_next()) {
+void Scheduler::PropagateImmediateDominators(BasicBlock* block) {
+ for (/*nop*/; block != NULL; block = block->rpo_next()) {
BasicBlock::Predecessors::iterator pred = block->predecessors_begin();
BasicBlock::Predecessors::iterator end = block->predecessors_end();
DCHECK(pred != end); // All blocks except start have predecessors.
@@ -1068,6 +1061,17 @@ void Scheduler::GenerateImmediateDominatorTree() {
}
+void Scheduler::GenerateImmediateDominatorTree() {
+ Trace("--- IMMEDIATE BLOCK DOMINATORS -----------------------------\n");
+
+ // Seed start block to be the first dominator.
+ schedule_->start()->set_dominator_depth(0);
+
+ // Build the block dominator tree resulting from the above seed.
+ PropagateImmediateDominators(schedule_->start()->rpo_next());
+}
+
+
// -----------------------------------------------------------------------------
// Phase 3: Prepare use counts for nodes.
@@ -1434,11 +1438,11 @@ void Scheduler::FuseFloatingControl(BasicBlock* block, Node* node) {
// Iterate on phase 2: Compute special RPO and dominator tree.
special_rpo_->UpdateSpecialRPO(block, schedule_->block(node));
// TODO(mstarzinger): Currently "iterate on" means "re-run". Fix that.
- for (BasicBlock* block : schedule_->all_blocks_) {
- block->set_dominator_depth(-1);
- block->set_dominator(NULL);
+ for (BasicBlock* b = block->rpo_next(); b != NULL; b = b->rpo_next()) {
+ b->set_dominator_depth(-1);
+ b->set_dominator(NULL);
}
- GenerateImmediateDominatorTree();
+ PropagateImmediateDominators(block->rpo_next());
// Iterate on phase 4: Schedule nodes early.
// TODO(mstarzinger): The following loop gathering the propagation roots is a
« no previous file with comments | « src/compiler/scheduler.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698