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

Antonio Frighetto via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 10 07:12:07 PDT 2025


================
@@ -1741,6 +1741,23 @@ 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, meaning that the caller will not depend on its
+    contents. Stores that would only be observable on the normal return path may
+    be elided.
----------------
antoniofrighetto wrote:

Leaving this as is. Might be suboptimal (as we don't imply dead_on_unwind), but I also do expect to handle dead_on_return and dead_on_unwind in conjunction. Can revisit this if you wish (I'd also rather change name, in this case).

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


More information about the llvm-commits mailing list