[llvm-commits] [llvm] r81609 - in /llvm/trunk/include/llvm/CodeGen: LiveInterval.h LiveIntervalAnalysis.h

Lang Hames lhames at gmail.com
Fri Sep 11 21:54:19 PDT 2009


Author: lhames
Date: Fri Sep 11 23:54:18 2009
New Revision: 81609

URL: http://llvm.org/viewvc/llvm-project?rev=81609&view=rev
Log:
Whoops. Committed the headers for r81605 - 'Moved some more index operations over to LiveIntervals.'

Modified:
    llvm/trunk/include/llvm/CodeGen/LiveInterval.h
    llvm/trunk/include/llvm/CodeGen/LiveIntervalAnalysis.h

Modified: llvm/trunk/include/llvm/CodeGen/LiveInterval.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/LiveInterval.h?rev=81609&r1=81608&r2=81609&view=diff

==============================================================================
--- llvm/trunk/include/llvm/CodeGen/LiveInterval.h (original)
+++ llvm/trunk/include/llvm/CodeGen/LiveInterval.h Fri Sep 11 23:54:18 2009
@@ -155,25 +155,25 @@
         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);

Modified: llvm/trunk/include/llvm/CodeGen/LiveIntervalAnalysis.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/LiveIntervalAnalysis.h?rev=81609&r1=81608&r2=81609&view=diff

==============================================================================
--- llvm/trunk/include/llvm/CodeGen/LiveIntervalAnalysis.h (original)
+++ llvm/trunk/include/llvm/CodeGen/LiveIntervalAnalysis.h Fri Sep 11 23:54:18 2009
@@ -122,24 +122,22 @@
     }
     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 @@
     /// 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 @@
     /// 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 @@
     /// 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;





More information about the llvm-commits mailing list