[llvm] [MemCpyOpt] move SrcAlloca to the entry if transformation is performed (PR #67226)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Sat Sep 23 11:51:02 PDT 2023


================
@@ -1600,7 +1598,13 @@ bool MemCpyOptPass::performStackMoveOptzn(Instruction *Load, Instruction *Store,
   if (!CaptureTrackingWithModRef(SrcAlloca, SrcModRefCallback))
     return false;
 
-  // We can do the transformation. First, align the allocas appropriately.
+  // We can do the transformation. First, move the SrcAlloca to the entry point
+  // if it's not dominator for all uses. After that SrcAlloca becomes the
+  // dominator, because it's in the entry BB.
----------------
nikic wrote:

This comment makes it sound like we're moving the alloca to the entry BB. The alloca is already in the entry BB, we're just moving it to the start of it.

https://github.com/llvm/llvm-project/pull/67226


More information about the llvm-commits mailing list