[llvm] [IR] Initial introduction of memset_pattern (PR #97583)

Alex Bradbury via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 14 02:29:42 PDT 2024


================
@@ -1003,6 +1003,14 @@ def int_memset_inline
        NoCapture<ArgIndex<0>>, WriteOnly<ArgIndex<0>>,
        ImmArg<ArgIndex<3>>]>;
 
+// Memset variant that writes a given pattern.
+def int_memset_pattern
+    : Intrinsic<[],
+      [llvm_anyptr_ty, llvm_anyint_ty, llvm_anyint_ty, llvm_i1_ty],
+      [IntrWriteMem, IntrArgMemOnly, IntrWillReturn, IntrNoFree, IntrNoCallback,
----------------
asb wrote:

I dug through this and unfortunately I can't make use of `DefaultAttrIntrinsic` because `nosync` isn't necessarily true. https://reviews.llvm.org/D86021 switched over memset to using DefaultAttrIntrinsic but this was later backed out in a888e492f601644f44b843373039966e7acacd31 due to `nosync` not applying unconditionally.

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


More information about the llvm-commits mailing list