Make GetCPISymbol a virtual method.
[oota-llvm.git] / include / llvm / CodeGen / RegisterPressure.h
index b271f7f3d56ae9e6f51f9f8bc83f1fd680d5de0a..a801d1d1eee9bcf4ace6c10896d626159e62d223 100644 (file)
@@ -22,7 +22,7 @@
 namespace llvm {
 
 class LiveIntervals;
-class LiveInterval;
+class LiveRange;
 class RegisterClassInfo;
 class MachineInstr;
 
@@ -112,14 +112,13 @@ public:
     assert(isValid() && "invalid PressureChange");
     return PSetID - 1;
   }
+  // If PSetID is invalid, return UINT16_MAX to give it lowest priority.
+  unsigned getPSetOrMax() const { return (PSetID - 1) & UINT16_MAX; }
 
   int getUnitInc() const { return UnitInc; }
 
   void setUnitInc(int Inc) { UnitInc = Inc; }
 
-  // If PSetID is invalid, convert to INT_MAX to give it lowest priority.
-  int getRank() const { return (PSetID - 1) & INT_MAX; }
-
   bool operator==(const PressureChange &RHS) const {
     return PSetID == RHS.PSetID && UnitInc == RHS.UnitInc;
   }
@@ -146,6 +145,8 @@ public:
   typedef const PressureChange* const_iterator;
   iterator begin() { return &PressureChanges[0]; }
   iterator end() { return &PressureChanges[MaxPSets]; }
+  const_iterator begin() const { return &PressureChanges[0]; }
+  const_iterator end() const { return &PressureChanges[MaxPSets]; }
 
   void addPressureChange(unsigned RegUnit, bool IsDec,
                          const MachineRegisterInfo *MRI);
@@ -158,6 +159,9 @@ class PressureDiffs {
   unsigned Max;
 public:
   PressureDiffs(): PDiffArray(0), Size(0), Max(0) {}
+  ~PressureDiffs() { free(PDiffArray); }
+
+  void clear() { Size = 0; }
 
   void init(unsigned N);
 
@@ -288,6 +292,8 @@ public:
     MF(0), TRI(0), RCI(0), LIS(0), MBB(0), P(rp), RequireIntervals(false),
     TrackUntiedDefs(false) {}
 
+  void reset();
+
   void init(const MachineFunction *mf, const RegisterClassInfo *rci,
             const LiveIntervals *lis, const MachineBasicBlock *mbb,
             MachineBasicBlock::const_iterator pos,
@@ -312,7 +318,7 @@ public:
   SlotIndex getCurrSlot() const;
 
   /// Recede across the previous instruction.
-  bool recede(PressureDiff *PDiff = 0);
+  bool recede(SmallVectorImpl<unsigned> *LiveUses = 0, PressureDiff *PDiff = 0);
 
   /// Advance across the current instruction.
   bool advance();
@@ -418,7 +424,7 @@ public:
   void dump() const;
 
 protected:
-  const LiveInterval *getInterval(unsigned Reg) const;
+  const LiveRange *getLiveRange(unsigned Reg) const;
 
   void increaseRegPressure(ArrayRef<unsigned> Regs);
   void decreaseRegPressure(ArrayRef<unsigned> Regs);