[PATCH] D22305: [BasicAA] Strip phi nodes, when all incoming values are the same.

Daniel Berlin via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 13 18:29:07 PDT 2016


On Wed, Jul 13, 2016 at 6:14 PM, Hal Finkel <hfinkel at anl.gov> wrote:

> hfinkel added a comment.
>
> In http://reviews.llvm.org/D22305#483557, @amehsan wrote:
>
> > @dberlin
> >
> > I see two concerns in your comment:
> >
> > > > Why not fix GVN to do that?
> >
> > >
> >
> > >
> >
> > >
> >
> >
> > Before GVN this phi node has two different incoming values. At some
> point A in GVN, one of the incoming values change and we get the phi node
> in the example above. At some point B in the GVN, the phi node is removed.
> Somewhere between A and B, GVN makes an alias analysis query. So I think
> there is not really a problem in GVN to fix.
>
>
> On the one hand, we generally don't construct our analyses to deal with
> trivially-non-canonical IR.


+1


> One could argue that if GVN expects to use analyses on its intermediate
> states, then those states need to follow the rules too.


+1



> On the other hand, arbitrary uses of RAUW can result in these kinds of
> PHIs, so this is not really a GVN problem, and handling this reduces our
> phase-ordering sensitivities.


Which is also why i asked if anything actually leaves this between passes
in practice.


> While several passes will clean these up, the same is true for several
> other things that stripPointerCasts handles.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160713/3d427f0a/attachment-0001.html>


More information about the llvm-commits mailing list