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

Evan Cheng evan.cheng at apple.com
Mon Nov 3 10:39:14 PST 2008


Thanks. Your check was overly restrictive. The proper check needs if  
any bb that's part of the live ranges defined by the val# can be  
reached from the def instruction and the restore instruction. I see  
one of the following solutions:

1. Walk the cfg from both def mbb and barrier mbb and look for new  
joins. This is potentially expensive so perhaps we can cache the  
information for live interval shrink wrapping?
2. Detect this during live interval shrink wrapping and introduce a  
new val# to define the joined portion and mark old and new val# as  
hasPHIKill.
3. Detect this during live interval shrink wrapping and undo all the  
changes?

Seems to me #2 is the ideal solution unless #1 turns out to be  
relative cheap.

Evan

On Nov 2, 2008, at 6:33 PM, Owen Anderson wrote:

> Author: resistor
> Date: Sun Nov  2 20:33:28 2008
> New Revision: 58591
>
> URL: http://llvm.org/viewvc/llvm-project?rev=58591&view=rev
> Log:
> Revert my last patch until I consult with Evan about it.
>
> 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=58591&r1=58590&r2=58591&view=diff
>
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> ======================================================================
> --- llvm/trunk/lib/CodeGen/PreAllocSplitting.cpp (original)
> +++ llvm/trunk/lib/CodeGen/PreAllocSplitting.cpp Sun Nov  2 20:33:28  
> 2008
> @@ -89,8 +89,6 @@
>         AU.addPreservedID(StrongPHIEliminationID);
>       else
>         AU.addPreservedID(PHIEliminationID);
> -      AU.addRequired<MachineLoopInfo>();
> -      AU.addPreserved<MachineLoopInfo>();
>       MachineFunctionPass::getAnalysisUsage(AU);
>     }
>
> @@ -635,14 +633,6 @@
>     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)
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits




More information about the llvm-commits mailing list