[llvm-commits] [PATCH] Promote all possible memory to registers

Kenneth Uildriks kennethuil at gmail.com
Sat Oct 23 10:29:24 PDT 2010


On Sat, Oct 23, 2010 at 12:17 PM, Eli Friedman <eli.friedman at gmail.com> wrote:
> On Sat, Oct 23, 2010 at 9:07 AM, Kenneth Uildriks <kennethuil at gmail.com> wrote:
>> On Sat, Oct 23, 2010 at 9:04 AM, Chris Lattner <clattner at apple.com> wrote:
>>> Hi Kenneth,
>>>
>>> I haven't looked at the patch yet, but how is this different than the standard GVN pass?
>>>
>>> -Chris
>>
>> Now that I've looked more closely at GVN, not different enough to
>> justify a new pass.
>>
>> I believe it would benefit from having direct support for
>> llvm.invariant.begin and llvm.invariant.end added to it, for the
>> reasons I outlined in my first message.
>>
>> I've noticed that instcombine does redundant load elimination,
>> strictly by querying memdep to find the corresponding stores rather
>> than doing top-down stored-value tracing like GVN does.  Does it
>> handle cases that GVN doesn't?
>
> As far as I know, instcombine doesn't query memdep, and the
> store-forwarding is just intended to pick up simple cases to clean up
> code before GVN runs.
>
> -Eli
>

You are right.  I seemed to recall at one point tracing instcombine
processing of loads into MemoryDependence, but apparently not.

Anyway, it seems that GVN is the transform that I am looking for.




More information about the llvm-commits mailing list