[llvm-commits] CVS: llvm/lib/CodeGen/LiveIntervalAnalysis.cpp

Jim Laskey jlaskey at apple.com
Wed Feb 21 14:41:38 PST 2007



Changes in directory llvm/lib/CodeGen:

LiveIntervalAnalysis.cpp updated: 1.210 -> 1.211
---
Log message:

Allow for live in registers for eh landing pads.

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

 LiveIntervalAnalysis.cpp |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)


Index: llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
diff -u llvm/lib/CodeGen/LiveIntervalAnalysis.cpp:1.210 llvm/lib/CodeGen/LiveIntervalAnalysis.cpp:1.211
--- llvm/lib/CodeGen/LiveIntervalAnalysis.cpp:1.210	Tue Feb 20 20:27:39 2007
+++ llvm/lib/CodeGen/LiveIntervalAnalysis.cpp	Wed Feb 21 16:41:17 2007
@@ -658,14 +658,15 @@
 }
 
 void LiveIntervals::handleLiveInRegister(MachineBasicBlock *MBB,
+                                         unsigned MIIdx,
                                          LiveInterval &interval) {
   DOUT << "\t\tlivein register: "; DEBUG(printRegName(interval.reg));
 
   // Look for kills, if it reaches a def before it's killed, then it shouldn't
   // be considered a livein.
   MachineBasicBlock::iterator mi = MBB->begin();
-  unsigned baseIndex = 0;
-  unsigned start = 0;
+  unsigned baseIndex = MIIdx;
+  unsigned start = baseIndex;
   unsigned end = start;
   while (mi != MBB->end()) {
     if (lv_->KillsRegister(mi, interval.reg)) {
@@ -690,8 +691,8 @@
   assert(start < end && "did not find end of interval?");
 
   LiveRange LR(start, end, interval.getNextValue(~0U, 0));
-  interval.addRange(LR);
   DOUT << " +" << LR << '\n';
+  interval.addRange(LR);
 }
 
 /// computeIntervals - computes the live intervals for virtual
@@ -715,9 +716,9 @@
       // Create intervals for live-ins to this BB first.
       for (MachineBasicBlock::const_livein_iterator LI = MBB->livein_begin(),
              LE = MBB->livein_end(); LI != LE; ++LI) {
-        handleLiveInRegister(MBB, getOrCreateInterval(*LI));
+        handleLiveInRegister(MBB, MIIndex, getOrCreateInterval(*LI));
         for (const unsigned* AS = mri_->getAliasSet(*LI); *AS; ++AS)
-          handleLiveInRegister(MBB, getOrCreateInterval(*AS));
+          handleLiveInRegister(MBB, MIIndex, getOrCreateInterval(*AS));
       }
     }
     






More information about the llvm-commits mailing list