[llvm] [LangRef] Clarify what "not ordered" means in the elementwise description and reject seq_cst elementwise atomics (PR #209931)

Ralf Jung via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 15 23:18:38 PDT 2026


================
@@ -12130,7 +12130,14 @@ An `atomicrmw` instruction can also take an optional
 "{ref}`syncscope <syncscope>`" argument.
 
 If the `elementwise` modifier is present, the instruction has per-element vector
-atomic semantics. It behaves as if it were expanded into one scalar `atomicrmw` per element, that are not ordered with respect to each other.
+atomic semantics. It behaves as if it were expanded into one scalar `atomicrmw`
+per element, that are not ordered with respect to each other. In other words, a
+consistent ordering does not exist between the individual scalar operations of
+the same `elementwise` instruction. Synchronizing with one of the scalar
+operations does not, by itself, establish a happens-before relationship with another scalar operation from the same `elementwise` instruction.
----------------
RalfJung wrote:

Is this equivalent to "spawn one thread per lane, each doing the access for one element, then join them all"?

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


More information about the llvm-commits mailing list