xref: /llvm-project/llvm/test/Analysis/ProfileSummary/basic.ll (revision c5e1506ec8c43dc44fa00e08c6cc14b330044987)
1; RUN: opt < %s -disable-output -passes=print-profile-summary -S 2>&1 | FileCheck %s
2; RUN: opt < %s -disable-output -profile-summary-hot-count=500 -passes=print-profile-summary -S 2>&1 | FileCheck %s -check-prefixes=OVERRIDE-HOT
3; RUN: opt < %s -disable-output -profile-summary-cold-count=0 -passes=print-profile-summary -S 2>&1 | FileCheck %s -check-prefixes=OVERRIDE-COLD
4; RUN: opt < %s -disable-output -profile-summary-cold-count=200 -profile-summary-hot-count=1000 -passes=print-profile-summary -S 2>&1 | FileCheck %s -check-prefixes=OVERRIDE-BOTH
5
6define void @f1() !prof !20 {
7; CHECK-LABEL: f1 :hot
8; OVERRIDE-HOT-LABEL: f1
9; OVERRIDE-COLD-LABEL: f1 :hot
10; OVERRIDE-BOTH-LABEL: f1
11
12  ret void
13}
14
15define void @f2() !prof !21 {
16; CHECK-LABEL: f2 :cold
17; OVERRIDE-HOT-LABEL: f2 :cold
18; OVERRIDE-COLD-LABEL: f2
19; OVERRIDE-BOTH-LABEL: f2
20
21  ret void
22}
23
24define void @f3() !prof !22 {
25; CHECK-LABEL: f3
26; OVERRIDE-HOT-LABEL: f3
27; OVERRIDE-COLD-LABEL: f3
28; OVERRIDE-BOTH-LABEL: f3
29
30  ret void
31}
32
33!llvm.module.flags = !{!1}
34!20 = !{!"function_entry_count", i64 400}
35!21 = !{!"function_entry_count", i64 1}
36!22 = !{!"function_entry_count", i64 100}
37
38!1 = !{i32 1, !"ProfileSummary", !2}
39!2 = !{!3, !4, !5, !6, !7, !8, !9, !10}
40!3 = !{!"ProfileFormat", !"InstrProf"}
41!4 = !{!"TotalCount", i64 10000}
42!5 = !{!"MaxCount", i64 10}
43!6 = !{!"MaxInternalCount", i64 1}
44!7 = !{!"MaxFunctionCount", i64 1000}
45!8 = !{!"NumCounts", i64 3}
46!9 = !{!"NumFunctions", i64 3}
47!10 = !{!"DetailedSummary", !11}
48!11 = !{!12, !13, !14}
49!12 = !{i32 10000, i64 100, i32 1}
50!13 = !{i32 999000, i64 100, i32 1}
51!14 = !{i32 999999, i64 1, i32 2}
52