[llvm-branch-commits] [llvm] RuntimeLibcalls: Add missing attributes to memory and allocator libcalls (PR #240735)

Matt Arsenault via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Tue Nov 10 15:46:26 PST 2026


================
@@ -706,39 +711,73 @@ foreach FPTy = [F32, F64, F128, PPCF128] in {
 }
 
 // Memory
-def MEMCMP : RuntimeLibcall<Int, [Ptr, Ptr, SizeT]>;
-def MEMCPY : RuntimeLibcall<Ptr, [Ptr, Ptr, SizeT]>;
+defvar ReadPtrAttrs = [ReadOnly, CapturesNone];
+
+class MemCmpLibcall : RuntimeLibcall<Int, [Ptr, Ptr, SizeT]> {
+  let FnAttrs = CommonFnAttrs;
+  let Memory = ArgMemReadOnly;
+  let ParamAttrs = [ReadPtrAttrs, ReadPtrAttrs];
+}
+
+def MEMCMP : MemCmpLibcall;
+def MEMCPY : RuntimeLibcall<Ptr, [Ptr, Ptr, SizeT]> {
+  let FnAttrs = CommonFnAttrs;
+  let Memory = ArgMemOnly;
+  let ParamAttrs = [[NoAlias, Returned, WriteOnly],
+                    [NoAlias, ReadOnly, CapturesNone]];
+}
----------------
arsenm wrote:

I guess should cut out the arm variants, that's kind of just a broken implementation 

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


More information about the llvm-branch-commits mailing list