diff options
author | Vikram S. Adve <vadve@cs.uiuc.edu> | 2002-07-08 22:59:23 +0000 |
---|---|---|
committer | Vikram S. Adve <vadve@cs.uiuc.edu> | 2002-07-08 22:59:23 +0000 |
commit | 0baf1c0911017be6626cf4fe4cc78d345fdc9a27 (patch) | |
tree | 9d67304cb681519a305dc581beea8a60fcd4fc7d /lib/CodeGen/InstrSched/SchedPriorities.cpp | |
parent | 9afa88c3a73187b9454085651807896002e020ca (diff) |
A single MachineInstr operand may now be both a def and a use,
so additional dep. edges have to be added.
This was needed to correctly handle conditional move instructions!
MachineCodeForBasicBlock is now an annotation on BasicBlock.
Renamed "earliestForNode" to "earliestReadyTimeForNode".
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2826 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/InstrSched/SchedPriorities.cpp')
-rw-r--r-- | lib/CodeGen/InstrSched/SchedPriorities.cpp | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/lib/CodeGen/InstrSched/SchedPriorities.cpp b/lib/CodeGen/InstrSched/SchedPriorities.cpp index aba49bd54c..8a1c9a5348 100644 --- a/lib/CodeGen/InstrSched/SchedPriorities.cpp +++ b/lib/CodeGen/InstrSched/SchedPriorities.cpp @@ -28,9 +28,10 @@ SchedPriorities::SchedPriorities(const Function *, const SchedGraph *G, FunctionLiveVarInfo &LVI) : curTime(0), graph(G), methodLiveVarInfo(LVI), nodeDelayVec(G->getNumNodes(), INVALID_LATENCY), // make errors obvious - earliestForNode(G->getNumNodes(), 0), + earliestReadyTimeForNode(G->getNumNodes(), 0), earliestReadyTime(0), - nextToTry(candsAsHeap.begin()) { + nextToTry(candsAsHeap.begin()) +{ computeDelays(graph); } @@ -51,7 +52,7 @@ SchedPriorities::computeDelays(const SchedGraph* graph) const SchedGraphNode* node = *poIter; cycles_t nodeDelay; if (node->beginOutEdges() == node->endOutEdges()) - nodeDelay = node->getLatency(); + nodeDelay = node->getLatency(); else { // Iterate over the out-edges of the node to compute delay @@ -59,7 +60,7 @@ SchedPriorities::computeDelays(const SchedGraph* graph) for (SchedGraphNode::const_iterator E=node->beginOutEdges(); E != node->endOutEdges(); ++E) { - cycles_t sinkDelay = getNodeDelayRef((*E)->getSink()); + cycles_t sinkDelay = getNodeDelay((*E)->getSink()); nodeDelay = std::max(nodeDelay, sinkDelay + (*E)->getMinDelay()); } } @@ -104,13 +105,13 @@ SchedPriorities::insertReady(const SchedGraphNode* node) candsAsSet.insert(node); mcands.clear(); // ensure reset choices is called before any more choices earliestReadyTime = std::min(earliestReadyTime, - earliestForNode[node->getNodeId()]); + getEarliestReadyTimeForNode(node)); if (SchedDebugLevel >= Sched_PrintSchedTrace) { cerr << " Node " << node->getNodeId() << " will be ready in Cycle " - << earliestForNode[node->getNodeId()] << "; " - << " Delay = " <<(long)getNodeDelayRef(node) << "; Instruction: \n"; + << getEarliestReadyTimeForNode(node) << "; " + << " Delay = " <<(long)getNodeDelay(node) << "; Instruction: \n"; cerr << " " << *node->getMachineInstr() << "\n"; } } @@ -123,21 +124,21 @@ SchedPriorities::issuedReadyNodeAt(cycles_t curTime, candsAsSet.erase(node); mcands.clear(); // ensure reset choices is called before any more choices - if (earliestReadyTime == getEarliestForNodeRef(node)) + if (earliestReadyTime == getEarliestReadyTimeForNode(node)) {// earliestReadyTime may have been due to this node, so recompute it earliestReadyTime = HUGE_LATENCY; for (NodeHeap::const_iterator I=candsAsHeap.begin(); I != candsAsHeap.end(); ++I) if (candsAsHeap.getNode(I)) earliestReadyTime = std::min(earliestReadyTime, - getEarliestForNodeRef(candsAsHeap.getNode(I))); + getEarliestReadyTimeForNode(candsAsHeap.getNode(I))); } // Now update ready times for successors for (SchedGraphNode::const_iterator E=node->beginOutEdges(); E != node->endOutEdges(); ++E) { - cycles_t& etime = getEarliestForNodeRef((*E)->getSink()); + cycles_t& etime = getEarliestReadyTimeForNodeRef((*E)->getSink()); etime = std::max(etime, curTime + (*E)->getMinDelay()); } } @@ -216,7 +217,7 @@ SchedPriorities::getNextHighest(const SchedulingManager& S, // If not, remove it from mcands and continue. Refill mcands if // it becomes empty. nextChoice = candsAsHeap.getNode(mcands[nextIdx]); - if (getEarliestForNodeRef(nextChoice) > curTime + if (getEarliestReadyTimeForNode(nextChoice) > curTime || ! instrIsFeasible(S, nextChoice->getMachineInstr()->getOpCode())) { mcands.erase(mcands.begin() + nextIdx); |