[PATCH] D31950: SamplePGO: convert callsite samples map key from callsite_location to callsite_location+callee_name

Dehao Chen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 11 10:30:33 PDT 2017


danielcdh created this revision.

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.


https://reviews.llvm.org/D31950

Files:
  include/llvm/ProfileData/SampleProf.h
  lib/ProfileData/SampleProf.cpp
  lib/ProfileData/SampleProfReader.cpp
  lib/ProfileData/SampleProfWriter.cpp
  lib/Transforms/IPO/SampleProfile.cpp
  test/Transforms/SampleProfile/Inputs/indirect-call.prof
  test/Transforms/SampleProfile/indirect-call.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D31950.94853.patch
Type: text/x-patch
Size: 17054 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170411/a2d8f7e6/attachment.bin>


More information about the llvm-commits mailing list