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

Unified Diff: src/compiler/scheduler.cc

Issue 709753002: Fix scheduler for floating non-naked non-empty loops. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Rebased again. 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 | « no previous file | test/cctest/compiler/test-scheduler.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 e079b1c750e5fa15a1ecc84eb640f5d1b462ae36..88caf988e90494ab3a6011f6511fb52163602dcd 100644
--- a/src/compiler/scheduler.cc
+++ b/src/compiler/scheduler.cc
@@ -295,6 +295,9 @@ class CFGBuilder {
}
private:
+ // TODO(mstarzinger): Only for Scheduler::FuseFloatingControl.
+ friend class Scheduler;
+
void FixNode(BasicBlock* block, Node* node) {
schedule_->AddNode(block, node);
scheduler_->UpdatePlacement(node, Scheduler::kFixed);
@@ -1158,7 +1161,6 @@ class ScheduleEarlyNodeVisitor {
// Fixed nodes already know their schedule early position.
if (scheduler_->GetPlacement(node) == Scheduler::kFixed) {
- DCHECK_EQ(schedule_->start(), data->minimum_block_);
data->minimum_block_ = schedule_->block(node);
Trace("Fixing #%d:%s minimum_block = B%d, dominator_depth = %d\n",
node->id(), node->op()->mnemonic(),
@@ -1450,6 +1452,29 @@ void Scheduler::FuseFloatingControl(BasicBlock* block, Node* node) {
}
GenerateImmediateDominatorTree();
+ // Iterate on phase 4: Schedule nodes early.
+ // TODO(mstarzinger): The following loop gathering the propagation roots is a
+ // temporary solution and should be merged into the rest of the scheduler as
+ // soon as the approach settled for all floating loops.
+ NodeVector propagation_roots(cfg_builder.control_);
+ for (Node* node : cfg_builder.control_) {
+ for (Node* use : node->uses()) {
+ if (use->opcode() == IrOpcode::kPhi ||
+ use->opcode() == IrOpcode::kEffectPhi) {
+ propagation_roots.push_back(use);
+ }
+ }
+ }
+ if (FLAG_trace_turbo_scheduler) {
+ Trace("propagation roots: ");
+ for (Node* node : propagation_roots) {
+ Trace("#%d:%s ", node->id(), node->op()->mnemonic());
+ }
+ Trace("\n");
+ }
+ ScheduleEarlyNodeVisitor schedule_early_visitor(zone_, this);
+ schedule_early_visitor.Run(&propagation_roots);
+
// Move previously planned nodes.
// TODO(mstarzinger): Improve that by supporting bulk moves.
scheduled_nodes_.resize(schedule_->BasicBlockCount(), NodeVector(zone_));
« no previous file with comments | « no previous file | test/cctest/compiler/test-scheduler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698