[llvm] [IR] Add `dead_on_return` attribute (PR #143271)

Antonio Frighetto via llvm-commits llvm-commits at lists.llvm.org
Sat Jun 7 09:15:37 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
----------------
antoniofrighetto wrote:

That's correct. I had been refining the wording a few times, and left the original one in the LangRef. Updated, thanks!

https://github.com/llvm/llvm-project/pull/143271


More information about the llvm-commits mailing list