[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
Tue Aug 15 15:46:40 PDT 2023
goldstein.w.n updated this revision to Diff 550509.
goldstein.w.n added a comment.
remove default nounwind
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.550509.patch
Type: text/x-patch
Size: 1639 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230815/3068ecb9/attachment.bin>
More information about the llvm-commits
mailing list