[PATCH] D137707: Move "auto-init" instructions to the dominator of their users

Nick Desaulniers via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 14 15:20:15 PST 2023


nickdesaulniers added inline comments.


================
Comment at: llvm/lib/Transforms/Utils/MoveAutoInit.cpp:72
+      }
+    } else if (auto *M = dyn_cast<MemoryPhi>(MA)) {
+      for (unsigned i = 0, n = M->getNumIncomingValues(); i != n; ++i)
----------------
efriedma wrote:
> serge-sans-paille wrote:
> > efriedma wrote:
> > > I'm not sure I understand the PHI handling here... the incoming values of a PHI are essentially original store itself, and other stores that store to the same location.  I'm not sure how analyzing the other stores helps here.  You want the store to dominate the incoming edge of the PHI, not the other stores.
> > > 
> > Indeed, I had it the other way around. Fixed in latest revision of the patch.
> I'm not confident that looking through PHIs like this is actually what you want.  A MemoryPHI implies there's a loop that modifies the value in question. Maybe the cycle protection code protects you from running into issues with that, though?
> 
> I haven't really worked with MemorySSA much; if someone wants to jump in to review this aspect, that would be welcome.  I'm generally happy with the approach using MemorySSA, just not sure about the finer details.
Is there someone who would have worked more with MemorySSA that can provide such review? It's certainly not me.


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

https://reviews.llvm.org/D137707



More information about the llvm-commits mailing list