[PATCH] D155406: [MemCpyOpt] implement multi BB stack-move optimization

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Aug 12 08:25:37 PDT 2023


nikic added inline comments.


================
Comment at: llvm/lib/Transforms/Scalar/MemCpyOptimizer.cpp:1598
+        if (LI && LI->getLoopFor(BB) != nullptr)
+          return false;
+
----------------
Is this check needed? I would expect that this is covered by adding the successors to the reachability worklist. Then we shouldn't need LoopInfo.


================
Comment at: llvm/lib/Transforms/Scalar/MemCpyOptimizer.cpp:1674
+    // create one at each exit block, but that'd be essentially semantically
+    // meaningless. If the last user is the terminator for the bb, we can insert
+    // lifetime.end marker to the immediate post-dominator. We need to create
----------------
bb -> BB


================
Comment at: llvm/lib/Transforms/Scalar/MemCpyOptimizer.cpp:1682
+        (PDom && isModOrRefSet(AA->getModRefInfo(PDom, SrcLoc))) ? PDom
+                                                                 : nullptr;
+    if (PDom && PDom->isTerminator() && PDomUser) {
----------------
I don't get what you're doing here with AA. Why is this necessary now and wasn't needed in the single BB case?


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

https://reviews.llvm.org/D155406



More information about the llvm-commits mailing list