[clang] [llvm] Remove __arm_atomic_store_with_stshh from llvm (PR #192419)

David Green via cfe-commits cfe-commits at lists.llvm.org
Fri Apr 17 00:25:59 PDT 2026


davemgreen wrote:

> It looks optimization really don't check for that now and just assume that calls are nosync. Because as you mentioned this intrinsic isn't marked as nosync and the stores still get optimized.

The default position for an intrinsic is that they are treated like a call, so can do anything a call can. The attributes constrain that behaviour. In this case you have just ran into a bug to do with how __restrict implies function-local, that should be fixed separately [*].  I'm not sure if you have an example that is incorrect but that doesn't use restrict? It is fine with globals, for example: https://godbolt.org/z/ssKjh4xqr.

(* Or maybe it is just UB to use restrict on a pointer that may be being used on another thread at the same time, I'm not sure)

So the reason to remove the intrinsic and use an atomic+metadata would be that the atomic might be more nicely optimized by llvm, as it understands the semantics of the instruction better. I'm not sure if I would bother to remove the old intrinsic first, your update code seemed to work just fine if it was needed, especially if it wasn't clear if the atomic+metadata solution would work correctly yet. It would be helpful to update the commit message to be clear on that but either way - sounds OK.

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


More information about the cfe-commits mailing list