[PATCH] D118441: Preserve aliasing info during memory intrinsics lowering

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 22 15:08:48 PDT 2022


nikic added inline comments.


================
Comment at: llvm/lib/Transforms/Utils/LowerMemIntrinsics.cpp:481
+    auto *DestSCEV = SE->getSCEV(Memcpy->getRawDest());
+    if (SE->isKnownPredicateAt(CmpInst::ICMP_NE, SrcSCEV, DestSCEV, Memcpy))
+      CanOverlap = false;
----------------
arsenm wrote:
> Isn't this implied by the usual constraints of memcpy? The source and destination aren't allowed to overlap. Why does this need the SCEV check?
llvm.memcpy (unlike memcpy) is allowed to have src == dst (but no other overlap).


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D118441



More information about the llvm-commits mailing list