[llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp
Chris Lattner
lattner at cs.uiuc.edu
Thu Mar 9 20:33:01 PST 2006
Changes in directory llvm/lib/CodeGen/SelectionDAG:
ScheduleDAGList.cpp updated: 1.33 -> 1.34
---
Log message:
add an aggregate method for reinserting scheduled nodes, add a callback for
priority impls that want to be notified when a node is scheduled
---
Diffs of the changes: (+23 -8)
ScheduleDAGList.cpp | 31 +++++++++++++++++++++++--------
1 files changed, 23 insertions(+), 8 deletions(-)
Index: llvm/lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp:1.33 llvm/lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp:1.34
--- llvm/lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp:1.33 Thu Mar 9 21:57:45 2006
+++ llvm/lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp Thu Mar 9 22:32:49 2006
@@ -141,7 +141,14 @@
virtual bool empty() const = 0;
virtual void push(SUnit *U) = 0;
+
+ virtual void push_all(const std::vector<SUnit *> &Nodes) = 0;
virtual SUnit *pop() = 0;
+
+ /// ScheduledNode - As each node is scheduled, this method is invoked. This
+ /// allows the priority function to adjust the priority of node that have
+ /// already been emitted.
+ virtual void ScheduledNode(SUnit *Node) {}
};
}
@@ -340,11 +347,10 @@
}
// Add the nodes that aren't ready back onto the available list.
- while (!NotReady.empty()) {
- PriorityQueue->push(NotReady.back());
- NotReady.pop_back();
- }
+ PriorityQueue->push_all(NotReady);
+ NotReady.clear();
+ PriorityQueue->ScheduledNode(CurrNode);
ScheduleNodeBottomUp(CurrNode);
}
@@ -421,13 +427,12 @@
} while (!PriorityQueue->empty());
// Add the nodes that aren't ready back onto the available list.
- while (!NotReady.empty()) {
- PriorityQueue->push(NotReady.back());
- NotReady.pop_back();
- }
+ PriorityQueue->push_all(NotReady);
+ NotReady.clear();
// If we found a node to schedule, do it now.
if (FoundNode) {
+ PriorityQueue->ScheduledNode(FoundNode);
ScheduleNodeTopDown(FoundNode);
HazardRec->EmitInstruction(FoundNode->Node);
} else if (!HasNoopHazards) {
@@ -700,6 +705,11 @@
void push(SUnit *U) {
Queue.push(U);
}
+ void push_all(const std::vector<SUnit *> &Nodes) {
+ for (unsigned i = 0, e = Nodes.size(); i != e; ++i)
+ Queue.push(Nodes[i]);
+ }
+
SUnit *pop() {
SUnit *V = Queue.top();
Queue.pop();
@@ -843,6 +853,11 @@
void push(SUnit *U) {
Queue.push(U);
}
+ void push_all(const std::vector<SUnit *> &Nodes) {
+ for (unsigned i = 0, e = Nodes.size(); i != e; ++i)
+ Queue.push(Nodes[i]);
+ }
+
SUnit *pop() {
SUnit *V = Queue.top();
Queue.pop();
More information about the llvm-commits
mailing list