diff --git a/llvm/include/llvm/InitializePasses.h b/llvm/include/llvm/InitializePasses.h index 207d90064ecc..0825de5e4abb 100644 --- a/llvm/include/llvm/InitializePasses.h +++ b/llvm/include/llvm/InitializePasses.h @@ -126,7 +126,7 @@ void initializeAAResultsWrapperPassPass(PassRegistry &); void initializeGCOVProfilerPass(PassRegistry&); void initializePGOInstrumentationGenLegacyPassPass(PassRegistry&); void initializePGOInstrumentationUseLegacyPassPass(PassRegistry&); -void initializePGOIndirectCallPromotionPass(PassRegistry&); +void initializePGOIndirectCallPromotionLegacyPassPass(PassRegistry&); void initializeInstrProfilingLegacyPassPass(PassRegistry &); void initializeAddressSanitizerPass(PassRegistry&); void initializeAddressSanitizerModulePass(PassRegistry&); diff --git a/llvm/include/llvm/LinkAllPasses.h b/llvm/include/llvm/LinkAllPasses.h index be613df400ff..72629398f00f 100644 --- a/llvm/include/llvm/LinkAllPasses.h +++ b/llvm/include/llvm/LinkAllPasses.h @@ -91,7 +91,7 @@ namespace { (void) llvm::createGCOVProfilerPass(); (void) llvm::createPGOInstrumentationGenLegacyPass(); (void) llvm::createPGOInstrumentationUseLegacyPass(); - (void) llvm::createPGOIndirectCallPromotionPass(); + (void) llvm::createPGOIndirectCallPromotionLegacyPass(); (void) llvm::createInstrProfilingLegacyPass(); (void) llvm::createFunctionImportPass(); (void) llvm::createFunctionInliningPass(); diff --git a/llvm/include/llvm/Transforms/Instrumentation.h b/llvm/include/llvm/Transforms/Instrumentation.h index 24e4247e847e..e9a4fe75fd8d 100644 --- a/llvm/include/llvm/Transforms/Instrumentation.h +++ b/llvm/include/llvm/Transforms/Instrumentation.h @@ -83,7 +83,7 @@ ModulePass *createGCOVProfilerPass(const GCOVOptions &Options = ModulePass *createPGOInstrumentationGenLegacyPass(); ModulePass * createPGOInstrumentationUseLegacyPass(StringRef Filename = StringRef("")); -ModulePass *createPGOIndirectCallPromotionPass(bool InLTO = false); +ModulePass *createPGOIndirectCallPromotionLegacyPass(bool InLTO = false); /// Options for the frontend instrumentation based profiling pass. struct InstrProfOptions { diff --git a/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp b/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp index af2426324ee1..983bae8ab1d2 100644 --- a/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp +++ b/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp @@ -371,7 +371,7 @@ void PassManagerBuilder::populateModulePassManager( /// not run it a second time addPGOInstrPasses(MPM); // Indirect call promotion that promotes intra-module targets only. - MPM.add(createPGOIndirectCallPromotionPass()); + MPM.add(createPGOIndirectCallPromotionLegacyPass()); } if (EnableNonLTOGlobalsModRef) @@ -583,7 +583,7 @@ void PassManagerBuilder::addLTOOptimizationPasses(legacy::PassManagerBase &PM) { // by the earlier promotion pass that promotes intra-module targets. // This two-step promotion is to save the compile time. For LTO, it should // produce the same result as if we only do promotion here. - PM.add(createPGOIndirectCallPromotionPass(true)); + PM.add(createPGOIndirectCallPromotionLegacyPass(true)); // Propagate constants at call sites into the functions they call. This // opens opportunities for globalopt (and inlining) by substituting function diff --git a/llvm/lib/Transforms/Instrumentation/IndirectCallPromotion.cpp b/llvm/lib/Transforms/Instrumentation/IndirectCallPromotion.cpp index e83e9da66ace..b71cd97ec5f3 100644 --- a/llvm/lib/Transforms/Instrumentation/IndirectCallPromotion.cpp +++ b/llvm/lib/Transforms/Instrumentation/IndirectCallPromotion.cpp @@ -111,12 +111,14 @@ static cl::opt cl::desc("Dump IR after transformation happens")); namespace { -class PGOIndirectCallPromotion : public ModulePass { +class PGOIndirectCallPromotionLegacyPass : public ModulePass { public: static char ID; - PGOIndirectCallPromotion(bool InLTO = false) : ModulePass(ID), InLTO(InLTO) { - initializePGOIndirectCallPromotionPass(*PassRegistry::getPassRegistry()); + PGOIndirectCallPromotionLegacyPass(bool InLTO = false) + : ModulePass(ID), InLTO(InLTO) { + initializePGOIndirectCallPromotionLegacyPassPass( + *PassRegistry::getPassRegistry()); } const char *getPassName() const override { @@ -132,14 +134,14 @@ private: }; } // end anonymous namespace -char PGOIndirectCallPromotion::ID = 0; -INITIALIZE_PASS(PGOIndirectCallPromotion, "pgo-icall-prom", +char PGOIndirectCallPromotionLegacyPass::ID = 0; +INITIALIZE_PASS(PGOIndirectCallPromotionLegacyPass, "pgo-icall-prom", "Use PGO instrumentation profile to promote indirect calls to " "direct calls.", false, false) -ModulePass *llvm::createPGOIndirectCallPromotionPass(bool InLTO) { - return new PGOIndirectCallPromotion(InLTO); +ModulePass *llvm::createPGOIndirectCallPromotionLegacyPass(bool InLTO) { + return new PGOIndirectCallPromotionLegacyPass(InLTO); } // The class for main data structure to promote indirect calls to conditional @@ -684,7 +686,7 @@ static bool promoteIndirectCalls(Module &M, bool InLTO) { return Changed; } -bool PGOIndirectCallPromotion::runOnModule(Module &M) { +bool PGOIndirectCallPromotionLegacyPass::runOnModule(Module &M) { // Command-line option has the priority for InLTO. InLTO |= ICPLTOMode; return promoteIndirectCalls(M, InLTO); diff --git a/llvm/lib/Transforms/Instrumentation/Instrumentation.cpp b/llvm/lib/Transforms/Instrumentation/Instrumentation.cpp index b31aaf319e76..372ec616c181 100644 --- a/llvm/lib/Transforms/Instrumentation/Instrumentation.cpp +++ b/llvm/lib/Transforms/Instrumentation/Instrumentation.cpp @@ -62,7 +62,7 @@ void llvm::initializeInstrumentation(PassRegistry &Registry) { initializeGCOVProfilerPass(Registry); initializePGOInstrumentationGenLegacyPassPass(Registry); initializePGOInstrumentationUseLegacyPassPass(Registry); - initializePGOIndirectCallPromotionPass(Registry); + initializePGOIndirectCallPromotionLegacyPassPass(Registry); initializeInstrProfilingLegacyPassPass(Registry); initializeMemorySanitizerPass(Registry); initializeThreadSanitizerPass(Registry);