Skip to content

Commit 7020f25

Browse files
committed
LangRef: Note expectations when loading with extra alignment
llvm-svn: 272914
1 parent 4a90f57 commit 7020f25

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

llvm/docs/LangRef.rst

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7019,7 +7019,12 @@ alignment for the target. It is the responsibility of the code emitter
70197019
to ensure that the alignment information is correct. Overestimating the
70207020
alignment results in undefined behavior. Underestimating the alignment
70217021
may produce less efficient code. An alignment of 1 is always safe. The
7022-
maximum possible alignment is ``1 << 29``.
7022+
maximum possible alignment is ``1 << 29``. An alignment value higher
7023+
than the size of the loaded type implies memory up to the alignment
7024+
value bytes can be safely loaded without trapping in the default
7025+
address space. Access of the high bytes can interfere with debugging
7026+
tools, so should not be accessed if the function has the
7027+
``sanitize_thread`` or ``sanitize_address`` attributes.
70237028

70247029
The optional ``!nontemporal`` metadata must reference a single
70257030
metadata name ``<index>`` corresponding to a metadata node with one
@@ -7144,7 +7149,14 @@ alignment for the target. It is the responsibility of the code emitter
71447149
to ensure that the alignment information is correct. Overestimating the
71457150
alignment results in undefined behavior. Underestimating the
71467151
alignment may produce less efficient code. An alignment of 1 is always
7147-
safe. The maximum possible alignment is ``1 << 29``.
7152+
safe. The maximum possible alignment is ``1 << 29``. An alignment
7153+
value higher than the size of the stored type implies memory up to the
7154+
alignment value bytes can be stored to without trapping in the default
7155+
address space. Storing to the higher bytes however may result in data
7156+
races if another thread can access the same address. Introducing a
7157+
data race is not allowed. Storing to the extra bytes is not allowed
7158+
even in situations where a data race is known to not exist if the
7159+
function has the ``sanitize_address`` attribute.
71487160

71497161
The optional ``!nontemporal`` metadata must reference a single metadata
71507162
name ``<index>`` corresponding to a metadata node with one ``i32`` entry of

0 commit comments

Comments
 (0)