summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/PGOProfile
diff options
context:
space:
mode:
authorEaswaran Raman <eraman@google.com>2016-06-21 19:29:49 +0000
committerEaswaran Raman <eraman@google.com>2016-06-21 19:29:49 +0000
commit8bceb9d210cb0f6d7f7825357cf82f878d3622b2 (patch)
tree6799d48b7fda276a2269da1557c217f94521bb91 /llvm/test/Transforms/PGOProfile
parentea2a5e689754fa5c603aa0d01b6658fbbaf9fe43 (diff)
downloadbcm5719-llvm-8bceb9d210cb0f6d7f7825357cf82f878d3622b2.tar.gz
bcm5719-llvm-8bceb9d210cb0f6d7f7825357cf82f878d3622b2.zip
Fix PR28219: Use profile summary from reader and not compute it
Differentiaal revision: http://reviews.llvm.org/D21546 llvm-svn: 273301
Diffstat (limited to 'llvm/test/Transforms/PGOProfile')
-rw-r--r--llvm/test/Transforms/PGOProfile/Inputs/PR28219.proftext10
-rw-r--r--llvm/test/Transforms/PGOProfile/PR28219.ll12
2 files changed, 22 insertions, 0 deletions
diff --git a/llvm/test/Transforms/PGOProfile/Inputs/PR28219.proftext b/llvm/test/Transforms/PGOProfile/Inputs/PR28219.proftext
new file mode 100644
index 00000000000..7ebc13cd128
--- /dev/null
+++ b/llvm/test/Transforms/PGOProfile/Inputs/PR28219.proftext
@@ -0,0 +1,10 @@
+# :ir is the flag to indicate this is IR level profile.
+:ir
+@bar
+256
+1
+2
+@foo
+512
+1
+3
diff --git a/llvm/test/Transforms/PGOProfile/PR28219.ll b/llvm/test/Transforms/PGOProfile/PR28219.ll
new file mode 100644
index 00000000000..a0e1904c333
--- /dev/null
+++ b/llvm/test/Transforms/PGOProfile/PR28219.ll
@@ -0,0 +1,12 @@
+; Test that we annotate entire program's summary and not just this module's
+; RUN: llvm-profdata merge %S/Inputs/PR28219.proftext -o %t.profdata
+; RUN: opt < %s -pgo-instr-use -pgo-test-profile-file=%t.profdata -S | FileCheck %s
+
+define i32 @bar() {
+entry:
+ ret i32 1
+}
+; CHECK-DAG: {{![0-9]+}} = !{i32 1, !"ProfileSummary", {{![0-9]+}}}
+; CHECK-DAG: {{![0-9]+}} = !{!"NumFunctions", i64 2}
+; CHECK-DAG: {{![0-9]+}} = !{!"MaxFunctionCount", i64 3}
+
OpenPOWER on IntegriCloud