1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 11:13:28 +01:00
llvm-mirror/include/llvm/ProfileData
Dehao Chen 55d461dd66 SamplePGO ThinLTO ICP fix for local functions.
Summary:
In SamplePGO, if the profile is collected from non-LTO binary, and used to drive ThinLTO, the indirect call promotion may fail because ThinLTO adjusts local function names to avoid conflicts. There are two places of where the mismatch can happen:

1. thin-link prepends SourceFileName to front of FuncName to build the GUID (GlobalValue::getGlobalIdentifier). Unlike instrumentation FDO, SamplePGO does not use the PGOFuncName scheme and therefore the indirect call target profile data contains a hash of the OriginalName.
2. backend compiler promotes some local functions to global and appends .llvm.{$ModuleHash} to the end of the FuncName to derive PromotedFunctionName

This patch tries at the best effort to find the GUID from the original local function name (in profile), and use that in ICP promotion, and in SamplePGO matching that happens in the backend after importing/inlining:

1. in thin-link, it builds the map from OriginalName to GUID so that when thin-link reads in indirect call target profile (represented by OriginalName), it knows which GUID to import.
2. in backend compiler, if sample profile reader cannot find a profile match for PromotedFunctionName, it will try to find if there is a match for OriginalFunctionName.
3. in backend compiler, we build symbol table entry for OriginalFunctionName and pointer to the same symbol of PromotedFunctionName, so that ICP can find the correct target to promote.

Reviewers: mehdi_amini, tejohnson

Reviewed By: tejohnson

Subscribers: llvm-commits, Prazek

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

llvm-svn: 297757
2017-03-14 17:33:01 +00:00
..
Coverage [ProfileData] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC). 2017-03-03 01:07:34 +00:00
InstrProf.h [PGO] Text format profile reader needs to clear the value profile 2017-03-03 21:56:34 +00:00
InstrProfData.inc Sync up InstrProfData.inc with compiler-rt with fixes to references 2016-07-22 04:46:56 +00:00
InstrProfReader.h [ProfileData] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC). 2017-03-03 01:07:34 +00:00
InstrProfWriter.h [ProfileData] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC). 2017-03-03 01:07:34 +00:00
ProfileCommon.h [ProfileData] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC). 2017-03-03 01:07:34 +00:00
SampleProf.h Remove the sample pgo annotation heuristic that uses call count to annotate basic block count. 2017-03-06 17:49:59 +00:00
SampleProfReader.h SamplePGO ThinLTO ICP fix for local functions. 2017-03-14 17:33:01 +00:00
SampleProfWriter.h [ProfileData] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC). 2017-03-03 01:07:34 +00:00