Skip to content

Commit 73f2b64

Browse files
committed
Suggested rewordering for atomic alignments.
1 parent 899c2be commit 73f2b64

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

llvm/docs/LangRef.rst

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10515,9 +10515,10 @@ Atomic loads produce :ref:`defined <memmodel>` results when they may see
1051510515
multiple atomic stores. The type of the pointee must be an integer, pointer, or
1051610516
floating-point type whose bit width is a power of two greater than or equal to
1051710517
eight and less than or equal to a target-specific size limit. ``align`` must be
10518-
explicitly specified on atomic loads, and the load has undefined behavior if the
10519-
alignment is not set to a value which is at least the size in bytes of the
10520-
pointee. ``!nontemporal`` does not have any defined semantics for atomic loads.
10518+
explicitly specified on atomic loads and must typically be a power of two greater
10519+
or equal to the size of the `<value>` type, or the AtomicExpand pass will convert
10520+
it to a libcall. ``!nontemporal`` does not have any defined semantics for atomic
10521+
loads.
1052110522

1052210523
The optional constant ``align`` argument specifies the alignment of the
1052310524
operation (that is, the alignment of the memory address). It is the
@@ -10655,7 +10656,11 @@ Atomic loads produce :ref:`defined <memmodel>` results when they may see
1065510656
multiple atomic stores. The type of the pointee must be an integer, pointer, or
1065610657
floating-point type whose bit width is a power of two greater than or equal to
1065710658
eight and less than or equal to a target-specific size limit. ``align`` must be
10658-
explicitly specified on atomic stores, and the store has undefined behavior if
10659+
explicitly specified on atomic stores and must typically be a power of two
10660+
greater or equal to the size of the `<value>` type, or the AtomicExpand pass will
10661+
convert it to a libcall.
10662+
10663+
and the store has undefined behavior if
1065910664
the alignment is not set to a value which is at least the size in bytes of the
1066010665
pointee. ``!nontemporal`` does not have any defined semantics for atomic stores.
1066110666

@@ -10807,8 +10812,8 @@ must be at least ``monotonic``, the failure ordering cannot be either
1080710812
A ``cmpxchg`` instruction can also take an optional
1080810813
":ref:`syncscope <syncscope>`" argument.
1080910814

10810-
The alignment must be a power of two greater or equal to the size of the
10811-
`<value>` type.
10815+
Typically, the alignment must be a power of two greater or equal to the size
10816+
of the `<value>` type, or the AtomicExpand pass will convert it to a libcall.
1081210817

1081310818
The alignment is only optional when parsing textual IR; for in-memory IR, it is
1081410819
always present. If unspecified, the alignment is assumed to be equal to the
@@ -10910,8 +10915,8 @@ the ``atomicrmw`` is marked as ``volatile``, then the optimizer is not
1091010915
allowed to modify the number or order of execution of this
1091110916
``atomicrmw`` with other :ref:`volatile operations <volatile>`.
1091210917

10913-
The alignment must be a power of two greater or equal to the size of the
10914-
`<value>` type.
10918+
Typically, the alignment must be a power of two greater or equal to the size
10919+
of the `<value>` type, or the AtomicExpand pass will convert it to a libcall.
1091510920

1091610921
The alignment is only optional when parsing textual IR; for in-memory IR, it is
1091710922
always present. If unspecified, the alignment is assumed to be equal to the

0 commit comments

Comments
 (0)