1 ; Test hot or unlikely section postfix based on profile and user annotation.
2 ; RUN: llc < %s | FileCheck %s
3 target triple = "x86_64-unknown-linux-gnu"
5 ; Function Attrs: inlinehint norecurse nounwind readnone uwtable
6 define dso_local i32 @hot1() #0 !prof !31 {
10 ; CHECK: .section .text.hot.,"ax",@progbits
13 ; Function Attrs: cold norecurse nounwind readnone uwtable
14 define dso_local i32 @cold1() #1 !prof !32 {
18 ; CHECK: .section .text.unlikely.,"ax",@progbits
21 ; Function Attrs: cold inlinehint noinline norecurse nounwind optsize readnone uwtable
22 define dso_local i32 @hot2() #2 !prof !31 {
26 ; CHECK: .section .text.hot.,"ax",@progbits
29 define dso_local i32 @normal() {
34 ; CHECK: .globl normal
36 ; Function Attrs: hot noinline norecurse nounwind readnone uwtable
37 define dso_local i32 @hot3() #3 !prof !32 {
41 ; CHECK: .section .text.hot.,"ax",@progbits
44 ; Function Attrs: cold noinline norecurse nounwind optsize readnone uwtable
45 define dso_local i32 @cold2() #4 {
49 ; CHECK: .section .text.unlikely.,"ax",@progbits
52 ; Function Attrs: hot noinline norecurse nounwind readnone uwtable
53 define dso_local i32 @hot4() #3 {
57 ; CHECK: .section .text.hot.,"ax",@progbits
60 attributes #0 = { inlinehint norecurse nounwind readnone uwtable }
61 attributes #1 = { cold norecurse nounwind readnone uwtable }
62 attributes #2 = { cold inlinehint noinline norecurse nounwind optsize readnone uwtable }
63 attributes #3 = { hot noinline norecurse nounwind readnone uwtable }
64 attributes #4 = { cold noinline norecurse nounwind optsize readnone uwtable }
66 !llvm.module.flags = !{!0, !1}
69 !0 = !{i32 1, !"wchar_size", i32 4}
70 !1 = !{i32 1, !"ProfileSummary", !2}
71 !2 = !{!3, !4, !5, !6, !7, !8, !9, !10, !11, !12}
72 !3 = !{!"ProfileFormat", !"InstrProf"}
73 !4 = !{!"TotalCount", i64 402020}
74 !5 = !{!"MaxCount", i64 200000}
75 !6 = !{!"MaxInternalCount", i64 2000}
76 !7 = !{!"MaxFunctionCount", i64 200000}
77 !8 = !{!"NumCounts", i64 7}
78 !9 = !{!"NumFunctions", i64 5}
79 !10 = !{!"IsPartialProfile", i64 0}
80 !11 = !{!"PartialProfileRatio", double 0.000000e+00}
81 !12 = !{!"DetailedSummary", !13}
82 !13 = !{!14, !15, !16, !17, !18, !19, !20, !21, !22, !23, !24, !25, !26, !27, !28, !29}
83 !14 = !{i32 10000, i64 200000, i32 1}
84 !15 = !{i32 100000, i64 200000, i32 1}
85 !16 = !{i32 200000, i64 200000, i32 1}
86 !17 = !{i32 300000, i64 200000, i32 1}
87 !18 = !{i32 400000, i64 200000, i32 1}
88 !19 = !{i32 500000, i64 100000, i32 3}
89 !20 = !{i32 600000, i64 100000, i32 3}
90 !21 = !{i32 700000, i64 100000, i32 3}
91 !22 = !{i32 800000, i64 100000, i32 3}
92 !23 = !{i32 900000, i64 100000, i32 3}
93 !24 = !{i32 950000, i64 100000, i32 3}
94 !25 = !{i32 990000, i64 100000, i32 3}
95 !26 = !{i32 999000, i64 2000, i32 4}
96 !27 = !{i32 999900, i64 2000, i32 4}
97 !28 = !{i32 999990, i64 10, i32 6}
98 !29 = !{i32 999999, i64 10, i32 6}
99 !30 = !{!"clang version 12.0.0 (https://github.com/llvm/llvm-project.git 53c5fdd59a5cf7fbb4dcb7a7e84c9c4a40d32a84)"}
100 !31 = !{!"function_entry_count", i64 100000}
101 !32 = !{!"function_entry_count", i64 10}