1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2025-02-01 05:01:59 +01:00

Create SampleProfileLoader pass in llvm instead of clang

Summary: We used to create SampleProfileLoader pass in clang. This makes LTO/ThinLTO unable to add this pass in the linker plugin. This patch moves the SampleProfileLoader pass creation from clang to llvm pass manager builder.

Reviewers: tejohnson, davidxl, dnovillo

Subscribers: llvm-commits, mehdi_amini

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

llvm-svn: 289669
This commit is contained in:
Dehao Chen 2016-12-14 16:49:28 +00:00
parent 9fd3ae9cf9
commit 3565f45b60
2 changed files with 7 additions and 0 deletions

View File

@ -149,6 +149,8 @@ public:
std::string PGOInstrGen; std::string PGOInstrGen;
/// Path of the profile data file. /// Path of the profile data file.
std::string PGOInstrUse; std::string PGOInstrUse;
/// Path of the sample Profile data file.
std::string PGOSampleUse;
private: private:
/// ExtensionList - This is list of all of the extensions that are registered. /// ExtensionList - This is list of all of the extensions that are registered.

View File

@ -383,6 +383,11 @@ void PassManagerBuilder::addFunctionSimplificationPasses(
void PassManagerBuilder::populateModulePassManager( void PassManagerBuilder::populateModulePassManager(
legacy::PassManagerBase &MPM) { legacy::PassManagerBase &MPM) {
if (!PGOSampleUse.empty()) {
MPM.add(createPruneEHPass());
MPM.add(createSampleProfileLoaderPass(PGOSampleUse));
}
// Allow forcing function attributes as a debugging and tuning aid. // Allow forcing function attributes as a debugging and tuning aid.
MPM.add(createForceFunctionAttrsLegacyPass()); MPM.add(createForceFunctionAttrsLegacyPass());