[llvm] [IR] Add elementwise modifier to atomic loads (PR #204556)

Yonah Goldberg via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 25 14:50:33 PDT 2026


================
@@ -12037,11 +12037,20 @@ If the ``load`` is marked as ``atomic``, it takes an extra :ref:`ordering
 Atomic loads produce :ref:`defined <memmodel>` results when they may see
 multiple atomic stores. The type of the pointee must be an integer, pointer,
 floating-point, or vector type whose bit width is a power of two greater than
-or equal to eight. ``align`` must be
-explicitly specified on atomic loads. Note: if the alignment is not greater or
-equal to the size of the `<value>` type, the atomic operation is likely to
-require a lock and have poor performance. ``!nontemporal`` does not have any
-defined semantics for atomic loads.
+or equal to eight.
+
+If the ``elementwise`` modifier is present, the loaded type must be a fixed
+vector type, and each element type must be a valid scalar atomic load type. The
+load has per-element vector atomic semantics: it behaves as if it were expanded
+into one scalar atomic load per element, and the element loads are not ordered
+with respect to each other. Without ``elementwise``, vector atomic loads keep
+whole-value atomic semantics.
+
+``align`` must be explicitly specified on atomic loads. Note: if the alignment
----------------
YonahGoldberg wrote:

Can we combine this in a nicer way with the paragraph below? It's a little unclear when you say it must be explicitly specified on atomic loads and then just below it says it's optional. Maybe you just remove the "optional" from the paragraph below.

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


More information about the llvm-commits mailing list