[PATCH] D82588: [DSE] Look through memory PHI arguments when removing noop stores in MSSA.

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 1 10:29:17 PDT 2020


fhahn accepted this revision.
fhahn added a comment.
This revision is now accepted and ready to land.

LGTM, thanks!



================
Comment at: llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp:2408
+        // Look through phi accesses. Recursively scan all phi accesses by adding them
+        // to a worklist. Bail when we run into a memory def.
+        SetVector<MemoryAccess *> ToCheck;
----------------
nit: `bail when we run into a memory def that does not match LoadAccess.`


================
Comment at: llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp:2427
+          // write in between an otherwise noop store.
+          if (isa<MemoryDef>(Current)) {
+            // TODO: Skip no alias MemoryDefs that have no aliasing reads.
----------------
It should be possible to replace the `if ()` with `assert(isa<MemoryDef>(Current) && "only MemoryDefs should reach here");`


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D82588



More information about the llvm-commits mailing list