EXTRACT_SUBREG coalescing support. The coalescer now treats EXTRACT_SUBREG like
[oota-llvm.git] / include / llvm / CodeGen / LiveIntervalAnalysis.h
index 8e7a100b9636215aafad999172970a0cd6f8001c..bf0a8295d5fad0f8a1222609d69194a09740abdc 100644 (file)
@@ -27,6 +27,7 @@
 #include "llvm/ADT/IndexedMap.h"
 #include "llvm/ADT/SmallPtrSet.h"
 #include "llvm/ADT/SmallVector.h"
+#include "llvm/Support/Allocator.h"
 
 namespace llvm {
 
@@ -43,6 +44,10 @@ namespace llvm {
     const TargetInstrInfo* tii_;
     LiveVariables* lv_;
 
+    /// Special pool allocator for VNInfo's (LiveInterval val#).
+    ///
+    BumpPtrAllocator VNInfoAllocator;
+
     /// MBB2IdxMap - The indexes of the first and last instructions in the
     /// specified basic block.
     std::vector<std::pair<unsigned, unsigned> > MBB2IdxMap;
@@ -162,11 +167,6 @@ namespace llvm {
       return I->second;
     }
 
-    /// CreateNewLiveInterval - Create a new live interval with the given live
-    /// ranges. The new live interval will have an infinite spill weight.
-    LiveInterval &CreateNewLiveInterval(const LiveInterval *LI,
-                                        const std::vector<LiveRange> &LRs);
-
     std::vector<LiveInterval*> addIntervalsForSpills(const LiveInterval& i,
                                                  VirtRegMap& vrm, unsigned reg);
 
@@ -194,6 +194,8 @@ namespace llvm {
       }
     }
 
+    BumpPtrAllocator& getVNInfoAllocator() { return VNInfoAllocator; }
+
     virtual void getAnalysisUsage(AnalysisUsage &AU) const;
     virtual void releaseMemory();
 
@@ -239,14 +241,16 @@ namespace llvm {
 
     /// isReMaterializable - Returns true if the definition MI of the specified
     /// val# of the specified interval is re-materializable.
-    bool isReMaterializable(const LiveInterval &li, unsigned ValNum,
+    bool isReMaterializable(const LiveInterval &li, const VNInfo *ValNo,
                             MachineInstr *MI);
 
-    /// tryFoldMemoryOperand - Attempts to fold a spill / restore from slot
-    /// to reg into ith operand of specified MI. If it is successul, MI is
-    /// updated with the newly created MI and returns true.
-    bool tryFoldMemoryOperand(MachineInstr* &MI, VirtRegMap &vrm, unsigned index,
-                              unsigned i, int slot, unsigned reg);
+    /// tryFoldMemoryOperand - Attempts to fold either a spill / restore from
+    /// slot / to reg or any rematerialized load into ith operand of specified
+    /// MI. If it is successul, MI is updated with the newly created MI and
+    /// returns true.
+    bool tryFoldMemoryOperand(MachineInstr* &MI, VirtRegMap &vrm,
+                              MachineInstr *DefMI, unsigned index, unsigned i,
+                              bool isSS, int slot, unsigned reg);
 
     static LiveInterval createInterval(unsigned Reg);