[llvm-commits] [llvm] r141812 - /llvm/trunk/lib/CodeGen/StrongPHIElimination.cpp

Jakob Stoklund Olesen stoklund at 2pi.dk
Wed Oct 12 16:56:37 PDT 2011


On Oct 12, 2011, at 2:24 PM, Cameron Zwarich wrote:

> Author: zwarich
> Date: Wed Oct 12 16:24:54 2011
> New Revision: 141812
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=141812&view=rev
> Log:
> To find the exiting VN of a LiveInterval from a block, use the previous slot
> rather than the previous index. If a block has a single instruction, the
> previous index may be in a different basic block.
> 
> I have no clue how this used to work on all of test-suite, because now this
> failure is seen quite often when trying to compile code with -strong-phi-elim.
> This fixes PR10252.
> 
> Modified:
>    llvm/trunk/lib/CodeGen/StrongPHIElimination.cpp
> 
> Modified: llvm/trunk/lib/CodeGen/StrongPHIElimination.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/StrongPHIElimination.cpp?rev=141812&r1=141811&r2=141812&view=diff
> ==============================================================================
> --- llvm/trunk/lib/CodeGen/StrongPHIElimination.cpp (original)
> +++ llvm/trunk/lib/CodeGen/StrongPHIElimination.cpp Wed Oct 12 16:24:54 2011
> @@ -674,7 +674,7 @@
>     if (PHIColor && SrcColor == PHIColor) {
>       LiveInterval &SrcInterval = LI->getInterval(SrcReg);
>       SlotIndex PredIndex = LI->getMBBEndIdx(PredBB);
> -      VNInfo *SrcVNI = SrcInterval.getVNInfoAt(PredIndex.getPrevIndex());
> +      VNInfo *SrcVNI = SrcInterval.getVNInfoAt(PredIndex.getPrevSlot());
>       assert(SrcVNI);
>       SrcVNI->setHasPHIKill(true);
>       continue;

Andy added a getVNInfoBefore() function that does exactly this.

/jakob




More information about the llvm-commits mailing list