================
@@ -1017,7 +1017,9 @@ struct DSEState {
     // Treat byval, inalloca or dead on return arguments the same as Allocas,
     // stores to them are dead at the end of the function.
     for (Argument &AI : F.args())
-      if (AI.hasPassPointeeByValueCopyAttr() || AI.hasDeadOnReturnAttr())
+      if (AI.hasPassPointeeByValueCopyAttr() ||
+          (AI.getType()->isPointerTy() &&
+           !AI.getDeadOnReturnBytes().has_value()))
----------------
antoniofrighetto wrote:

I wonder if it'd be possible to make it a bit simpler to figure out we're only 
interested in non-sized dead_on_return here (it may not be immediately clear). 
Maybe worth a comment (even though may carry out changes here later)?

https://github.com/llvm/llvm-project/pull/171712
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to