[PATCH] D25476: GVN-hoist: fix store past load dependence analysis (PR30216, PR30499)

Daniel Berlin via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 11 12:00:58 PDT 2016


On Tue, Oct 11, 2016 at 11:49 AM, Sebastian Pop <sebpop at gmail.com> wrote:

> On Tue, Oct 11, 2016 at 12:18 PM, Daniel Berlin <dberlin at dberlin.org>
> wrote:
> >> > STH like:
> >> >
> >> > bool  MemorySSA::defClobbersUse(MemoryDef *MD, MemoryUse *MU) {
> >> >    return instructionClobbersQuery(MD, MU, MemoryLocOrCall(MU),
> >> > MSSA->AA);
> >> > }
> >> >
> >>
> >> That is not easy:
> >
> >
> > Can you explain to me why?
> > It seems pretty trivial.
> >
>
> Yes it is: I'll post an updated patch.
>

Yeah, i think if you tried to use the *existing interfaces*, that would be
hard, as it would require exposing MemoryLocOrCall.
I think we should just avoiding doing that ;)


> Sorry about this: I got confused by my previous attempt at fixing this.
>

Understandable, it wasn't until this morning it danwed on me that there is
amuch easier way :)


>
> >> Also one things is that in my use-case, both instructions would be
> >> MemoryDefs,
> >
> >
> > Err, in this use case, you are looking for loads that blocks stores, so
> now
> > i'm confused.
>
> We may be moving the store past either a load, a store, or a call.
>

Ah.
I *think* it should work, because we pretend aliasing/etc is symmetric, but
if not, we can make doesDefClobber or something, and make it do the right
thing internal to MemorySSA.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161011/eb81165a/attachment.html>


More information about the llvm-commits mailing list