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

Owen Anderson resistor at mac.com
Sun Nov 2 01:08:19 PDT 2008


Author: resistor
Date: Sun Nov  2 02:08:18 2008
New Revision: 58560

URL: http://llvm.org/viewvc/llvm-project?rev=58560&view=rev
Log:
Don't do pre-splitting if doing so would create a value join that did not
exist before.  Updating the live intervals in that care is tricky in the general
case.

Evan, if you see a tighter guard condition for this, let me know.

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=58560&r1=58559&r2=58560&view=diff

==============================================================================
--- llvm/trunk/lib/CodeGen/PreAllocSplitting.cpp (original)
+++ llvm/trunk/lib/CodeGen/PreAllocSplitting.cpp Sun Nov  2 02:08:18 2008
@@ -89,6 +89,8 @@
         AU.addPreservedID(StrongPHIEliminationID);
       else
         AU.addPreservedID(PHIEliminationID);
+      AU.addRequired<MachineLoopInfo>();
+      AU.addPreserved<MachineLoopInfo>();
       MachineFunctionPass::getAnalysisUsage(AU);
     }
     
@@ -633,6 +635,14 @@
     assert(0 && "Val# is defined by a dead def?");
     abort();
   }
+  
+  // Pre-splitting a vreg that does not have a PHI kill across a barrier
+  // that is within a loop can potentially create a join that was not
+  // present before, which would make updating the live intervals very
+  // difficult.  Bailout instead.
+  MachineLoopInfo& MLI = getAnalysis<MachineLoopInfo>();
+  if (!ValNo->hasPHIKill && MLI.getLoopFor(BarrierMBB))
+    return false;
 
   // FIXME: For now, if definition is rematerializable, do not split.
   MachineInstr *DefMI = (ValNo->def != ~0U)





More information about the llvm-commits mailing list