[PATCH] D92698: Add recursive decomposition reasoning to isKnownNonEqual

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Dec 5 08:43:55 PST 2020


nikic added a comment.

In D92698#2435582 <https://reviews.llvm.org/D92698#2435582>, @nikic wrote:

>> We have analogous handling in InstSimplify for most - though weirdly not all - of these cases starting from an icmp root. It's a bit unfortunate to duplicate logic, but since my actual goal is to extend BasicAA, the icmp logic doesn't help. (And just makes it hard to test here.)
>
> Could you add some tests for the BasicAA use case? If that's the intended target, I'm not sure this is the right approach. Currently the BasicAA logic for the non-equal index case is structural, while it should really be based on the index difference of decomposed GEP expressions. I suspect that handling it that way may also handle your motivating case, as e.g. common add operands would get stripped by that.

After double checking that, it looks like our GEP expression decomposition wouldn't be aggressive enough for that. We only decompose adds if they have one constant operand.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D92698/new/

https://reviews.llvm.org/D92698



More information about the llvm-commits mailing list