Revert Christopher Lamb's load/store alignment changes.
[oota-llvm.git] / include / llvm / CodeGen / LiveInterval.h
index 16fcd1260e600334f3d0e372784d132ce798aa93..1912d6429600a6df1955f596bba32e254be904e0 100644 (file)
@@ -28,6 +28,7 @@
 #include <cassert>
 
 namespace llvm {
+  class MachineInstr;
   class MRegisterInfo;
 
   /// LiveRange structure - This represents a simple register range in the
@@ -56,16 +57,15 @@ namespace llvm {
     }
 
     void dump() const;
+    void print(std::ostream &os) const;
+    void print(std::ostream *os) const { if (os) print(*os); }
 
   private:
     LiveRange(); // DO NOT IMPLEMENT
   };
 
   std::ostream& operator<<(std::ostream& os, const LiveRange &LR);
-  inline llvm_ostream& operator<<(llvm_ostream& os, const LiveRange &LR) {
-    if (os.stream()) *os.stream() << LR;
-    return os;
-  }
+
 
   inline bool operator<(unsigned V, const LiveRange &LR) {
     return V < LR.start;
@@ -81,7 +81,9 @@ namespace llvm {
   struct LiveInterval {
     typedef SmallVector<LiveRange,4> Ranges;
     unsigned reg;        // the register of this interval
+    unsigned preference; // preferred register to allocate for this interval
     float weight;        // weight of this interval
+    MachineInstr* remat; // definition if the definition rematerializable
     Ranges ranges;       // the ranges in which this register is live
   private:
     /// ValueNumberInfo - If this value number is not defined by a copy, this
@@ -93,7 +95,7 @@ namespace llvm {
   public:
 
     LiveInterval(unsigned Reg, float Weight)
-      : reg(Reg), weight(Weight) {
+      : reg(Reg), preference(0), weight(Weight), remat(NULL) {
     }
 
     typedef Ranges::iterator iterator;
@@ -120,6 +122,7 @@ namespace llvm {
     void swap(LiveInterval& other) {
       std::swap(reg, other.reg);
       std::swap(weight, other.weight);
+      std::swap(remat, other.remat);
       std::swap(ranges, other.ranges);
       std::swap(ValueNumberInfo, other.ValueNumberInfo);
     }
@@ -254,13 +257,17 @@ namespace llvm {
       removeRange(LR.start, LR.end);
     }
 
+    /// getSize - Returns the sum of sizes of all the LiveRange's.
+    ///
+    unsigned getSize() const;
+
     bool operator<(const LiveInterval& other) const {
       return beginNumber() < other.beginNumber();
     }
 
-    void print(llvm_ostream OS, const MRegisterInfo *MRI = 0) const;
-    void print(std::ostream &OS, const MRegisterInfo *MRI = 0) const {
-      print(llvm_ostream(OS), MRI);
+    void print(std::ostream &OS, const MRegisterInfo *MRI = 0) const;
+    void print(std::ostream *OS, const MRegisterInfo *MRI = 0) const {
+      if (OS) print(*OS, MRI);
     }
     void dump() const;
 
@@ -271,11 +278,6 @@ namespace llvm {
     LiveInterval& operator=(const LiveInterval& rhs); // DO NOT IMPLEMENT
   };
 
-  inline llvm_ostream &operator<<(llvm_ostream &OS, const LiveInterval &LI) {
-    LI.print(OS);
-    return OS;
-  }
-
   inline std::ostream &operator<<(std::ostream &OS, const LiveInterval &LI) {
     LI.print(OS);
     return OS;