Whoops. Committed the headers for r81605 - 'Moved some more index operations over...
authorLang Hames <lhames@gmail.com>
Sat, 12 Sep 2009 04:54:18 +0000 (04:54 +0000)
committerLang Hames <lhames@gmail.com>
Sat, 12 Sep 2009 04:54:18 +0000 (04:54 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81609 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/CodeGen/LiveInterval.h
include/llvm/CodeGen/LiveIntervalAnalysis.h

index 2a8c2c88418ac210c1566fccf8a0bec0194ac272..f61a442a066f7d8a0b4ed7ea1bcc330978c485d7 100644 (file)
@@ -155,25 +155,25 @@ namespace llvm {
         index |= PHI_BIT;
     }
     
-    MachineInstrIndex nextSlot() const {
+    MachineInstrIndex nextSlot_() const {
       assert((index & PHI_BIT) == ((index + 1) & PHI_BIT) &&
              "Index out of bounds.");
       return MachineInstrIndex(index + 1);
     }
 
-    MachineInstrIndex nextIndex() const {
+    MachineInstrIndex nextIndex_() const {
       assert((index & PHI_BIT) == ((index + NUM) & PHI_BIT) &&
              "Index out of bounds.");
       return MachineInstrIndex(index + NUM);
     }
 
-    MachineInstrIndex prevSlot() const {
+    MachineInstrIndex prevSlot_() const {
       assert((index & PHI_BIT) == ((index - 1) & PHI_BIT) &&
              "Index out of bounds.");
       return MachineInstrIndex(index - 1);
     }
 
-    MachineInstrIndex prevIndex() const {
+    MachineInstrIndex prevIndex_() const {
       assert((index & PHI_BIT) == ((index - NUM) & PHI_BIT) &&
              "Index out of bounds.");
       return MachineInstrIndex(index - NUM);
index 3ab73f84968a51414cd9b5e1ffe0af986007dbba..337ec1ce9675aa9c8f1074567a791846da948b9f 100644 (file)
@@ -122,24 +122,22 @@ namespace llvm {
     }
     MachineInstrIndex getStoreIndex(MachineInstrIndex index) {
       return MachineInstrIndex(index, MachineInstrIndex::STORE);
-    }
-
-    
+    }    
 
     MachineInstrIndex getNextSlot(MachineInstrIndex m) const {
-      return m.nextSlot();
+      return m.nextSlot_();
     }
 
     MachineInstrIndex getNextIndex(MachineInstrIndex m) const {
-      return m.nextIndex();
+      return m.nextIndex_();
     }
 
     MachineInstrIndex getPrevSlot(MachineInstrIndex m) const {
-      return m.prevSlot();
+      return m.prevSlot_();
     }
 
     MachineInstrIndex getPrevIndex(MachineInstrIndex m) const {
-      return m.prevIndex();
+      return m.prevIndex_();
     }
 
     static float getSpillWeight(bool isDef, bool isUse, unsigned loopDepth) {
@@ -240,14 +238,14 @@ namespace llvm {
     /// hasGapBeforeInstr - Return true if the previous instruction slot,
     /// i.e. Index - InstrSlots::NUM, is not occupied.
     bool hasGapBeforeInstr(MachineInstrIndex Index) {
-      Index = getBaseIndex(Index.prevIndex());
+      Index = getBaseIndex(getPrevIndex(Index));
       return getInstructionFromIndex(Index) == 0;
     }
 
     /// hasGapAfterInstr - Return true if the successive instruction slot,
     /// i.e. Index + InstrSlots::Num, is not occupied.
     bool hasGapAfterInstr(MachineInstrIndex Index) {
-      Index = getBaseIndex(Index.nextIndex());
+      Index = getBaseIndex(getNextIndex(Index));
       return getInstructionFromIndex(Index) == 0;
     }
 
@@ -256,15 +254,15 @@ namespace llvm {
     /// away from the index (but before any index that's occupied).
     MachineInstrIndex findGapBeforeInstr(MachineInstrIndex Index,
                                          bool Furthest = false) {
-      Index = getBaseIndex(Index.prevIndex());
+      Index = getBaseIndex(getPrevIndex(Index));
       if (getInstructionFromIndex(Index))
         return MachineInstrIndex();  // No gap!
       if (!Furthest)
         return Index;
-      MachineInstrIndex PrevIndex = getBaseIndex(Index.prevIndex());
+      MachineInstrIndex PrevIndex = getBaseIndex(getPrevIndex(Index));
       while (getInstructionFromIndex(Index)) {
         Index = PrevIndex;
-        PrevIndex = getBaseIndex(Index.prevIndex());
+        PrevIndex = getBaseIndex(getPrevIndex(Index));
       }
       return Index;
     }
@@ -272,7 +270,7 @@ namespace llvm {
     /// InsertMachineInstrInMaps - Insert the specified machine instruction
     /// into the instruction index map at the given index.
     void InsertMachineInstrInMaps(MachineInstr *MI, MachineInstrIndex Index) {
-      i2miMap_[Index.index / MachineInstrIndex::NUM] = MI;
+      i2miMap_[Index.getVecIndex()] = MI;
       Mi2IndexMap::iterator it = mi2iMap_.find(MI);
       assert(it == mi2iMap_.end() && "Already in map!");
       mi2iMap_[MI] = Index;