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

Daniel Berlin via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 14 15:23:22 PDT 2016


I forgot #4 :)

> I'm not sure how we want to paper over this bug:
>
> 1. Making first run of GVN not generate IR the second GVN will have to
> trivially simplify (which will fix some cases but not others)
>
> 2. Make BasicAA see through phi nodes (ditto, though chandler points out
> there are plenty of normal programs  with thousands of phi nodes that have
> the same arguments, and since basicaa does not cache, there is a compile
> time cost to doing this )
>
> 3. Add an API and use it to blow away memdep cache entirely between GVN
> iterations (which will fix all such cases at some possible compile time
> cost)
>
>
4. Call simplifyInstruction in *every* path that BasicAA goes down. This
will also fix it, and if you get every pass, might even fix all of them.

FWIW: I think we want to do the reverse.  Performing tons of constant
folding in BasicAA, which is what happens now, seems ... broken, and is one
of the many things that makes it slow if it hits certain types of
instructions.

It seems like pretty much everything in the world is trying to simplify
instructions further under the covers (getUnderlyingObject, etc).  We try
to simplify and constant fold the same instruction 8 or 9 times during some
basicaa calls right now!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160714/c55513d4/attachment.html>


More information about the llvm-commits mailing list