[llvm-commits] [Review request] Instcombine: extractvalue from load --> load from gep

Chris Lattner clattner at apple.com
Mon Nov 29 15:35:21 PST 2010


On Nov 29, 2010, at 3:33 PM, Frits van Bommel wrote:
>>> 
>>> Basically, it's never desirable to actually do an aggregate load or store.
>>> It may be the case they they can be eliminated by optimization much of the
>>> time, but this can fail in various ways, and when it does, you can get
>>> quite unpleasant results. And even when it does work, the best you'll get
>>> is emit the same gep+load that the front-end could have emitted itself
>>> without any extra analysis.
>> 
>> Dan, we require frontends to generate first class aggregates for ABI reasons in some cases.  This happens on X86-64 for example.
> 
> I think Dan is saying that even when they're generated, they should
> never be loaded / stored directly. Presumably, they should instead be
> assembled using insertvalue after being loaded piecewise / broken up
> into pieces using extractvalue before being stored.

Ah, that's a good point!  It still doesn't hurt to have the code in instcombine though.

-Chris



More information about the llvm-commits mailing list