summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/SampleProfile/indirect-call.ll
diff options
context:
space:
mode:
authorDehao Chen <dehao@google.com>2017-01-20 22:56:07 +0000
committerDehao Chen <dehao@google.com>2017-01-20 22:56:07 +0000
commit77079003dd3f55528b085d88a137a952548dfc6e (patch)
treee86037d994ab65886356606c890ec31a91d33d53 /llvm/test/Transforms/SampleProfile/indirect-call.ll
parent8c69cffe1536a85a82b4e6241948963ccdda2c32 (diff)
downloadbcm5719-llvm-77079003dd3f55528b085d88a137a952548dfc6e.tar.gz
bcm5719-llvm-77079003dd3f55528b085d88a137a952548dfc6e.zip
Add indirect call promotion to SamplePGO
Summary: This patch adds metadata for indirect call promotion in the sample profile loader. Reviewers: xur, davidxl, dnovillo Reviewed By: davidxl Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D28923 llvm-svn: 292672
Diffstat (limited to 'llvm/test/Transforms/SampleProfile/indirect-call.ll')
-rw-r--r--llvm/test/Transforms/SampleProfile/indirect-call.ll20
1 files changed, 20 insertions, 0 deletions
diff --git a/llvm/test/Transforms/SampleProfile/indirect-call.ll b/llvm/test/Transforms/SampleProfile/indirect-call.ll
new file mode 100644
index 00000000000..01192d80e94
--- /dev/null
+++ b/llvm/test/Transforms/SampleProfile/indirect-call.ll
@@ -0,0 +1,20 @@
+; RUN: opt < %s -sample-profile -sample-profile-file=%S/Inputs/indirect-call.prof -S | FileCheck %s
+
+define void @test(void ()*) !dbg !3 {
+ %2 = alloca void ()*
+ store void ()* %0, void ()** %2
+ %3 = load void ()*, void ()** %2
+ ; CHECK: call {{.*}}, !prof ![[PROF:[0-9]+]]
+ call void %3(), !dbg !4
+ ret void
+}
+
+!llvm.dbg.cu = !{!0}
+!llvm.module.flags = !{!2}
+
+!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1)
+!1 = !DIFile(filename: "test.cc", directory: "/")
+!2 = !{i32 2, !"Debug Info Version", i32 3}
+!3 = distinct !DISubprogram(name: "test", scope: !1, file: !1, line: 1, unit: !0)
+!4 = !DILocation(line: 5, scope: !3)
+; CHECK: ![[PROF]] = !{!"VP", i32 0, i64 3457, i64 9191153033785521275, i64 2059, i64 -1069303473483922844, i64 1398}
OpenPOWER on IntegriCloud