forked from OSchip/llvm-project
Rename pass name to prepare to new PM porting /NFC
llvm-svn: 269586
This commit is contained in:
parent
28383a4e03
commit
72616180df
|
@ -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&);
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -111,12 +111,14 @@ static cl::opt<bool>
|
|||
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);
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue