From 74903488aac98620f3394aa9a1cba96adfe85747 Mon Sep 17 00:00:00 2001 From: "mstarzinger@chromium.org" Date: Fri, 31 Oct 2014 15:09:06 +0000 Subject: [PATCH] Minor cleanup about unscheduled use count for fixed nodes. R=jarin@chromium.org Review URL: https://codereview.chromium.org/696643002 Cr-Commit-Position: refs/heads/master@{#25041} git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@25041 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/compiler/scheduler.cc | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/compiler/scheduler.cc b/src/compiler/scheduler.cc index 66cd40b..4bab8f5 100644 --- a/src/compiler/scheduler.cc +++ b/src/compiler/scheduler.cc @@ -147,8 +147,6 @@ void Scheduler::UpdatePlacement(Node* node, Placement placement) { // schedulable. If all the uses of a node have been scheduled, then the node // itself can be scheduled. for (InputIter i = node->inputs().begin(); i != node->inputs().end(); ++i) { - // TODO(mstarzinger): Another cheap hack for use counts. - if (GetData(*i)->placement_ == kFixed) continue; DecrementUnscheduledUseCount(*i, i.index(), i.edge().from()); } } @@ -167,6 +165,9 @@ void Scheduler::IncrementUnscheduledUseCount(Node* node, int index, // Make sure that control edges from coupled nodes are not counted. if (IsCoupledControlEdge(from, index)) return; + // Tracking use counts for fixed nodes is useless. + if (GetPlacement(node) == kFixed) return; + // Use count for coupled nodes is summed up on their control. if (GetPlacement(node) == kCoupled) { Node* control = NodeProperties::GetControlInput(node); @@ -187,6 +188,9 @@ void Scheduler::DecrementUnscheduledUseCount(Node* node, int index, // Make sure that control edges from coupled nodes are not counted. if (IsCoupledControlEdge(from, index)) return; + // Tracking use counts for fixed nodes is useless. + if (GetPlacement(node) == kFixed) return; + // Use count for coupled nodes is summed up on their control. if (GetPlacement(node) == kCoupled) { Node* control = NodeProperties::GetControlInput(node); @@ -1014,7 +1018,7 @@ class PrepareUsesVisitor : public NullNodeVisitor { scheduler_->schedule_root_nodes_.push_back(node); if (!schedule_->IsScheduled(node)) { // Make sure root nodes are scheduled in their respective blocks. - Trace(" Scheduling fixed position node #%d:%s\n", node->id(), + Trace("Scheduling fixed position node #%d:%s\n", node->id(), node->op()->mnemonic()); IrOpcode::Value opcode = node->opcode(); BasicBlock* block = -- 2.7.4