[PATCH] D93183: [BasicAA] Make sure context instruction is symmetric

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 14 13:31:46 PST 2020


nikic added a comment.

In D93183#2452415 <https://reviews.llvm.org/D93183#2452415>, @jdoerfert wrote:

> Can't we use any dominator for the context? If so, why not use `findNearestCommonDominator` instead of giving up?

Yes, that would be legal as well (but also sub-optimal). Annoyingly we don't have an instruction-level NCD API (D91767 <https://reviews.llvm.org/D91767> was recently not accepted), though in this case just taking the terminator of the BB NCD should work fine.

Taking a step back though, I think my original direction here probably wasn't the best, and it would make more sense to use whichever GEP the index actually belonged to as context. That may also be non-optimal (if the index is on a dominating GEP), but I think it's more predictable and doesn't have any odd "cliffs". I have updated the patch to that effect.


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

https://reviews.llvm.org/D93183



More information about the llvm-commits mailing list