diff options
author | Dehao Chen <dehao@google.com> | 2017-10-05 20:15:29 +0000 |
---|---|---|
committer | Dehao Chen <dehao@google.com> | 2017-10-05 20:15:29 +0000 |
commit | 16f01fb1db79cf0344a96efa3081f92490e638e4 (patch) | |
tree | 78ed16d6c7478267f89c50d98d4d681129842f18 /llvm/test | |
parent | 0876cfb2f457c73b526a8d1c0158bac9e9c86ef6 (diff) | |
download | bcm5719-llvm-16f01fb1db79cf0344a96efa3081f92490e638e4.tar.gz bcm5719-llvm-16f01fb1db79cf0344a96efa3081f92490e638e4.zip |
Annotate VP prof on indirect call if it is ICPed in the profiled binary.
Summary: In SamplePGO, when an indirect call is promoted in the profiled binary, before profile annotation, it will be promoted and inlined. For the original indirect call, the current implementation will not mark VP profile on it. This is an issue when profile becomes stale. This patch annotates VP prof on indirect calls during annotation.
Reviewers: tejohnson
Reviewed By: tejohnson
Subscribers: sanjoy, llvm-commits
Differential Revision: https://reviews.llvm.org/D38477
llvm-svn: 315016
Diffstat (limited to 'llvm/test')
-rw-r--r-- | llvm/test/Transforms/SampleProfile/Inputs/indirect-call.prof | 1 | ||||
-rw-r--r-- | llvm/test/Transforms/SampleProfile/indirect-call.ll | 3 |
2 files changed, 3 insertions, 1 deletions
diff --git a/llvm/test/Transforms/SampleProfile/Inputs/indirect-call.prof b/llvm/test/Transforms/SampleProfile/Inputs/indirect-call.prof index f35b4b13c71..dda7d0585e3 100644 --- a/llvm/test/Transforms/SampleProfile/Inputs/indirect-call.prof +++ b/llvm/test/Transforms/SampleProfile/Inputs/indirect-call.prof @@ -1,6 +1,7 @@ test:63067:0 1: 3345 _Z3barv:1398 _Z3foov:2059 test_inline:3000:0 + 1: 1000 foo_inline3:1000 1: foo_inline1:3000 11: 3000 1: foo_inline2:4000 diff --git a/llvm/test/Transforms/SampleProfile/indirect-call.ll b/llvm/test/Transforms/SampleProfile/indirect-call.ll index 28d61ed2426..02fcb11060a 100644 --- a/llvm/test/Transforms/SampleProfile/indirect-call.ll +++ b/llvm/test/Transforms/SampleProfile/indirect-call.ll @@ -24,7 +24,7 @@ define void @test_inline(i64* (i32*)*, i32* %x) !dbg !6 { ; CHECK: if.true.direct_targ1: ; CHECK-NOT: call ; CHECK: if.false.orig_indirect2: -; CHECK: call +; CHECK: call {{.*}} !prof ![[VP:[0-9]+]] call i64* %3(i32* %x), !dbg !7 ret void } @@ -152,6 +152,7 @@ define void @test_direct() !dbg !22 { !4 = !DILocation(line: 4, scope: !3) !5 = !DILocation(line: 6, scope: !3) ; CHECK: ![[PROF]] = !{!"VP", i32 0, i64 3457, i64 9191153033785521275, i64 2059, i64 -1069303473483922844, i64 1398} +; CHECK: ![[VP]] = !{!"VP", i32 0, i64 1000, i64 -6391416044382067764, i64 1000} !6 = distinct !DISubprogram(name: "test_inline", scope: !1, file: !1, line: 6, unit: !0) !7 = !DILocation(line: 7, scope: !6) !8 = distinct !DISubprogram(name: "test_inline_strip", scope: !1, file: !1, line: 8, unit: !0) |