================
@@ -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()))
----------------
boomanaiden154 wrote:

Good point. I've updated the patch to change the getter to 
`getDeadOnReturnInfo` that returns a struct wrapping the optional to 
appropriately name functions. So now we can just query 
`coversAllRechableMemory()` which should be self-documenting. Name 
bike-shedding is welcome since I'm not super confident that is a great name.

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