[llvm-commits] CVS: llvm/lib/Target/Sparc/RegAlloc/PhyRegAlloc.cpp

Alkis Evlogimenos alkis at cs.uiuc.edu
Fri Feb 13 19:19:10 PST 2004


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

PhyRegAlloc.cpp updated: 1.136 -> 1.137

---
Log message:

Use newly added next() and prior() utility functions.


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

Index: llvm/lib/Target/Sparc/RegAlloc/PhyRegAlloc.cpp
diff -u llvm/lib/Target/Sparc/RegAlloc/PhyRegAlloc.cpp:1.136 llvm/lib/Target/Sparc/RegAlloc/PhyRegAlloc.cpp:1.137
--- llvm/lib/Target/Sparc/RegAlloc/PhyRegAlloc.cpp:1.136	Fri Feb 13 15:01:19 2004
+++ llvm/lib/Target/Sparc/RegAlloc/PhyRegAlloc.cpp	Fri Feb 13 19:18:33 2004
@@ -514,7 +514,7 @@
     for (MachineBasicBlock::iterator MII = MBB.begin(); MII != MBB.end(); ++MII)
       if (unsigned delaySlots =
           TM.getInstrInfo().getNumDelaySlots(MII->getOpcode())) { 
-          MachineBasicBlock::iterator DelaySlotMI = MII; ++DelaySlotMI;
+          MachineBasicBlock::iterator DelaySlotMI = next(MII);
           assert(DelaySlotMI != MBB.end() && "no instruction for delay slot");
           
           // Check the 2 conditions above:
@@ -552,8 +552,7 @@
           else {
             // For non-branch instr with delay slots (probably a call), move
             // InstrAfter to the instr. in the last delay slot.
-            MachineBasicBlock::iterator tmp = MII;
-            std::advance(tmp, delaySlots);
+            MachineBasicBlock::iterator tmp = next(MII, delaySlots);
             move2DelayedInstr(MII, tmp);
           }
       }
@@ -646,8 +645,7 @@
   // include all live variables before that branch or return -- we don't want to
   // trample those!  Verify that the set is included in the LV set before MInst.
   if (MII != MBB.begin()) {
-    MachineBasicBlock::iterator PredMI = MII;
-    --PredMI;
+    MachineBasicBlock::iterator PredMI = prior(MII);
     if (unsigned DS = TM.getInstrInfo().getNumDelaySlots(PredMI->getOpcode()))
       assert(set_difference(LVI->getLiveVarSetBeforeMInst(PredMI), LVSetBef)
              .empty() && "Live-var set before branch should be included in "





More information about the llvm-commits mailing list