llvm-project
d518f8ff - [MemorySSA] Fix handling of cross-iteration dependencies for calls (#187291)

Commit
72 days ago
[MemorySSA] Fix handling of cross-iteration dependencies for calls (#187291) The clobber walker has to be careful when it comes to translating locations across phis. If we're translating across a cycle backedge, we'll end up working with SSA values from two different cycle iterations -- something that alias analysis by default assumes is not the case. To protect against this, the upwards def walk was already discarding the access size from the memory location if the pointer was not loop invariant. This (mostly) avoids this issue for memory locations. However, the same issue also exists for calls. In this case, it's not possible to adjust the call used for AA queries in a similar way. Instead, we can make use of the cross-iteration alias analysis mode, which has been added some time ago for these kinds of situations. The basic change here is that the upwards def walk, when translating across a phi, will enable the cross-iteration mode for calls. Unfortunately, quite a few places have to be changed in order to thread through that flag. We should really also be using the cross-iteration mode for the memory location case, both because it's more precise, and because it's more correct (in particular, only changing the size does not handle correlated select conditions). However, this comes with a compile-time cost, so I'm only handling the call case for now. Fixes https://github.com/llvm/llvm-project/issues/54682.
Author
Parents
Loading