[llvm-commits] CVS: llvm/lib/Target/Sparc/LiveVar/FunctionLiveVarInfo.cpp BBLiveVar.cpp

Alkis Evlogimenos alkis at cs.uiuc.edu
Wed Feb 11 20:28:02 PST 2004


Changes in directory llvm/lib/Target/Sparc/LiveVar:

FunctionLiveVarInfo.cpp updated: 1.52 -> 1.53
BBLiveVar.cpp updated: 1.43 -> 1.44

---
Log message:

Change MachineBasicBlock's vector of MachineInstr pointers into an
ilist of MachineInstr objects. This allows constant time removal and
insertion of MachineInstr instances from anywhere in each
MachineBasicBlock. It also allows for constant time splicing of
MachineInstrs into or out of MachineBasicBlocks.


---
Diffs of the changes:  (+3 -3)

Index: llvm/lib/Target/Sparc/LiveVar/FunctionLiveVarInfo.cpp
diff -u llvm/lib/Target/Sparc/LiveVar/FunctionLiveVarInfo.cpp:1.52 llvm/lib/Target/Sparc/LiveVar/FunctionLiveVarInfo.cpp:1.53
--- llvm/lib/Target/Sparc/LiveVar/FunctionLiveVarInfo.cpp:1.52	Wed Feb 11 14:47:34 2004
+++ llvm/lib/Target/Sparc/LiveVar/FunctionLiveVarInfo.cpp	Wed Feb 11 20:27:09 2004
@@ -283,7 +283,7 @@
   for (MachineBasicBlock::const_reverse_iterator MII = MIVec.rbegin(),
          MIE = MIVec.rend(); MII != MIE; ++MII) {  
     // MI is cur machine inst
-    const MachineInstr *MI = *MII;  
+    const MachineInstr *MI = &*MII;  
 
     MInst2LVSetAI[MI] = SetAI;                 // record in After Inst map
 
@@ -299,7 +299,7 @@
       MachineBasicBlock::const_iterator fwdMII = MII.base(); // ptr to *next* MI
       for (unsigned i = 0; i < DS; ++i, ++fwdMII) {
         assert(fwdMII != MIVec.end() && "Missing instruction in delay slot?");
-        MachineInstr* DelaySlotMI = *fwdMII;
+        const MachineInstr* DelaySlotMI = fwdMII;
         if (! TM.getInstrInfo().isNop(DelaySlotMI->getOpcode())) {
           set_union(*MInst2LVSetBI[DelaySlotMI], *NewSet);
           if (i+1 == DS)


Index: llvm/lib/Target/Sparc/LiveVar/BBLiveVar.cpp
diff -u llvm/lib/Target/Sparc/LiveVar/BBLiveVar.cpp:1.43 llvm/lib/Target/Sparc/LiveVar/BBLiveVar.cpp:1.44
--- llvm/lib/Target/Sparc/LiveVar/BBLiveVar.cpp:1.43	Wed Feb 11 14:47:34 2004
+++ llvm/lib/Target/Sparc/LiveVar/BBLiveVar.cpp	Wed Feb 11 20:27:09 2004
@@ -41,7 +41,7 @@
   // iterate over all the machine instructions in BB
   for (MachineBasicBlock::const_reverse_iterator MII = MBB.rbegin(),
          MIE = MBB.rend(); MII != MIE; ++MII) {
-    const MachineInstr *MI = *MII;
+    const MachineInstr *MI = &*MII;
     
     if (DEBUG_LV >= LV_DEBUG_Verbose) {
       std::cerr << " *Iterating over machine instr ";





More information about the llvm-commits mailing list