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

Evan Cheng evan.cheng at apple.com
Tue Apr 17 19:30:41 PDT 2007



Changes in directory llvm/lib/CodeGen:

LiveIntervalAnalysis.cpp updated: 1.235 -> 1.236
---
Log message:

Don't populate TryAgainList when coalescing only physical registers with virtual registers.

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

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


Index: llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
diff -u llvm/lib/CodeGen/LiveIntervalAnalysis.cpp:1.235 llvm/lib/CodeGen/LiveIntervalAnalysis.cpp:1.236
--- llvm/lib/CodeGen/LiveIntervalAnalysis.cpp:1.235	Tue Apr 17 15:32:26 2007
+++ llvm/lib/CodeGen/LiveIntervalAnalysis.cpp	Tue Apr 17 21:30:19 2007
@@ -1473,7 +1473,7 @@
 
 
 void LiveIntervals::CopyCoallesceInMBB(MachineBasicBlock *MBB,
-                                std::vector<CopyRec> &TryAgain, bool PhysOnly) {
+                                std::vector<CopyRec> *TryAgain, bool PhysOnly) {
   DOUT << ((Value*)MBB->getBasicBlock())->getName() << ":\n";
   
   for (MachineBasicBlock::iterator MII = MBB->begin(), E = MBB->end();
@@ -1484,8 +1484,8 @@
     unsigned SrcReg, DstReg;
     if (!tii_->isMoveInstr(*Inst, SrcReg, DstReg)) continue;
     
-    if (!JoinCopy(Inst, SrcReg, DstReg, PhysOnly))
-      TryAgain.push_back(getCopyRec(Inst, SrcReg, DstReg));
+    if (TryAgain && !JoinCopy(Inst, SrcReg, DstReg, PhysOnly))
+      TryAgain->push_back(getCopyRec(Inst, SrcReg, DstReg));
   }
 }
 
@@ -1502,7 +1502,7 @@
     // If there are no loops in the function, join intervals in function order.
     for (MachineFunction::iterator I = mf_->begin(), E = mf_->end();
          I != E; ++I)
-      CopyCoallesceInMBB(I, TryAgainList);
+      CopyCoallesceInMBB(I, &TryAgainList);
   } else {
     // Otherwise, join intervals in inner loops before other intervals.
     // Unfortunately we can't just iterate over loop hierarchy here because
@@ -1519,9 +1519,9 @@
 
     // Finally, join intervals in loop nest order.
     for (unsigned i = 0, e = MBBs.size(); i != e; ++i)
-      CopyCoallesceInMBB(MBBs[i].second, TryAgainList, true);
+      CopyCoallesceInMBB(MBBs[i].second, NULL, true);
     for (unsigned i = 0, e = MBBs.size(); i != e; ++i)
-      CopyCoallesceInMBB(MBBs[i].second, TryAgainList, false);
+      CopyCoallesceInMBB(MBBs[i].second, &TryAgainList, false);
   }
   
   // Joining intervals can allow other intervals to be joined.  Iteratively join






More information about the llvm-commits mailing list