[PATCH] D156842: [Inliner] Add more tests for deducing return attributes of callsites when inlining; NFC
Noah Goldstein via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 16 20:41:54 PDT 2023
This revision was not accepted when it landed; it landed in state "Needs Review".
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG74c4d1e42251: [Inliner] Add more tests for deducing return attributes of callsites when… (authored by goldstein.w.n).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D156842/new/
https://reviews.llvm.org/D156842
Files:
llvm/test/Transforms/Inline/nonnull.ll
Index: llvm/test/Transforms/Inline/nonnull.ll
===================================================================
--- llvm/test/Transforms/Inline/nonnull.ll
+++ llvm/test/Transforms/Inline/nonnull.ll
@@ -129,3 +129,60 @@
ret void
}
+declare ptr @buz()
+define nonnull ptr @callee7() {
+; CHECK-LABEL: define nonnull ptr @callee7() {
+; CHECK-NEXT: [[R:%.*]] = call ptr @buz() #[[ATTR0:[0-9]+]]
+; CHECK-NEXT: ret ptr [[R]]
+;
+ %r = call ptr @buz() willreturn nounwind
+ ret ptr %r
+}
+
+define ptr @caller7() {
+; CHECK-LABEL: define ptr @caller7() {
+; CHECK-NEXT: [[R_I:%.*]] = call ptr @buz() #[[ATTR0]]
+; CHECK-NEXT: ret ptr [[R_I]]
+;
+ %r = call ptr @callee7()
+ ret ptr %r
+}
+
+define nonnull ptr @callee8() {
+; CHECK-LABEL: define nonnull ptr @callee8() {
+; CHECK-NEXT: [[R:%.*]] = call ptr @buz()
+; CHECK-NEXT: ret ptr [[R]]
+;
+ %r = call ptr @buz()
+ ret ptr %r
+}
+
+define ptr @caller8() {
+; CHECK-LABEL: define ptr @caller8() {
+; CHECK-NEXT: [[R_I:%.*]] = call ptr @buz()
+; CHECK-NEXT: ret ptr [[R_I]]
+;
+ %r = call nonnull ptr @callee8()
+ ret ptr %r
+}
+
+define ptr @callee9() {
+; CHECK-LABEL: define ptr @callee9() {
+; CHECK-NEXT: [[R:%.*]] = call ptr @buz()
+; CHECK-NEXT: call void @foo() #[[ATTR1:[0-9]+]]
+; CHECK-NEXT: ret ptr [[R]]
+;
+ %r = call ptr @buz()
+ call void @foo() nounwind
+ ret ptr %r
+}
+
+define ptr @caller9() {
+; CHECK-LABEL: define ptr @caller9() {
+; CHECK-NEXT: [[R_I:%.*]] = call ptr @buz()
+; CHECK-NEXT: call void @foo() #[[ATTR1]]
+; CHECK-NEXT: ret ptr [[R_I]]
+;
+ %r = call nonnull ptr @callee9()
+ ret ptr %r
+}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D156842.550972.patch
Type: text/x-patch
Size: 1639 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230817/b47c6394/attachment.bin>
More information about the llvm-commits
mailing list