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: 289714
std::string PGOInstrGen;
/// Path of the profile data file.
std::string PGOInstrUse;
+ /// Path of the sample Profile data file.
+ std::string PGOSampleUse;
private:
/// ExtensionList - This is list of all of the extensions that are registered.
void PassManagerBuilder::populateModulePassManager(
legacy::PassManagerBase &MPM) {
+ if (!PGOSampleUse.empty()) {
+ MPM.add(createPruneEHPass());
+ MPM.add(createSampleProfileLoaderPass(PGOSampleUse));
+ }
+
// Allow forcing function attributes as a debugging and tuning aid.
MPM.add(createForceFunctionAttrsLegacyPass());