xref: /llvm-project/llvm/test/Analysis/ProfileSummary/basic.ll (revision c5e1506ec8c43dc44fa00e08c6cc14b330044987)
1019e0bf5SEaswaran Raman; RUN: opt < %s -disable-output -passes=print-profile-summary -S 2>&1 | FileCheck %s
2*c5e1506eSEaswaran Raman; RUN: opt < %s -disable-output -profile-summary-hot-count=500 -passes=print-profile-summary -S 2>&1 | FileCheck %s -check-prefixes=OVERRIDE-HOT
3*c5e1506eSEaswaran Raman; RUN: opt < %s -disable-output -profile-summary-cold-count=0 -passes=print-profile-summary -S 2>&1 | FileCheck %s -check-prefixes=OVERRIDE-COLD
4*c5e1506eSEaswaran Raman; 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
5019e0bf5SEaswaran Raman
6019e0bf5SEaswaran Ramandefine void @f1() !prof !20 {
7019e0bf5SEaswaran Raman; CHECK-LABEL: f1 :hot
8*c5e1506eSEaswaran Raman; OVERRIDE-HOT-LABEL: f1
9*c5e1506eSEaswaran Raman; OVERRIDE-COLD-LABEL: f1 :hot
10*c5e1506eSEaswaran Raman; OVERRIDE-BOTH-LABEL: f1
11019e0bf5SEaswaran Raman
12019e0bf5SEaswaran Raman  ret void
13019e0bf5SEaswaran Raman}
14019e0bf5SEaswaran Raman
15019e0bf5SEaswaran Ramandefine void @f2() !prof !21 {
16019e0bf5SEaswaran Raman; CHECK-LABEL: f2 :cold
17*c5e1506eSEaswaran Raman; OVERRIDE-HOT-LABEL: f2 :cold
18*c5e1506eSEaswaran Raman; OVERRIDE-COLD-LABEL: f2
19*c5e1506eSEaswaran Raman; OVERRIDE-BOTH-LABEL: f2
20019e0bf5SEaswaran Raman
21019e0bf5SEaswaran Raman  ret void
22019e0bf5SEaswaran Raman}
23019e0bf5SEaswaran Raman
24019e0bf5SEaswaran Ramandefine void @f3() !prof !22 {
25019e0bf5SEaswaran Raman; CHECK-LABEL: f3
26*c5e1506eSEaswaran Raman; OVERRIDE-HOT-LABEL: f3
27*c5e1506eSEaswaran Raman; OVERRIDE-COLD-LABEL: f3
28*c5e1506eSEaswaran Raman; OVERRIDE-BOTH-LABEL: f3
29019e0bf5SEaswaran Raman
30019e0bf5SEaswaran Raman  ret void
31019e0bf5SEaswaran Raman}
32019e0bf5SEaswaran Raman
33019e0bf5SEaswaran Raman!llvm.module.flags = !{!1}
34019e0bf5SEaswaran Raman!20 = !{!"function_entry_count", i64 400}
35019e0bf5SEaswaran Raman!21 = !{!"function_entry_count", i64 1}
36019e0bf5SEaswaran Raman!22 = !{!"function_entry_count", i64 100}
37019e0bf5SEaswaran Raman
38019e0bf5SEaswaran Raman!1 = !{i32 1, !"ProfileSummary", !2}
39019e0bf5SEaswaran Raman!2 = !{!3, !4, !5, !6, !7, !8, !9, !10}
40019e0bf5SEaswaran Raman!3 = !{!"ProfileFormat", !"InstrProf"}
41019e0bf5SEaswaran Raman!4 = !{!"TotalCount", i64 10000}
42019e0bf5SEaswaran Raman!5 = !{!"MaxCount", i64 10}
43019e0bf5SEaswaran Raman!6 = !{!"MaxInternalCount", i64 1}
44019e0bf5SEaswaran Raman!7 = !{!"MaxFunctionCount", i64 1000}
45019e0bf5SEaswaran Raman!8 = !{!"NumCounts", i64 3}
46019e0bf5SEaswaran Raman!9 = !{!"NumFunctions", i64 3}
47019e0bf5SEaswaran Raman!10 = !{!"DetailedSummary", !11}
48019e0bf5SEaswaran Raman!11 = !{!12, !13, !14}
49019e0bf5SEaswaran Raman!12 = !{i32 10000, i64 100, i32 1}
50019e0bf5SEaswaran Raman!13 = !{i32 999000, i64 100, i32 1}
51019e0bf5SEaswaran Raman!14 = !{i32 999999, i64 1, i32 2}
52