From 2c7ca9b5df41332b32adec1def081f48ab6ec5d7 Mon Sep 17 00:00:00 2001 From: Dehao Chen Date: Thu, 13 Apr 2017 19:52:10 +0000 Subject: SamplePGO: convert callsite samples map key from callsite_location to callsite_location+callee_name Summary: For iterative SamplePGO, an indirect call can be speculatively promoted to multiple direct calls and get inlined. All these promoted direct calls will share the same callsite location (offset+discriminator). With the current implementation, we cannot distinguish between different promotion candidates and its inlined instance. This patch adds callee_name to the key of the callsite sample map. And added helper functions to get all inlined callee samples for a given callsite location. This helps the profile annotator promote correct targets and inline it before annotation, and ensures all indirect call targets to be annotated correctly. Reviewers: davidxl, dnovillo Reviewed By: davidxl Subscribers: andreadb, llvm-commits Differential Revision: https://reviews.llvm.org/D31950 llvm-svn: 300240 --- llvm/test/Transforms/SampleProfile/Inputs/indirect-call.prof | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'llvm/test/Transforms/SampleProfile/Inputs') diff --git a/llvm/test/Transforms/SampleProfile/Inputs/indirect-call.prof b/llvm/test/Transforms/SampleProfile/Inputs/indirect-call.prof index ac32967bd54..428d4cedef5 100644 --- a/llvm/test/Transforms/SampleProfile/Inputs/indirect-call.prof +++ b/llvm/test/Transforms/SampleProfile/Inputs/indirect-call.prof @@ -1,8 +1,10 @@ test:63067:0 4: 3345 _Z3barv:1398 _Z3foov:2059 test_inline:3000:0 - 5: foo_inline:3000 + 5: foo_inline1:3000 1: 3000 + 5: foo_inline2:4000 + 1: 4000 test_noinline:3000:0 5: foo_noinline:3000 1: 3000 -- cgit v1.2.3