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

Alkis Evlogimenos alkis at cs.uiuc.edu
Sat Jan 31 17:49:02 PST 2004


Changes in directory llvm/lib/CodeGen:

LiveIntervals.cpp updated: 1.37 -> 1.38

---
Log message:

Apply final part of Chris' patch.


---
Diffs of the changes:  (+9 -11)

Index: llvm/lib/CodeGen/LiveIntervals.cpp
diff -u llvm/lib/CodeGen/LiveIntervals.cpp:1.37 llvm/lib/CodeGen/LiveIntervals.cpp:1.38
--- llvm/lib/CodeGen/LiveIntervals.cpp:1.37	Sat Jan 31 17:13:30 2004
+++ llvm/lib/CodeGen/LiveIntervals.cpp	Sat Jan 31 17:48:47 2004
@@ -168,17 +168,15 @@
         interval = &*r2iit->second;
     }
 
-    for (MbbIndex2MbbMap::iterator
-             it = mbbi2mbbMap_.begin(), itEnd = mbbi2mbbMap_.end();
-         it != itEnd; ++it) {
-        unsigned liveBlockIndex = it->first;
-        MachineBasicBlock* liveBlock = it->second;
-        if (liveBlockIndex < vi.AliveBlocks.size() &&
-            vi.AliveBlocks[liveBlockIndex] &&
-            !liveBlock->empty()) {
-            unsigned start =  getInstructionIndex(liveBlock->front());
-            unsigned end = getInstructionIndex(liveBlock->back()) + 1;
-            interval->addRange(start, end);
+    // iterate over all of the blocks that the variable is completely
+    // live in, adding them to the live interval
+    for (unsigned i = 0, e = vi.AliveBlocks.size(); i != e; ++i) {
+        if (vi.AliveBlocks[i]) {
+            MachineBasicBlock* mbb = lv_->getIndexMachineBasicBlock(i);
+            if (!mbb->empty()) {
+                interval->addRange(getInstructionIndex(mbb->front()),
+                                   getInstructionIndex(mbb->back()) + 1);
+            }
         }
     }
 





More information about the llvm-commits mailing list