[llvm] [LangRef] Rewrite the elementwise atomic description and reject seq_cst elementwise atomics (PR #209931)
Sameer Sahasrabuddhe via llvm-commits
llvm-commits at lists.llvm.org
Thu Jul 23 22:35:43 PDT 2026
================
@@ -4181,6 +4181,30 @@ Otherwise, an atomic operation that is not marked
monotonic modification order with other operations that are not marked
`syncscope("singlethread")` or `syncscope("<target-scope>")`.
+(elementwise-atomics)=
+
+### Elementwise Atomic Operations
+
+Certain atomic instructions, such as {ref}`atomicrmw <i_atomicrmw>`,
+and {ref}`atomic load <i_load>`, may be marked `elementwise`. The access type
+must then be a fixed vector type whose total bit width is a power of two greater
+than or equal to eight, and whose element type is supported by the corresponding
+scalar atomic instruction. The {ref}`ordering <ordering>` of an `elementwise`
+instruction may not be `seq_cst`.
+
+An `elementwise` atomic instruction behaves as if it were expanded into one
+scalar version of that instruction for each vector element. Each resulting
+scalar operation has the same {ref}`ordering <ordering>` and `syncscope` as the
+original instruction. Each scalar operation occupies the original instruction's
+position in program order relative to other operations, but the scalar
+operations are not ordered by program order with respect to one another.
----------------
ssahasra wrote:
```suggestion
operations are not related in program order with respect to one another.
```
https://github.com/llvm/llvm-project/pull/209931
More information about the llvm-commits
mailing list