[PATCH] D29624: [DSE] Basic MemorySSA-backed global DSE

Daniel Berlin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 7 18:56:04 PST 2017


dberlin added inline comments.


================
Comment at: lib/Transforms/Scalar/DeadStoreElimination.cpp:1586
+    for (; Res.State <= WalkResult::NextPhi;
+         Res = Walker.walkNext(Res.MA, Cand)) {
+      if (auto *Def = dyn_cast<MemoryDef>(Res.MA)) {
----------------
efriedma wrote:
> I think we need some sort of iteration limit here to avoid quadratic compile-time for large basic blocks with lots of mayalias stores.
FWIW, we don't optimize stores, because actually making that part of the def-use chain disconnects parts of the MemorySSA graph without multiple phis.

But .. there is nothing that stops the batch optimizer from *storing the info* in another field that isn't "DefiningAccess".

Then we could just reverse link (IE put a list in the def that goes to the uses)  them to have a "clobberinguses" field just as easily.

that would make these walks as fast as they can be, because you would never have to go to "next def".
the set of clobbering uses would be complete and correct.

Now, whether it's worth it yet to do this, no idea.
But it's honestly simple enough.

The use/store optimizer already computes the answer to "what is the thing that clobbers this" in optimal time.



Repository:
  rL LLVM

https://reviews.llvm.org/D29624





More information about the llvm-commits mailing list