1 ; RUN: opt < %s -inline -inline-threshold=0 -inlinehint-threshold=100 -S | FileCheck %s
3 ; This tests that a hot callee gets the (higher) inlinehint-threshold even
4 ; without inline hints and gets inlined because the cost is less than
5 ; inlinehint-threshold. A cold callee with identical body does not get inlined
6 ; because cost exceeds the inline-threshold. This test is relevant only when the
7 ; old pass manager is used.
9 define i32 @callee1(i32 %x) !prof !21 {
17 define i32 @callee2(i32 %x) !prof !22 {
18 ; CHECK-LABEL: @callee2(
26 define i32 @caller2(i32 %y1) !prof !22 {
27 ; CHECK-LABEL: @caller2(
28 ; CHECK: call i32 @callee2
29 ; CHECK-NOT: call i32 @callee1
30 ; CHECK: ret i32 %x3.i
31 %y2 = call i32 @callee2(i32 %y1)
32 %y3 = call i32 @callee1(i32 %y2)
36 declare void @extern()
38 !llvm.module.flags = !{!1}
39 !21 = !{!"function_entry_count", i64 300}
40 !22 = !{!"function_entry_count", i64 1}
42 !1 = !{i32 1, !"ProfileSummary", !2}
43 !2 = !{!3, !4, !5, !6, !7, !8, !9, !10}
44 !3 = !{!"ProfileFormat", !"InstrProf"}
45 !4 = !{!"TotalCount", i64 10000}
46 !5 = !{!"MaxCount", i64 1000}
47 !6 = !{!"MaxInternalCount", i64 1}
48 !7 = !{!"MaxFunctionCount", i64 1000}
49 !8 = !{!"NumCounts", i64 3}
50 !9 = !{!"NumFunctions", i64 3}
51 !10 = !{!"DetailedSummary", !11}
52 !11 = !{!12, !13, !14}
53 !12 = !{i32 10000, i64 100, i32 1}
54 !13 = !{i32 999000, i64 100, i32 1}
55 !14 = !{i32 999999, i64 1, i32 2}