diff options
author | Than McIntosh <thanm@google.com> | 2019-03-14 13:56:49 +0000 |
---|---|---|
committer | Than McIntosh <thanm@google.com> | 2019-03-14 13:56:49 +0000 |
commit | 9f96f1f17aa9c3db76ca419a60f913015a679bf2 (patch) | |
tree | 44e320d312fcd9091751ca87cb2d9fbc656ee049 /llvm/lib | |
parent | 9678e8d57627a3a2e275d0b55448c21e949222cd (diff) | |
download | bcm5719-llvm-9f96f1f17aa9c3db76ca419a60f913015a679bf2.tar.gz bcm5719-llvm-9f96f1f17aa9c3db76ca419a60f913015a679bf2.zip |
[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
llvm-svn: 356146
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/ProfileData/SampleProfReader.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/ProfileData/SampleProfReader.cpp b/llvm/lib/ProfileData/SampleProfReader.cpp index 2e43c9599c8..192b6c71156 100644 --- a/llvm/lib/ProfileData/SampleProfReader.cpp +++ b/llvm/lib/ProfileData/SampleProfReader.cpp @@ -593,8 +593,8 @@ std::error_code SampleProfileReaderCompactBinary::readFuncOffsetTable() { void SampleProfileReaderCompactBinary::collectFuncsToUse(const Module &M) { FuncsToUse.clear(); for (auto &F : M) { - StringRef Fname = F.getName().split('.').first; - FuncsToUse.insert(Fname); + StringRef CanonName = FunctionSamples::getCanonicalFnName(F); + FuncsToUse.insert(CanonName); } } |