[PATCH] D105247: [Intrinsics] Make MemCpyInlineInst a MemCpyInst

Jon Roelofs via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 30 17:34:32 PDT 2021


jroelofs added inline comments.


================
Comment at: llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp:834
   // If we're not allowed to hack on memcpy, we fail.
-  if (!HasMemcpy || DisableLIRP::Memcpy)
+  if ((!HasMemcpy && !isa<MemCpyInlineInst>(MCI)) || DisableLIRP::Memcpy)
     return false;
----------------
paquette wrote:
> This `HasMemcpy` variable is being used in a bunch of places, so I'm surprised this is the only change in this pass. Why is that?
We really only need to check `HasMemcpy` if we're about to emit one that's not inline, and there's only one spot in this pass that does that. Looks to me like the other two places that read `HasMemcpy` are short-cut optimizations of this fact. The one in `isLegalStore` probably could be relaxed this same way, but given we that we don't yet have dynamic sized `llvm.memcpy.inline`, I decided not to pursue that one.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D105247



More information about the llvm-commits mailing list