diff options
author | Teresa Johnson <tejohnson@google.com> | 2016-08-29 22:46:56 +0000 |
---|---|---|
committer | Teresa Johnson <tejohnson@google.com> | 2016-08-29 22:46:56 +0000 |
commit | cf538716fb63c526a3dab7c933936ff6b8f8f8a8 (patch) | |
tree | 2d155396724505c0990ebf7fe21f211a4c1e7e40 /lib/ProfileData/InstrProf.cpp | |
parent | e060ffb4b20e294ecb8429bd8a925f9f12b63b17 (diff) |
[ThinLTO] Indirect call promotion fixes for promoted local functions
Summary:
Fix a couple issues limiting the application of indirect call promotion
in ThinLTO mode:
- Invoke indirect call promotion before globalopt, since it may
eliminate imported functions which appear unreferenced.
- Invoke indirect call promotion with InLTO=true so that the PGOFuncName
metadata is used to get the name for locals which would have been
renamed during promotion.
Reviewers: davidxl, mehdi_amini
Subscribers: Prazek, llvm-commits, mehdi_amini
Differential Revision: https://reviews.llvm.org/D24004
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280024 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/ProfileData/InstrProf.cpp')
-rw-r--r-- | lib/ProfileData/InstrProf.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/ProfileData/InstrProf.cpp b/lib/ProfileData/InstrProf.cpp index a0400721166..dac91950183 100644 --- a/lib/ProfileData/InstrProf.cpp +++ b/lib/ProfileData/InstrProf.cpp @@ -136,6 +136,9 @@ std::string getPGOFuncName(StringRef RawFuncName, // (when \c InLTO is true): LTO's internalization privatizes many global linkage // symbols. This happens after value profile annotation, but those internal // linkage functions should not have a source prefix. +// Additionally, for ThinLTO mode, exported internal functions are promoted +// and renamed. We need to ensure that the original internal PGO name is +// used when computing the GUID that is compared against the profiled GUIDs. // To differentiate compiler generated internal symbols from original ones, // PGOFuncName meta data are created and attached to the original internal // symbols in the value profile annotation step |