[llvm-commits] [llvm] r119853 - /llvm/trunk/lib/Transforms/Scalar/CodeGenPrepare.cpp

Owen Anderson resistor at me.com
Sat Nov 20 13:57:31 PST 2010

On Nov 20, 2010, at 1:16 AM, Duncan Sands wrote:

> Hi Owen,
>> When folding addressing modes in CodeGenPrepare, attempt to look through PHI nodes
>> if all the operands of the PHI are equivalent.  This allows CodeGenPrepare to undo
>> unprofitable PRE transforms.
> is PRE done at the codegen level?  If not, instcombine should have cleaned this
> up already.

I think you misunderstand what CodeGenPrepare does here:  it tries to sink GEPs to their uses
if it is likely the case that those GEPs will be folded into an addressing mode on the load.  My patch
merely enhances that logic to handle loads of phis, if the operands of the phi are all equivalent GEPs.


More information about the llvm-commits mailing list