[llvm] [DA] disambiguate evolution of base addresses (PR #116628)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 19 05:54:33 PST 2024


https://github.com/nikic requested changes to this pull request.

I think the overall approach here isn't right. This is basically trying to mitigate a specific case in the BasicAA implementation, but doesn't really provide a guarantee that we can't hit the same underlying issue through a different pathway. I would expect that it's possible to construct a similar problematic case using selects instead of phis.

I think the correct way to address this issue would be to enable the cross-iteration mode of AA, which is also what LAA does. However, it currently doesn't actually catch the examples here, which I'm addressing in https://github.com/llvm/llvm-project/pull/116802.

Though I should also note that doing this alone is not sufficient to make this code correct, because it *also* makes an additional incorrect assumptions about AATags. In particular, this will handle scoped noalias metadata incorrectly for cases where the metadata is only valid within one loop iteration. It is necessary to inspect noalias.scope intrinsics to disambiguate these cases.

https://github.com/llvm/llvm-project/pull/116628


More information about the llvm-commits mailing list