[llvm] [IPSCCP] Don't replace with constant if Value is noalias ptr or derivatives (PR #154522)

via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 26 12:15:17 PDT 2025


choikwa wrote:

I tried with a simple unrolled body, but most backends were able to schedule stores to the end. And it looks like the reason may be that ScopedNoAliasAAResult::alias implementation does allow for asymmetry (ie. missing scope in store) when determining NoAlias.

For my specific case, the issue was related to the existence of scope metadata on the instruction (Using LDS, a special cache-like memory). AMDGPU would pessimize the load from LDS by forcing stalls to wait for all but one of the memory traffic to finish before continuing.

So yes, some backends like AMDGPU may have quirks that may be more pessimistic when asymmetry is found, but the general case seems to be unaffected.

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


More information about the llvm-commits mailing list