Reference RegionPass to stop it being eliminated.
[oota-llvm.git] / include / llvm / CodeGen / LatencyPriorityQueue.h
index a7cebee6064ef691c88e8cfb40e495710736829a..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;
@@ -40,18 +39,12 @@ namespace llvm {
     /// mobility.
     std::vector<unsigned> NumNodesSolelyBlocking;
     
-    /// IgnoreAntiDep - Ignore anti-dependencies
-    bool IgnoreAntiDep;
-    
     /// Queue - The queue.
-    PriorityQueue<SUnit*, std::vector<SUnit*>, latency_sort> Queue;
-
-public:
-  LatencyPriorityQueue() : IgnoreAntiDep(false), Queue(latency_sort(this)) {
-    }
+    std::vector<SUnit*> Queue;
+    latency_sort Picker;
 
-    void setIgnoreAntiDep(bool ignore) {
-      IgnoreAntiDep = ignore;
+  public:
+    LatencyPriorityQueue() : Picker(this) {
     }
 
     void initNodes(std::vector<SUnit> &sunits) {
@@ -72,7 +65,7 @@ public:
     
     unsigned getLatency(unsigned NodeNum) const {
       assert(NodeNum < (*SUnits).size());
-      return (*SUnits)[NodeNum].getHeight(IgnoreAntiDep);
+      return (*SUnits)[NodeNum].getHeight();
     }
     
     unsigned getNumSolelyBlockNodes(unsigned NodeNum) const {
@@ -80,31 +73,13 @@ public:
       return NumNodesSolelyBlocking[NodeNum];
     }
     
-    unsigned size() const { return Queue.size(); }
-
     bool empty() const { return Queue.empty(); }
     
-    virtual void push(SUnit *U) {
-      push_impl(U);
-    }
-    void push_impl(SUnit *U);
+    virtual void push(SUnit *U);
     
-    void push_all(const std::vector<SUnit *> &Nodes) {
-      for (unsigned i = 0, e = Nodes.size(); i != e; ++i)
-        push_impl(Nodes[i]);
-    }
-    
-    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