[PATCH] D82222: [DSE, MSSA] Treat passed by value args as invisible to caller.

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 19 13:04:22 PDT 2020


fhahn marked 2 inline comments as done.
fhahn added inline comments.


================
Comment at: llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp:1584
+        State.InvisibleToCallerBeforeRet.insert(&AI);
+        State.InvisibleToCallerAfterRet.insert(&AI);
+      }
----------------
efriedma wrote:
> For inalloca and preallocated, the argument has the same address in the caller and the callee.  So if I'm understanding correctly, InvisibleToCallerBeforeRet should only apply specifically to byval.
Right, I thought the caller cannot expect to observe any writes to any PassPointeeByVal argument, but it is not entirely clear from the langref. I've updated the code as suggested. Legacy DSE seems to treat them at least as if writes are not observable after the function returns.


================
Comment at: llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp:1591
       if (AI.hasPassPointeeByValueAttr())
         State.InvisibleToCallerBeforeRet.insert(&AI);
     return State;
----------------
efriedma wrote:
> Is there an incorrectly resolved merge conflict here?
Yes that was unintentional. sorry about that!


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D82222/new/

https://reviews.llvm.org/D82222





More information about the llvm-commits mailing list