[llvm] [memcpyopt] handle memcpy from memset in more cases (PR #140954)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 10 08:22:09 PDT 2025


================
@@ -1367,8 +1367,9 @@ bool MemCpyOptPass::processMemSetMemCpyDependence(MemCpyInst *MemCpy,
   return true;
 }
 
-/// Determine whether the instruction has undefined content for the given Size,
-/// either because it was freshly alloca'd or started its lifetime.
+/// Determine whether the pointer V had only undefined content from Def up to
+/// the given Size, either because it was freshly alloca'd or started its
----------------
nikic wrote:

The change from "the instruction" to "the pointer V" is fine, but the "from Def up to the given Size" doesn't really make sense? Def is a MemoryDef, not a base pointer.

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


More information about the llvm-commits mailing list