[llvm] [LoopIdiom] Select llvm.experimental.memset.pattern intrinsic rather than memset_pattern16 libcall (PR #126736)

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 14 13:01:08 PDT 2025


================
@@ -303,10 +308,15 @@ bool LoopIdiomRecognize::runOnLoop(Loop *L) {
       L->getHeader()->getParent()->hasOptSize() && UseLIRCodeSizeHeurs;
 
   HasMemset = TLI->has(LibFunc_memset);
+  // TODO: Unconditionally enable use of the memset pattern intrinsic (or at
+  // least, opt-in via target hook) once we are confident it will never result
+  // in worse codegen than without. For now, use it only when we would have
+  // previously emitted a libcall to memset_pattern16 (or unless this is
----------------
topperc wrote:

Instead of referring to "previously", should we say "For now, use it only when the target supports memset_pattern16 libcall (or unless this is overridden by command line option)."

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


More information about the llvm-commits mailing list