Skip to content

Commit 389cb8a

Browse files
!fixup improve wording
1 parent 53db5b3 commit 389cb8a

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

llvm/docs/LangRef.rst

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1743,15 +1743,18 @@ Currently, only the following parameter attributes are defined:
17431743

17441744
``dead_on_return``
17451745
This attribute indicates that the memory pointed to by the argument is dead
1746-
upon normal function return.
1747-
1748-
It is similar to ``byval`` in the regard that it is generally used to pass
1749-
structs and arrays by value, and the memory is caller-invisible when the
1750-
function returns. However, unlike ``byval``, it is intended for ABIs where the
1751-
*callee* explicitly allocates the temporary copy. Stores that would only be
1752-
visible on the normal return path may be optimized out. Likewise,
1753-
optimizations may assume that the pointer does not alias any memory that
1754-
outlives the call.
1746+
upon normal function return, meaning that the caller will not depend on its
1747+
contents. Stores that would only be observable on the normal return path may
1748+
be elided.
1749+
1750+
Specifically, the behavior is as-if any memory written through the pointer
1751+
during the execution of the function is overwritten with a poison value
1752+
upon normal function return. The caller may access the memory, but any load
1753+
not preceded by a store will return poison.
1754+
1755+
This attribute does not imply aliasing properties. For pointer arguments that
1756+
do not alias other memory locations, ``noalias`` attribute may be used in
1757+
conjunction.
17551758

17561759
This attribute cannot be applied to return values.
17571760

0 commit comments

Comments
 (0)