[llvm] [loop-idiom] Forget outer loop scev when loop-idiom introduces memset… (PR #150916)

Sushant Gokhale via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 29 08:20:48 PDT 2025


sushgokh wrote:

> 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.

The clause "interact with the environment in an observable way" is quite subjective I think.

why not consider a simple store or memset doing some observable interaction with the environment? For memset, the last sentence of "mustprogress" says:
```
Note that willreturn implies mustprogress.
```
which means memset must be considered as having side effect.

In fact, what I dont understand is how volatile accesses interact in **observable way** ?

Now, coming back, as per lang ref, if instruction is not volatile, thats not causing side effect. But this may be very narrow interpretation of the mustprogress clause.

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


More information about the llvm-commits mailing list