Fix PHI handling in LiveIntervals::shrinkToUses().
authorJakob Stoklund Olesen <stoklund@2pi.dk>
Thu, 3 Mar 2011 00:20:51 +0000 (00:20 +0000)
committerJakob Stoklund Olesen <stoklund@2pi.dk>
Thu, 3 Mar 2011 00:20:51 +0000 (00:20 +0000)
We need to wait until we meet a PHIDef in its defining block before resurrecting
PHIKills in the predecessors.

This should unbreak the llvm-gcc-build-x86_64-darwin10-x-mingw32-x-armeabi bot.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126905 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/LiveIntervalAnalysis.cpp

index 92829b1ea46244fe143a636c63917ef8b6549b5d..d326729920478ace01b3b650ec229eaac8b43ba1 100644 (file)
@@ -797,7 +797,7 @@ void LiveIntervals::shrinkToUses(LiveInterval *li) {
       (void)ExtVNI;
       assert(ExtVNI == VNI && "Unexpected existing value number");
       // Is this a PHIDef we haven't seen before?
-      if (!VNI->isPHIDef() || !UsedPHIs.insert(VNI))
+      if (!VNI->isPHIDef() || VNI->def != BlockStart || !UsedPHIs.insert(VNI))
         continue;
       // The PHI is live, make sure the predecessors are live-out.
       for (MachineBasicBlock::const_pred_iterator PI = MBB->pred_begin(),