[llvm] [MemCpyOpt] No need to create `memcpy(a <- a)` (PR #98321)

via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 10 16:52:44 PDT 2024


================
@@ -1161,6 +1161,14 @@ bool MemCpyOptPass::processMemCpyMemCpyDependence(MemCpyInst *M,
                      MSSA->getMemoryAccess(MDep), MSSA->getMemoryAccess(M)))
     return false;
 
+  // No need to create `memcpy(a <- a)`.
+  if (BAA.isMustAlias(M->getDest(), MDep->getRawSource())) {
----------------
DianQK wrote:

I changed to `getDest` and `getSource`.

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


More information about the llvm-commits mailing list