[llvm-commits] [llvm] r54956 - /llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp

Owen Anderson resistor at mac.com
Mon Aug 18 16:41:05 PDT 2008


Author: resistor
Date: Mon Aug 18 18:41:04 2008
New Revision: 54956

URL: http://llvm.org/viewvc/llvm-project?rev=54956&view=rev
Log:
Fix a few more bugs:
  1) Assign stack slots to new temporaries.
  2) Don't insert an interval into the return vector more than once.

Modified:
    llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp

Modified: llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp?rev=54956&r1=54955&r2=54956&view=diff

==============================================================================
--- llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp (original)
+++ llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp Mon Aug 18 18:41:04 2008
@@ -1608,7 +1608,7 @@
 addIntervalsForSpillsFast(const LiveInterval &li,
                           const MachineLoopInfo *loopInfo,
                           VirtRegMap &vrm, float& SSWeight) {
-  vrm.assignVirt2StackSlot(li.reg);
+  unsigned slot = vrm.assignVirt2StackSlot(li.reg);
 
   std::vector<LiveInterval*> added;
 
@@ -1631,9 +1631,13 @@
     // Create a new virtual register for the spill interval.
     MachineOperand& MO = RI.getOperand();
     unsigned NewVReg = 0;
+    bool newInt = false;
     if (!VRegMap.count(MO.getParent())) {
       VRegMap[MO.getParent()] = NewVReg = mri_->createVirtualRegister(rc);
       vrm.grow();
+      vrm.assignVirt2StackSlot(NewVReg, slot);
+      
+      newInt = true;
     } else
       NewVReg = VRegMap[MO.getParent()];
     
@@ -1666,8 +1670,9 @@
       DOUT << " +" << LR;
       nI.addRange(LR);
     }
-        
-    added.push_back(&nI);
+    
+    if (newInt)
+      added.push_back(&nI);
         
     DOUT << "\t\t\t\tadded new interval: ";
     DEBUG(nI.dump());





More information about the llvm-commits mailing list