Use the new predicate to control when we do prealloc splitting. Fix a small bug.
authorOwen Anderson <resistor@mac.com>
Wed, 5 Nov 2008 00:32:13 +0000 (00:32 +0000)
committerOwen Anderson <resistor@mac.com>
Wed, 5 Nov 2008 00:32:13 +0000 (00:32 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58738 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/PreAllocSplitting.cpp

index f09ea23c108bc3e2238bce5fbb7dceff0fad4af4..09f002aa2658e2db65bbb3241178a066c1473cea 100644 (file)
@@ -648,6 +648,10 @@ bool PreAllocSplitting::SplitRegLiveInterval(LiveInterval *LI) {
   if (DefMI && LIs->isReMaterializable(*LI, ValNo, DefMI))
     return false;
 
+  // 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),
@@ -862,7 +866,7 @@ bool PreAllocSplitting::createsNewJoin(LiveRange* LR,
       Stack.push_back(std::make_pair(PredMBB, ++S));
       continue;
     } else
-      Stack.push_back(std::make_pair(PredMBB, ++S));
+      Stack.push_back(std::make_pair(PredMBB, S+1));
     
     MachineBasicBlock* MBB = *S;
     Visited.insert(MBB);