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: 'spam' inlined into 'blam' with (cost=65, threshold=75)
10 ; CHECK: remark: <unknown>:0:0: 'wibble.1' inlined into 'widget' with (cost=30, threshold=75)
11 ; CHECK: remark: <unknown>:0:0: 'widget' inlined into 'bar.8' with (cost=30, threshold=75)
12 ; CHECK: remark: <unknown>:0:0: 'barney' inlined into 'wombat' with (cost=30, threshold=75)
14 define linkonce_odr void @wombat(ptr %arg) #0 {
22 call void @wombat(ptr null)
26 define linkonce_odr void @pluto() #1 !prof !38 {
32 ; Function Attrs: alwaysinline
33 define linkonce_odr void @wibble() #2 {
39 define linkonce_odr void @widget() {
45 define linkonce_odr void @wibble.1() {
47 %0 = call i32 @foo.2()
54 define linkonce_odr void @blam() {
56 %tmp = call i32 @snork()
57 %tmpv1 = call ptr @wombat.3()
59 %tmpv2 = call ptr @wombat.3()
63 ; Function Attrs: alwaysinline
64 define linkonce_odr i32 @snork() #2 {
66 %tmpv1 = call i32 @spam()
67 %tmpv2 = call i32 @wobble()
68 call void @widget.4(i32 %tmpv2)
74 declare ptr @wombat.3()
76 define linkonce_odr i32 @spam() {
78 %tmpv1 = call i32 @wombat.6()
79 %tmpv2 = call i64 @wobble.5(i8 0)
80 %tmpv3 = call i64 @bar()
84 ; Function Attrs: alwaysinline
85 define linkonce_odr i32 @wobble() #2 {
87 %tmpv = call i64 @wobble.5(i8 0)
88 %tmpv1 = call i64 @eggs.7()
89 %tmpv2 = call i64 @wobble.5(i8 0)
90 %tmpv3 = call i64 @eggs.7()
91 %tmpv4 = lshr i64 %tmpv1, 1
92 %tmpv5 = trunc i64 %tmpv4 to i32
93 %tmpv6 = xor i32 %tmpv5, 23
97 declare void @widget.4(i32)
101 declare i64 @wobble.5(i8)
103 declare i32 @wombat.6()
105 declare i64 @eggs.7()
107 define linkonce_odr void @barney() {
114 define linkonce_odr void @bar.8() {
120 attributes #0 = { "frame-pointer"="non-leaf" }
121 attributes #1 = { "target-cpu"="apple-m1" }
122 attributes #2 = { alwaysinline }
124 !llvm.module.flags = !{!0, !1, !30, !31, !32, !36, !37}
126 !0 = !{i32 2, !"SDK Version", [2 x i32] [i32 13, i32 3]}
127 !1 = !{i32 1, !"ProfileSummary", !2}
128 !2 = !{!3, !4, !5, !6, !7, !8, !9, !10, !11, !12}
129 !3 = !{!"ProfileFormat", !"InstrProf"}
130 !4 = !{!"TotalCount", i64 864540306756}
131 !5 = !{!"MaxCount", i64 6596759955}
132 !6 = !{!"MaxInternalCount", i64 2828618424}
133 !7 = !{!"MaxFunctionCount", i64 6596759955}
134 !8 = !{!"NumCounts", i64 268920}
135 !9 = !{!"NumFunctions", i64 106162}
136 !10 = !{!"IsPartialProfile", i64 0}
137 !11 = !{!"PartialProfileRatio", double 0.000000e+00}
138 !12 = !{!"DetailedSummary", !13}
139 !13 = !{!14, !15, !16, !17, !18, !19, !20, !21, !22, !23, !24, !25, !26, !27, !28, !29}
140 !14 = !{i32 10000, i64 5109654023, i32 2}
141 !15 = !{i32 100000, i64 2480859832, i32 25}
142 !16 = !{i32 200000, i64 1566552109, i32 70}
143 !17 = !{i32 300000, i64 973667919, i32 140}
144 !18 = !{i32 400000, i64 552159773, i32 263}
145 !19 = !{i32 500000, i64 353879860, i32 463}
146 !20 = !{i32 600000, i64 187122455, i32 799}
147 !21 = !{i32 700000, i64 105465980, i32 1419}
148 !22 = !{i32 800000, i64 49243829, i32 2620}
149 !23 = !{i32 900000, i64 15198227, i32 5898}
150 !24 = !{i32 950000, i64 5545670, i32 10696}
151 !25 = !{i32 990000, i64 804816, i32 25738}
152 !26 = !{i32 999000, i64 73999, i32 53382}
153 !27 = !{i32 999900, i64 6530, i32 83503}
154 !28 = !{i32 999990, i64 899, i32 110416}
155 !29 = !{i32 999999, i64 120, i32 130201}
156 !30 = !{i32 7, !"Dwarf Version", i32 4}
157 !31 = !{i32 2, !"Debug Info Version", i32 3}
158 !32 = !{i32 1, !"wchar_size", i32 4}
160 !35 = !{i32 0, i1 false}
161 !36 = !{i32 8, !"PIC Level", i32 2}
162 !37 = !{i32 7, !"frame-pointer", i32 1}
163 !38 = !{!"function_entry_count", i64 15128150}