[llvm-commits] [llvm] r62073 - /llvm/trunk/lib/CodeGen/PreAllocSplitting.cpp

Owen Anderson resistor at mac.com
Sun Jan 11 19:10:41 PST 2009


Author: resistor
Date: Sun Jan 11 21:10:40 2009
New Revision: 62073

URL: http://llvm.org/viewvc/llvm-project?rev=62073&view=rev
Log:
More two-address fixes.  This gets lua working with join-creation enabled.

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

Modified: llvm/trunk/lib/CodeGen/PreAllocSplitting.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/PreAllocSplitting.cpp?rev=62073&r1=62072&r2=62073&view=diff

==============================================================================
--- llvm/trunk/lib/CodeGen/PreAllocSplitting.cpp (original)
+++ llvm/trunk/lib/CodeGen/PreAllocSplitting.cpp Sun Jan 11 21:10:40 2009
@@ -639,6 +639,8 @@
         EndIndex = LIs->getMBBEndIdx(MBB);
       
       LI->addRange(LiveRange(StartIndex, EndIndex+1, ret));
+      if (intrablock)
+        LI->addKill(ret, EndIndex);
     } else {
       Phis[MBB] = ret = LI->getNextValue(~0U, /*FIXME*/ 0,
                                           LIs->getVNInfoAllocator());
@@ -673,6 +675,8 @@
       } else
         EndIndex = LIs->getMBBEndIdx(MBB);
       LI->addRange(LiveRange(StartIndex, EndIndex+1, ret));
+      if (intrablock)
+        LI->addKill(ret, EndIndex);
     }
   } else if (ContainsDefs && !ContainsUses) {
     SmallPtrSet<MachineInstr*, 2>& BlockDefs = Defs[MBB];
@@ -808,7 +812,8 @@
   // Memoize results so we don't have to recompute them.
   if (!intrablock) LiveOut[MBB] = ret;
   else {
-    NewVNs[use] = ret;
+    if (!NewVNs.count(use))
+      NewVNs[use] = ret;
     Visited.insert(use);
   }
 
@@ -1124,13 +1129,14 @@
   if (KillPt->getParent() == BarrierMBB) {
     UpdateRegisterInterval(ValNo, LIs->getUseIndex(KillIdx)+1,
                            LIs->getDefIndex(RestoreIdx));
-
+    
     ++NumSplits;
     ++NumRemats;
     return true;
   }
 
   RepairLiveInterval(CurrLI, ValNo, DefMI, RestoreIdx);
+  
   ++NumSplits;
   ++NumRemats;
   return true;  
@@ -1211,10 +1217,6 @@
   MachineInstr *DefMI = (ValNo->def != ~0U)
     ? LIs->getInstructionFromIndex(ValNo->def) : NULL;
 
-  // If this would create a new join point, do not split.
-  if (DefMI && createsNewJoin(LR, DefMI->getParent(), Barrier->getParent()))
-    return false;
-
   // Find all references in the barrier mbb.
   SmallPtrSet<MachineInstr*, 4> RefsInMBB;
   for (MachineRegisterInfo::reg_iterator I = MRI->reg_begin(CurrLI->reg),
@@ -1355,6 +1357,8 @@
   while (!Intervals.empty()) {
     if (PreSplitLimit != -1 && (int)NumSplits == PreSplitLimit)
       break;
+    else if (NumSplits == 4)
+      Change |= Change;
     LiveInterval *LI = Intervals.back();
     Intervals.pop_back();
     Change |= SplitRegLiveInterval(LI);





More information about the llvm-commits mailing list