[PATCH] D114883: [BuildLibCalls] Add support for memset_pattern{4, 8}.
Florian Hahn via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Dec 1 08:40:10 PST 2021
fhahn created this revision.
fhahn added reviewers: efriedma, ab, t.p.northover.
Herald added a subscriber: hiraditya.
fhahn requested review of this revision.
Herald added a project: LLVM.
Add support for memset_pattern{4,8} similar to the existing
memset_pattern16 handling.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D114883
Files:
llvm/lib/Transforms/Utils/BuildLibCalls.cpp
llvm/test/Transforms/InferFunctionAttrs/annotate.ll
Index: llvm/test/Transforms/InferFunctionAttrs/annotate.ll
===================================================================
--- llvm/test/Transforms/InferFunctionAttrs/annotate.ll
+++ llvm/test/Transforms/InferFunctionAttrs/annotate.ll
@@ -1011,8 +1011,13 @@
declare i64 @write(i32, i8*, i64)
+; memset_pattern{4,8,16} isn't available everywhere.
+; CHECK-DARWIN: declare void @memset_pattern4(i8* nocapture writeonly, i8* nocapture readonly, i64) [[ARGMEMONLY_NOFREE:#[0-9]+]]
+declare void @memset_pattern4(i8*, i8*, i64)
+; CHECK-DARWIN: declare void @memset_pattern8(i8* nocapture writeonly, i8* nocapture readonly, i64) [[ARGMEMONLY_NOFREE]]
+declare void @memset_pattern8(i8*, i8*, i64)
; memset_pattern16 isn't available everywhere.
-; CHECK-DARWIN: declare void @memset_pattern16(i8* nocapture writeonly, i8* nocapture readonly, i64) [[ARGMEMONLY_NOFREE:#[0-9]+]]
+; CHECK-DARWIN: declare void @memset_pattern16(i8* nocapture writeonly, i8* nocapture readonly, i64) [[ARGMEMONLY_NOFREE]]
declare void @memset_pattern16(i8*, i8*, i64)
Index: llvm/lib/Transforms/Utils/BuildLibCalls.cpp
===================================================================
--- llvm/lib/Transforms/Utils/BuildLibCalls.cpp
+++ llvm/lib/Transforms/Utils/BuildLibCalls.cpp
@@ -1017,9 +1017,8 @@
Changed |= setDoesNotCapture(F, 0);
Changed |= setDoesNotCapture(F, 1);
return Changed;
- // TODO: add LibFunc entries for:
- // case LibFunc_memset_pattern4:
- // case LibFunc_memset_pattern8:
+ case LibFunc_memset_pattern4:
+ case LibFunc_memset_pattern8:
case LibFunc_memset_pattern16:
Changed |= setOnlyAccessesArgMemory(F);
Changed |= setDoesNotCapture(F, 0);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D114883.391045.patch
Type: text/x-patch
Size: 1691 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211201/cd3d77af/attachment.bin>
More information about the llvm-commits
mailing list