[llvm] Support non-malloc functions in malloc+memset->calloc fold (PR #138299)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Sat May 3 00:52:58 PDT 2025


================
@@ -2377,6 +2377,32 @@ void Verifier::verifyFunctionAttrs(FunctionType *FT, AttributeList Attrs,
       CheckFailed("'allockind()' can't be both zeroed and uninitialized");
   }
 
+  if (Attrs.hasFnAttr("alloc-variant-zeroed")) {
----------------
nikic wrote:

You can drop the outer if with hasFnAttr entirely.

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


More information about the llvm-commits mailing list