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

Frits van Bommel fvbommel at gmail.com
Mon Nov 29 15:33:42 PST 2010


On Tue, Nov 30, 2010 at 12:22 AM, Chris Lattner <clattner at apple.com> wrote:
>
> On Nov 29, 2010, at 3:20 PM, Dan Gohman wrote:
>> If it emits both fields as gep+load, then there's no problem.
>>
>> 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.




More information about the llvm-commits mailing list