[PATCH] D19935: [BasicAA] Compare GEP indices based on value

Ahmed Bougacha via llvm-commits llvm-commits at lists.llvm.org
Wed May 11 02:52:46 PDT 2016


ab accepted this revision.
ab added a comment.
This revision is now accepted and ready to land.

In http://reviews.llvm.org/D19935#425744, @uabelho wrote:

> However, I'm a little bit worried that there could be other places in AA where GEPs are considered to be noaliasing only based on checking Value pointers, e.g in
>
> bool BasicAAResult::isValueEqualInPotentialCycles(const Value *V,
>
>                                                   const Value *V2) {
>   if (V != V2)
>     return false;
>   
>
> but I don't know the code well enough to know if the code above can cause any similar problems or not.


You're absolutely right that this problem could lurk elsewhere; isValueEqualInPotentialCycles was actually added to avoid that problem in r198290, for PHI cycles though. I think the same problem could occur for no-op instructions ("alias((add x, 0), x)"), but it looks like all the current users are safe.  I'm not sure I have an answer to the general problem though :/

Re: this particular issue though: LGTM, thanks Vedant!


http://reviews.llvm.org/D19935





More information about the llvm-commits mailing list