[PATCH] D156840: [CaptureTracking] Add tests for allowing non-void `noalias` return funcs to be non-capturing; NFC
Noah Goldstein via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 2 09:00:46 PDT 2023
goldstein.w.n updated this revision to Diff 546497.
goldstein.w.n added a comment.
Don't delete existing test
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D156840/new/
https://reviews.llvm.org/D156840
Files:
llvm/test/Transforms/FunctionAttrs/nocapture.ll
Index: llvm/test/Transforms/FunctionAttrs/nocapture.ll
===================================================================
--- llvm/test/Transforms/FunctionAttrs/nocapture.ll
+++ llvm/test/Transforms/FunctionAttrs/nocapture.ll
@@ -559,13 +559,32 @@
define void @readnone_indirec(ptr %f, ptr %p) {
; CHECK-LABEL: define void @readnone_indirec
; CHECK-SAME: (ptr nocapture readonly [[F:%.*]], ptr readnone [[P:%.*]]) #[[ATTR18:[0-9]+]] {
-; CHECK-NEXT: call void [[F]](ptr [[P]]) #[[ATTR21:[0-9]+]]
+; CHECK-NEXT: call void [[F]](ptr [[P]]) #[[ATTR22:[0-9]+]]
; CHECK-NEXT: ret void
;
call void %f(ptr %p) readnone
ret void
}
+define ptr @noalias_ret(ptr %f, ptr %p) {
+; CHECK-LABEL: define ptr @noalias_ret
+; CHECK-SAME: (ptr nocapture readonly [[F:%.*]], ptr readonly [[P:%.*]]) #[[ATTR5]] {
+; CHECK-NEXT: [[R:%.*]] = call noalias ptr [[F]](ptr [[P]]) #[[ATTR8]]
+; CHECK-NEXT: ret ptr [[R]]
+;
+ %r = call noalias ptr %f(ptr %p) readonly nounwind
+ ret ptr %r
+}
+
+define ptr @noalias_ret_fail(ptr %f, ptr %p) {
+; CHECK-LABEL: define ptr @noalias_ret_fail
+; CHECK-SAME: (ptr nocapture readonly [[F:%.*]], ptr readonly [[P:%.*]]) #[[ATTR19:[0-9]+]] {
+; CHECK-NEXT: [[R:%.*]] = call noalias ptr [[F]](ptr [[P]]) #[[ATTR23:[0-9]+]]
+; CHECK-NEXT: ret ptr [[R]]
+;
+ %r = call noalias ptr %f(ptr %p) readonly willreturn
+ ret ptr %r
+}
declare ptr @llvm.launder.invariant.group.p0(ptr)
declare ptr @llvm.strip.invariant.group.p0(ptr)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D156840.546497.patch
Type: text/x-patch
Size: 1481 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230802/6def881e/attachment.bin>
More information about the llvm-commits
mailing list