[llvm] [LoopIdiom] Don't convert `memset.inline` into `memset` (PR #227650)

Piotr Fusik via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 30 04:28:50 PDT 2026


=?utf-8?q?Ömer_Sinan_Ağacan?= <omer at osa1.net>,
=?utf-8?q?Ömer_Sinan_Ağacan?= <omer at osa1.net>,
=?utf-8?q?Ömer_Sinan_Ağacan?= <omer at osa1.net>
Message-ID:
In-Reply-To: <llvm.org/llvm/llvm-project/pull/227650 at github.com>


================
@@ -837,8 +837,10 @@ bool LoopIdiomRecognize::processLoopMemCpy(MemCpyInst *MCI,
   if (MCI->isVolatile() || !isa<ConstantInt>(MCI->getLength()))
     return false;
 
-  // If we're not allowed to hack on memcpy, we fail.
-  if ((!HasMemcpy && !MCI->isForceInlined()) || DisableLIRP::Memcpy)
+  // If we're not allowed to hack on memcpy, we fail. We don't mess with the
+  // inlined version as generating a larger inline mempcy could affect code
+  // size.
+  if (!HasMemcpy || MCI->isForceInlined() || DisableLIRP::Memcpy)
----------------
pfusik wrote:

> refactored to properly check for inline intrinsic

How can it be "refactored" and fixed at the same time?

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


More information about the llvm-commits mailing list