[llvm-commits] [llvm] r72562 - /llvm/trunk/lib/Transforms/Scalar/GVN.cpp

Chris Lattner clattner at apple.com
Thu May 28 22:43:56 PDT 2009


On May 28, 2009, at 10:37 PM, Owen Anderson wrote:

> Author: resistor
> Date: Fri May 29 00:37:54 2009
> New Revision: 72562
>
> URL: http://llvm.org/viewvc/llvm-project?rev=72562&view=rev
> Log:
> Fix an issue where phiMap was not being updated properly when doing  
> load PRE.
>
> Diagnosis and patch thanks to Jakub Staszak.

Nice, does this fix the "load pre breaks llvmgcc bootstrap" problem?

-Chris

>
>
> Modified:
>    llvm/trunk/lib/Transforms/Scalar/GVN.cpp
>
> Modified: llvm/trunk/lib/Transforms/Scalar/GVN.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/GVN.cpp?rev=72562&r1=72561&r2=72562&view=diff
>
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> ======================================================================
> --- llvm/trunk/lib/Transforms/Scalar/GVN.cpp (original)
> +++ llvm/trunk/lib/Transforms/Scalar/GVN.cpp Fri May 29 00:37:54 2009
> @@ -1125,6 +1125,11 @@
>                                 LI->getAlignment(),
>                                 UnavailablePred->getTerminator());
>
> +  SmallPtrSet<Instruction*, 4> &p = phiMap[LI->getPointerOperand()];
> +  for (SmallPtrSet<Instruction*, 4>::iterator I = p.begin(), E =  
> p.end();
> +       I != E; ++I)
> +    ValuesPerBlock.push_back(std::make_pair((*I)->getParent(), *I));
> +
>   DenseMap<BasicBlock*, Value*> BlockReplValues;
>   BlockReplValues.insert(ValuesPerBlock.begin(),  
> ValuesPerBlock.end());
>   BlockReplValues[UnavailablePred] = NewLoad;
>
>
> _______________________________________________
> 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