Use instruction itinerary to determine what instructions are 'cheap'.
[oota-llvm.git] / include / llvm / CodeGen / LatencyPriorityQueue.h
index 18c418b103ac8f387aada9f5ab1e86418d6a15c9..13cebeaf42f47dff5af2ee9aa672037aac3b92d2 100644 (file)
@@ -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)) {
+  public:
+    LatencyPriorityQueue() : Picker(this) {
     }
 
     void initNodes(std::vector<SUnit> &sunits) {
@@ -77,17 +77,9 @@ public:
     
     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