no really, I can spell!
[oota-llvm.git] / include / llvm / CodeGen / LiveIntervalAnalysis.h
index 01ea6092e8c5cb13079cb61d639f09ac474fc395..40991e74e3c0a77a8a0b6cfc4066ddb504afa391 100644 (file)
@@ -88,24 +88,18 @@ namespace llvm {
     typedef DenseMap<unsigned, LiveInterval*> Reg2IntervalMap;
     Reg2IntervalMap r2iMap_;
 
+    DenseMap<MachineBasicBlock*, unsigned> terminatorGaps;
+
     BitVector allocatableRegs_;
 
     std::vector<MachineInstr*> ClonedMIs;
 
+    typedef LiveInterval::InstrSlots InstrSlots;
+
   public:
     static char ID; // Pass identification, replacement for typeid
     LiveIntervals() : MachineFunctionPass(&ID) {}
 
-    struct InstrSlots {
-      enum {
-        LOAD  = 0,
-        USE   = 1,
-        DEF   = 2,
-        STORE = 3,
-        NUM   = 4
-      };
-    };
-
     static unsigned getBaseIndex(unsigned index) {
       return index - (index % InstrSlots::NUM);
     }
@@ -226,6 +220,13 @@ namespace llvm {
       return getInstructionFromIndex(Index) == 0;
     }
 
+    /// hasGapAfterInstr - Return true if the successive instruction slot,
+    /// i.e. Index + InstrSlots::Num, is not occupied.
+    bool hasGapAfterInstr(unsigned Index) {
+      Index = getBaseIndex(Index + InstrSlots::NUM);
+      return getInstructionFromIndex(Index) == 0;
+    }
+
     /// findGapBeforeInstr - Find an empty instruction slot before the
     /// specified index. If "Furthest" is true, find one that's furthest
     /// away from the index (but before any index that's occupied).
@@ -391,9 +392,17 @@ namespace llvm {
     unsigned getNumConflictsWithPhysReg(const LiveInterval &li,
                                         unsigned PhysReg) const;
 
+    /// processImplicitDefs - Process IMPLICIT_DEF instructions. Add isUndef
+    /// marker to implicit_def defs and their uses.
+    void processImplicitDefs();
+
     /// computeNumbering - Compute the index numbering.
     void computeNumbering();
 
+    /// scaleNumbering - Rescale interval numbers to introduce gaps for new
+    /// instructions
+    void scaleNumbering(int factor);
+
     /// intervalIsInOneMBB - Returns true if the specified interval is entirely
     /// within a single basic block.
     bool intervalIsInOneMBB(const LiveInterval &li) const;