[llvm] ca42cd3 - [Tests] More InlineCost tests with attributes only on callsites
Dávid Bolvanský via llvm-commits
llvm-commits at lists.llvm.org
Wed Apr 5 15:50:27 PDT 2023
Author: Dávid Bolvanský
Date: 2023-04-06T00:50:17+02:00
New Revision: ca42cd3e1264f8b44304019da07b6059a610fd24
URL: https://github.com/llvm/llvm-project/commit/ca42cd3e1264f8b44304019da07b6059a610fd24
DIFF: https://github.com/llvm/llvm-project/commit/ca42cd3e1264f8b44304019da07b6059a610fd24.diff
LOG: [Tests] More InlineCost tests with attributes only on callsites
Added:
Modified:
llvm/test/Transforms/Inline/nonnull.ll
Removed:
################################################################################
diff --git a/llvm/test/Transforms/Inline/nonnull.ll b/llvm/test/Transforms/Inline/nonnull.ll
index 324afbbbdc11..5f8af7f78fde 100644
--- a/llvm/test/Transforms/Inline/nonnull.ll
+++ b/llvm/test/Transforms/Inline/nonnull.ll
@@ -72,8 +72,45 @@ define void @caller2(ptr %arg) {
ret void
}
-define void @caller3(ptr dereferenceable(8) %arg) {
+define void @caller3(ptr %arg) {
; CHECK-LABEL: define void @caller3
+; CHECK-SAME: (ptr [[ARG:%.*]]) {
+; CHECK-NEXT: [[CMP_I:%.*]] = icmp eq ptr [[ARG]], null
+; CHECK-NEXT: br i1 [[CMP_I]], label [[EXPENSIVE_I:%.*]], label [[DONE_I:%.*]]
+; CHECK: expensive.i:
+; CHECK-NEXT: call void @foo()
+; CHECK-NEXT: call void @foo()
+; CHECK-NEXT: call void @foo()
+; CHECK-NEXT: call void @foo()
+; CHECK-NEXT: call void @foo()
+; CHECK-NEXT: call void @foo()
+; CHECK-NEXT: call void @foo()
+; CHECK-NEXT: call void @foo()
+; CHECK-NEXT: call void @foo()
+; CHECK-NEXT: call void @foo()
+; CHECK-NEXT: br label [[CALLEE_EXIT:%.*]]
+; CHECK: done.i:
+; CHECK-NEXT: call void @bar()
+; CHECK-NEXT: br label [[CALLEE_EXIT]]
+; CHECK: callee.exit:
+; CHECK-NEXT: ret void
+;
+ call void @callee(ptr nonnull %arg)
+ ret void
+}
+
+define void @caller4(ptr dereferenceable(8) %arg) {
+; CHECK-LABEL: define void @caller4
+; CHECK-SAME: (ptr dereferenceable(8) [[ARG:%.*]]) {
+; CHECK-NEXT: call void @callee(ptr dereferenceable(8) [[ARG]])
+; CHECK-NEXT: ret void
+;
+ call void @callee(ptr dereferenceable(8) %arg)
+ ret void
+}
+
+define void @caller5(ptr dereferenceable(8) %arg) {
+; CHECK-LABEL: define void @caller5
; CHECK-SAME: (ptr dereferenceable(8) [[ARG:%.*]]) {
; CHECK-NEXT: call void @callee(ptr [[ARG]])
; CHECK-NEXT: ret void
@@ -82,8 +119,8 @@ define void @caller3(ptr dereferenceable(8) %arg) {
ret void
}
-define void @caller4(ptr %arg) {
-; CHECK-LABEL: define void @caller4
+define void @caller6(ptr %arg) {
+; CHECK-LABEL: define void @caller6
; CHECK-SAME: (ptr [[ARG:%.*]]) {
; CHECK-NEXT: call void @callee(ptr dereferenceable(8) [[ARG]])
; CHECK-NEXT: ret void
More information about the llvm-commits
mailing list