1 ; RUN: opt --Os -pass-remarks=inline -S < %s 2>&1 | FileCheck %s
2 target datalayout = "e-m:o-i64:64-i128:128-n32:64-S128"
3 target triple = "arm64e-apple-macosx13"
5 ; CHECK: remark: <unknown>:0:0: 'wibble' inlined into 'bar.8' with (cost=always): always inline attribute
6 ; CHECK: remark: <unknown>:0:0: 'wibble' inlined into 'pluto' with (cost=always): always inline attribute
7 ; CHECK: remark: <unknown>:0:0: 'snork' inlined into 'blam' with (cost=always): always inline attribute
8 ; CHECK: remark: <unknown>:0:0: 'wobble' inlined into 'blam' with (cost=always): always inline attribute
9 ; CHECK: remark: <unknown>:0:0: 'wobble' inlined into 'snork' with (cost=always): always inline attribute
10 ; CHECK: remark: <unknown>:0:0: 'spam' inlined into 'blam' with (cost=65, threshold=75)
11 ; CHECK: remark: <unknown>:0:0: 'wibble.1' inlined into 'widget' with (cost=30, threshold=75)
12 ; CHECK: remark: <unknown>:0:0: 'widget' inlined into 'bar.8' with (cost=30, threshold=75)
13 ; CHECK: remark: <unknown>:0:0: 'barney' inlined into 'wombat' with (cost=30, threshold=75)
15 define linkonce_odr void @wombat(ptr %arg) #0 {
23 call void @wombat(ptr null)
27 define linkonce_odr void @pluto() #1 !prof !38 {
33 ; Function Attrs: alwaysinline
34 define linkonce_odr void @wibble() #2 {
40 define linkonce_odr void @widget() {
46 define linkonce_odr void @wibble.1() {
48 %0 = call i32 @foo.2()
55 define linkonce_odr void @blam() {
57 %tmp = call i32 @snork()
58 %tmpv1 = call ptr @wombat.3()
60 %tmpv2 = call ptr @wombat.3()
64 ; Function Attrs: alwaysinline
65 define linkonce_odr i32 @snork() #2 {
67 %tmpv1 = call i32 @spam()
68 %tmpv2 = call i32 @wobble()
69 call void @widget.4(i32 %tmpv2)
75 declare ptr @wombat.3()
77 define linkonce_odr i32 @spam() {
79 %tmpv1 = call i32 @wombat.6()
80 %tmpv2 = call i64 @wobble.5(i8 0)
81 %tmpv3 = call i64 @bar()
85 ; Function Attrs: alwaysinline
86 define linkonce_odr i32 @wobble() #2 {
88 %tmpv = call i64 @wobble.5(i8 0)
89 %tmpv1 = call i64 @eggs.7()
90 %tmpv2 = call i64 @wobble.5(i8 0)
91 %tmpv3 = call i64 @eggs.7()
92 %tmpv4 = lshr i64 %tmpv1, 1
93 %tmpv5 = trunc i64 %tmpv4 to i32
94 %tmpv6 = xor i32 %tmpv5, 23
98 declare void @widget.4(i32)
102 declare i64 @wobble.5(i8)
104 declare i32 @wombat.6()
106 declare i64 @eggs.7()
108 define linkonce_odr void @barney() {
115 define linkonce_odr void @bar.8() {
121 attributes #0 = { "frame-pointer"="non-leaf" }
122 attributes #1 = { "target-cpu"="apple-m1" }
123 attributes #2 = { alwaysinline }
125 !llvm.module.flags = !{!0, !1, !30, !31, !32, !36, !37}
127 !0 = !{i32 2, !"SDK Version", [2 x i32] [i32 13, i32 3]}
128 !1 = !{i32 1, !"ProfileSummary", !2}
129 !2 = !{!3, !4, !5, !6, !7, !8, !9, !10, !11, !12}
130 !3 = !{!"ProfileFormat", !"InstrProf"}
131 !4 = !{!"TotalCount", i64 864540306756}
132 !5 = !{!"MaxCount", i64 6596759955}
133 !6 = !{!"MaxInternalCount", i64 2828618424}
134 !7 = !{!"MaxFunctionCount", i64 6596759955}
135 !8 = !{!"NumCounts", i64 268920}
136 !9 = !{!"NumFunctions", i64 106162}
137 !10 = !{!"IsPartialProfile", i64 0}
138 !11 = !{!"PartialProfileRatio", double 0.000000e+00}
139 !12 = !{!"DetailedSummary", !13}
140 !13 = !{!14, !15, !16, !17, !18, !19, !20, !21, !22, !23, !24, !25, !26, !27, !28, !29}
141 !14 = !{i32 10000, i64 5109654023, i32 2}
142 !15 = !{i32 100000, i64 2480859832, i32 25}
143 !16 = !{i32 200000, i64 1566552109, i32 70}
144 !17 = !{i32 300000, i64 973667919, i32 140}
145 !18 = !{i32 400000, i64 552159773, i32 263}
146 !19 = !{i32 500000, i64 353879860, i32 463}
147 !20 = !{i32 600000, i64 187122455, i32 799}
148 !21 = !{i32 700000, i64 105465980, i32 1419}
149 !22 = !{i32 800000, i64 49243829, i32 2620}
150 !23 = !{i32 900000, i64 15198227, i32 5898}
151 !24 = !{i32 950000, i64 5545670, i32 10696}
152 !25 = !{i32 990000, i64 804816, i32 25738}
153 !26 = !{i32 999000, i64 73999, i32 53382}
154 !27 = !{i32 999900, i64 6530, i32 83503}
155 !28 = !{i32 999990, i64 899, i32 110416}
156 !29 = !{i32 999999, i64 120, i32 130201}
157 !30 = !{i32 7, !"Dwarf Version", i32 4}
158 !31 = !{i32 2, !"Debug Info Version", i32 3}
159 !32 = !{i32 1, !"wchar_size", i32 4}
161 !35 = !{i32 0, i1 false}
162 !36 = !{i32 8, !"PIC Level", i32 2}
163 !37 = !{i32 7, !"frame-pointer", i32 1}
164 !38 = !{!"function_entry_count", i64 15128150}