[llvm] [LICM] Remove unnecessary check during store hoisting (PR #187529)

Antonio Frighetto via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 13 02:50:24 PDT 2026


antoniofrighetto wrote:

> I think this check was added because MemorySSA had trouble with
loop-carried dependencies in the past (like in https://github.com/llvm/llvm-project/issues/54682), but this
should no longer be a problem.

If the store's own clobber lives in the loop, I think it would be reasonable to conclude that if getClobberingMemoryAccess() were _not_ to say that the optimized clobbering access for the store would be either a clobbering def, or a MemoryPhi, within the loop, that would then be a bug in the walker / MemorySSA? (Namely, if we don't bail out in the following, then we should we able to safely say there doesn't exist any def inside the loop.)

https://github.com/llvm/llvm-project/blob/33ca7a4667d7f60a4692a2e03b3de94f66ff0d10/llvm/lib/Transforms/Scalar/LICM.cpp#L2317-L2320


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


More information about the llvm-commits mailing list