Skip to content

Commit 9922c78

Browse files
committed
[Docs] Fix a statement wrt instruction alignment of 0
This fix #53371 Zero is not a legal alignment. Reviewed By: nikic Differential Revision: https://reviews.llvm.org/D142633
1 parent 36e1890 commit 9922c78

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

llvm/docs/LangRef.rst

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10302,17 +10302,16 @@ the alignment is not set to a value which is at least the size in bytes of the
1030210302
pointee. ``!nontemporal`` does not have any defined semantics for atomic stores.
1030310303

1030410304
The optional constant ``align`` argument specifies the alignment of the
10305-
operation (that is, the alignment of the memory address). A value of 0
10306-
or an omitted ``align`` argument means that the operation has the ABI
10307-
alignment for the target. It is the responsibility of the code emitter
10308-
to ensure that the alignment information is correct. Overestimating the
10309-
alignment results in undefined behavior. Underestimating the
10310-
alignment may produce less efficient code. An alignment of 1 is always
10311-
safe. The maximum possible alignment is ``1 << 32``. An alignment
10312-
value higher than the size of the stored type implies memory up to the
10313-
alignment value bytes can be stored to without trapping in the default
10314-
address space. Storing to the higher bytes however may result in data
10315-
races if another thread can access the same address. Introducing a
10305+
operation (that is, the alignment of the memory address). An omitted ``align``
10306+
argument means that the operation has the ABI alignment for the target.
10307+
It is the responsibility of the code emitter to ensure that the alignment
10308+
information is correct. Overestimating the alignment results in undefined
10309+
behavior. Underestimating the alignment may produce less efficient code.
10310+
An alignment of 1 is always safe. The maximum possible alignment is ``1 << 32``.
10311+
An alignment value higher than the size of the stored type implies memory
10312+
up to the alignment value bytes can be stored to without trapping in
10313+
the default address space. Storing to the higher bytes however may result in
10314+
data races if another thread can access the same address. Introducing a
1031610315
data race is not allowed. Storing to the extra bytes is not allowed
1031710316
even in situations where a data race is known to not exist if the
1031810317
function has the ``sanitize_address`` attribute.

0 commit comments

Comments
 (0)