diff options
author | Teresa Johnson <tejohnson@google.com> | 2016-07-17 14:47:01 +0000 |
---|---|---|
committer | Teresa Johnson <tejohnson@google.com> | 2016-07-17 14:47:01 +0000 |
commit | cd21a646f656c18bc71bb2ef789ff34ce8f2557c (patch) | |
tree | 925cccde836abec164a8a04d7717cb2db6ba6a25 /llvm/lib/Transforms/IPO/PassManagerBuilder.cpp | |
parent | ce7de9b6fba73a938c80d6dbb737c48be6e8f7dc (diff) | |
download | llvm-cd21a646f656c18bc71bb2ef789ff34ce8f2557c.zip llvm-cd21a646f656c18bc71bb2ef789ff34ce8f2557c.tar.gz llvm-cd21a646f656c18bc71bb2ef789ff34ce8f2557c.tar.bz2 |
[ThinLTO] Perform profile-guided indirect call promotion
Summary:
To enable profile-guided indirect call promotion in ThinLTO mode, we
simply add call graph edges for each profitable target from the profile
to the summaries, then the summary-guided importing will consider the
callee for importing as usual.
Also we need to enable the indirect call promotion pass creation in the
PassManagerBuilder when PerformThinLTO=true (we are in the ThinLTO
backend), so that the newly imported functions are considered for
promotion in the backends.
The IC promotion profiles refer to callees by GUID, which required
adding GUIDs to the per-module VST in bitcode (and assigning them
valueIds similar to how they are assigned valueIds in the combined
index).
Reviewers: mehdi_amini, xur
Subscribers: mehdi_amini, davidxl, llvm-commits
Differential Revision: http://reviews.llvm.org/D21932
llvm-svn: 275707
Diffstat (limited to 'llvm/lib/Transforms/IPO/PassManagerBuilder.cpp')
-rw-r--r-- | llvm/lib/Transforms/IPO/PassManagerBuilder.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp b/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp index 537919d..cf5b76d 100644 --- a/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp +++ b/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp @@ -407,10 +407,11 @@ void PassManagerBuilder::populateModulePassManager( /// PGO instrumentation is added during the compile phase for ThinLTO, do /// not run it a second time addPGOInstrPasses(MPM); - // Indirect call promotion that promotes intra-module targets only. - MPM.add(createPGOIndirectCallPromotionLegacyPass()); } + // Indirect call promotion that promotes intra-module targets only. + MPM.add(createPGOIndirectCallPromotionLegacyPass()); + if (EnableNonLTOGlobalsModRef) // We add a module alias analysis pass here. In part due to bugs in the // analysis infrastructure this "works" in that the analysis stays alive |