[llvm] [IR] Add `dead_on_return` attribute (PR #143271)
Yingwei Zheng via llvm-commits
llvm-commits at lists.llvm.org
Sat Jun 7 09:07:42 PDT 2025
================
@@ -1741,6 +1741,20 @@ Currently, only the following parameter attributes are defined:
This attribute cannot be applied to return values.
+``dead_on_return``
+ This attribute indicates that the memory pointed to by the argument is dead
+ upon normal function return.
+
+ It is similar to ``byval`` in the regard that it is generally used to pass
+ structs and arrays by value, and the memory is caller-invisible when the
+ function returns. However, unlike ``byval``, it is intended for ABIs where the
+ *callee* allocates the hidden copy, rather than the caller. Stores that would
----------------
dtcxzyw wrote:
IIUC both `byval` and `dead_on_return` indicate the caller allocates the hidden copy: https://godbolt.org/z/79b4cvWfo
The only difference is that we allocate the copy explicitly on AArch64.
https://github.com/llvm/llvm-project/pull/143271
More information about the llvm-commits
mailing list