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

Antonio Frighetto via llvm-commits llvm-commits at lists.llvm.org
Sat Jun 7 09:44:38 PDT 2025


================
@@ -818,7 +818,7 @@ bool llvm::isNoAliasCall(const Value *V) {
 
 static bool isNoAliasOrByValArgument(const Value *V) {
   if (const Argument *A = dyn_cast<Argument>(V))
-    return A->hasNoAliasAttr() || A->hasByValAttr();
+    return A->hasNoAliasAttr() || A->hasByValAttr() || A->hasDeadOnReturnAttr();
----------------
antoniofrighetto wrote:

I think we may want to keep dead_on_return orthogonal from dead_on_unwind, and let the memory pointed by be dead upon normal function return. Landing pads may need to inspect parameter memory (not sure if can be the case?). Even so, that would otherwise subsume dead_on_unwind, and I don't think we want this?

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


More information about the llvm-commits mailing list