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

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 26 00:37:04 PDT 2025


================
@@ -411,14 +421,12 @@ static Constant *getMemSetPatternValue(Value *V, const DataLayout *DL) {
   if (Size > 16)
     return nullptr;
 
-  // If the constant is exactly 16 bytes, just use it.
-  if (Size == 16)
-    return C;
+  // For now, don't handle types that aren't int, floats, or pointers.
+  if (!isa<ConstantInt>(C) && !isa<ConstantFP>(C) &&
----------------
nikic wrote:

Better check the type for these, otherwise it's going to implicitly allow vector splats in the future...

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


More information about the llvm-commits mailing list