]> granicus.if.org Git - llvm/commit
[SampleFDO] add suffix elision control for fcn names
authorThan McIntosh <thanm@google.com>
Thu, 14 Mar 2019 13:56:49 +0000 (13:56 +0000)
committerThan McIntosh <thanm@google.com>
Thu, 14 Mar 2019 13:56:49 +0000 (13:56 +0000)
commit002b63f0a3bc17dd34d4392f6622b3041d5af32e
treedc63a909e501443dec5fa08a38c5ee32cb357e2c
parent32ff027088cf1d734a15cff2273a3d0c79a04d23
[SampleFDO] add suffix elision control for fcn names

Summary:
Add hooks for determining the policy used to decide whether/how
to chop off symbol 'suffixes' when locating a given function
in a sample profile.

Prior to this change, any function symbols of the form "X.Y" were
elided/truncated into just "X" when looking up things in a sample
profile data file.

With this change, the policy on suffixes can be changed by adding a
new attribute "sample-profile-suffix-elision-policy" to the function:
this attribute can have the value "all" (the default), "selected", or
"none". A value of "all" preserves the previous behavior (chop off
everything after the first "." character, then treat that as the
symbol name). A value of "selected" chops off only the rightmost
".llvm.XXXX" suffix (where "XXX" is any string not containing a "."
char). A value of "none" indicates that names should be left as is.

Subscribers: jdoerfert, wmi, mtrofin, danielcdh, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D58832

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@356146 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/ProfileData/SampleProf.h
include/llvm/ProfileData/SampleProfReader.h
lib/ProfileData/SampleProfReader.cpp
unittests/ProfileData/SampleProfTest.cpp