diff options
author | Dan Gohman <gohman@apple.com> | 2010-05-26 18:52:00 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2010-05-26 18:52:00 +0000 |
commit | 93d343357944beb701d425fc7ef00dd7b0a32bd7 (patch) | |
tree | 6256b23514069d28abf7cfd910bafbffef38b5ba /include/llvm | |
parent | f0f1bfe89a8127d5df82256440eddafd892aeb22 (diff) | |
download | external_llvm-93d343357944beb701d425fc7ef00dd7b0a32bd7.zip external_llvm-93d343357944beb701d425fc7ef00dd7b0a32bd7.tar.gz external_llvm-93d343357944beb701d425fc7ef00dd7b0a32bd7.tar.bz2 |
Eliminate the use of PriorityQueue and just use a std::vector,
implementing pop with a linear search for a "best" element. The priority
queue was a neat idea, but in practice the comparison functions depend
on dynamic information.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@104718 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm')
-rw-r--r-- | include/llvm/CodeGen/LatencyPriorityQueue.h | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/include/llvm/CodeGen/LatencyPriorityQueue.h b/include/llvm/CodeGen/LatencyPriorityQueue.h index 69724bb..13cebea 100644 --- a/include/llvm/CodeGen/LatencyPriorityQueue.h +++ b/include/llvm/CodeGen/LatencyPriorityQueue.h @@ -17,7 +17,6 @@ #define LATENCY_PRIORITY_QUEUE_H #include "llvm/CodeGen/ScheduleDAG.h" -#include "llvm/ADT/PriorityQueue.h" namespace llvm { class LatencyPriorityQueue; @@ -41,10 +40,11 @@ namespace llvm { std::vector<unsigned> NumNodesSolelyBlocking; /// Queue - The queue. - PriorityQueue<SUnit*, std::vector<SUnit*>, latency_sort> Queue; + std::vector<SUnit*> Queue; + latency_sort Picker; public: - LatencyPriorityQueue() : Queue(latency_sort(this)) { + LatencyPriorityQueue() : Picker(this) { } void initNodes(std::vector<SUnit> &sunits) { @@ -77,17 +77,9 @@ namespace llvm { virtual void push(SUnit *U); - SUnit *pop() { - if (empty()) return NULL; - SUnit *V = Queue.top(); - Queue.pop(); - return V; - } + virtual SUnit *pop(); - void remove(SUnit *SU) { - assert(!Queue.empty() && "Not in queue!"); - Queue.erase_one(SU); - } + virtual void remove(SUnit *SU); // ScheduledNode - As nodes are scheduled, we look to see if there are any // successor nodes that have a single unscheduled predecessor. If so, that |