[llvm] [loop-idiom] Forget outer loop scev when loop-idiom introduces memset… (PR #150916)
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 29 07:09:54 PDT 2025
nikic wrote:
Hm, it looks like FunctionAttrs currently does not infer inaccessible memory for atomic accesses: https://llvm.godbolt.org/z/cG6jn34ds That's not what I expected.
Given that, I think it would be better if you did something like `if (isa<MemIntrinsic>(I) && !I->isVolatile())` instead. That should be safe and sufficient for what you need here.
> is there any criteria that what should be considered as side effect for a specific instruction? e.g. memset here can modify globals and hence, I am curious to know if even this should be considered as side effect
In this context, "side effect" has a different meaning from what this term usually means in LLVM. See this part of the mustprogress spec:
> This attribute indicates that the function is required to return, unwind, or interact with the environment in an observable way e.g. via a volatile memory access, I/O, or other synchronization.
Side effect here is exclusively about volatile accesses, synchronization and I/O, but not, for example, writing to plain memory.
https://github.com/llvm/llvm-project/pull/150916
More information about the llvm-commits
mailing list