summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2010-05-26 18:52:00 +0000
committerDan Gohman <gohman@apple.com>2010-05-26 18:52:00 +0000
commit93d343357944beb701d425fc7ef00dd7b0a32bd7 (patch)
tree6256b23514069d28abf7cfd910bafbffef38b5ba /include
parentf0f1bfe89a8127d5df82256440eddafd892aeb22 (diff)
downloadllvm-93d343357944beb701d425fc7ef00dd7b0a32bd7.tar.gz
llvm-93d343357944beb701d425fc7ef00dd7b0a32bd7.tar.bz2
llvm-93d343357944beb701d425fc7ef00dd7b0a32bd7.tar.xz
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')
-rw-r--r--include/llvm/CodeGen/LatencyPriorityQueue.h18
1 files changed, 5 insertions, 13 deletions
diff --git a/include/llvm/CodeGen/LatencyPriorityQueue.h b/include/llvm/CodeGen/LatencyPriorityQueue.h
index 69724bba3b..13cebeaf42 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