summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorEaswaran Raman <eraman@google.com>2016-06-03 20:37:19 +0000
committerEaswaran Raman <eraman@google.com>2016-06-03 20:37:19 +0000
commitf22c11f6fbfab39d385bef8129d23302cb502593 (patch)
tree89a086c7e4e0e7bb66195eb76c6fc76c4e9c7a45 /test
parentfd3b149c86788030847fea6800b0e31341779472 (diff)
Analysis pass to access profile summary info
Differential Revision: http://reviews.llvm.org/D20648 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271728 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/Analysis/ProfileSummary/basic.ll39
1 files changed, 39 insertions, 0 deletions
diff --git a/test/Analysis/ProfileSummary/basic.ll b/test/Analysis/ProfileSummary/basic.ll
new file mode 100644
index 00000000000..e417e459f04
--- /dev/null
+++ b/test/Analysis/ProfileSummary/basic.ll
@@ -0,0 +1,39 @@
+; RUN: opt < %s -disable-output -passes=print-profile-summary -S 2>&1 | FileCheck %s
+
+define void @f1() !prof !20 {
+; CHECK-LABEL: f1 :hot
+
+ ret void
+}
+
+define void @f2() !prof !21 {
+; CHECK-LABEL: f2 :cold
+
+ ret void
+}
+
+define void @f3() !prof !22 {
+; CHECK-LABEL: f3
+
+ ret void
+}
+
+!llvm.module.flags = !{!1}
+!20 = !{!"function_entry_count", i64 400}
+!21 = !{!"function_entry_count", i64 1}
+!22 = !{!"function_entry_count", i64 100}
+
+!1 = !{i32 1, !"ProfileSummary", !2}
+!2 = !{!3, !4, !5, !6, !7, !8, !9, !10}
+!3 = !{!"ProfileFormat", !"InstrProf"}
+!4 = !{!"TotalCount", i64 10000}
+!5 = !{!"MaxCount", i64 10}
+!6 = !{!"MaxInternalCount", i64 1}
+!7 = !{!"MaxFunctionCount", i64 1000}
+!8 = !{!"NumCounts", i64 3}
+!9 = !{!"NumFunctions", i64 3}
+!10 = !{!"DetailedSummary", !11}
+!11 = !{!12, !13, !14}
+!12 = !{i32 10000, i64 100, i32 1}
+!13 = !{i32 999000, i64 100, i32 1}
+!14 = !{i32 999999, i64 1, i32 2}