Please use GitHub pull requests for new patches. Avoid migrating existing patches. Phabricator shutdown timeline
Changeset View
Changeset View
Standalone View
Standalone View
llvm/lib/Passes/PassBuilderPipelines.cpp
Show First 20 Lines • Show All 748 Lines • ▼ Show 20 Lines | PassBuilder::buildInlinerPipeline(OptimizationLevel Level, | ||||
if (EnableNoRerunSimplificationPipeline) | if (EnableNoRerunSimplificationPipeline) | ||||
MIWP.addLateModulePass(createModuleToFunctionPassAdaptor( | MIWP.addLateModulePass(createModuleToFunctionPassAdaptor( | ||||
InvalidateAnalysisPass<ShouldNotRunFunctionPassesAnalysis>())); | InvalidateAnalysisPass<ShouldNotRunFunctionPassesAnalysis>())); | ||||
return MIWP; | return MIWP; | ||||
} | } | ||||
ModuleInlinerPass | ModulePassManager | ||||
PassBuilder::buildModuleInlinerPipeline(OptimizationLevel Level, | PassBuilder::buildModuleInlinerPipeline(OptimizationLevel Level, | ||||
ThinOrFullLTOPhase Phase) { | ThinOrFullLTOPhase Phase) { | ||||
ModulePassManager MPM; | |||||
InlineParams IP = getInlineParamsFromOptLevel(Level); | InlineParams IP = getInlineParamsFromOptLevel(Level); | ||||
if (Phase == ThinOrFullLTOPhase::ThinLTOPreLink && PGOOpt && | if (Phase == ThinOrFullLTOPhase::ThinLTOPreLink && PGOOpt && | ||||
PGOOpt->Action == PGOOptions::SampleUse) | PGOOpt->Action == PGOOptions::SampleUse) | ||||
IP.HotCallSiteThreshold = 0; | IP.HotCallSiteThreshold = 0; | ||||
if (PGOOpt) | if (PGOOpt) | ||||
IP.EnableDeferral = EnablePGOInlineDeferral; | IP.EnableDeferral = EnablePGOInlineDeferral; | ||||
// The inline deferral logic is used to avoid losing some | // The inline deferral logic is used to avoid losing some | ||||
// inlining chance in future. It is helpful in SCC inliner, in which | // inlining chance in future. It is helpful in SCC inliner, in which | ||||
// inlining is processed in bottom-up order. | // inlining is processed in bottom-up order. | ||||
// While in module inliner, the inlining order is a priority-based order | // While in module inliner, the inlining order is a priority-based order | ||||
// by default. The inline deferral is unnecessary there. So we disable the | // by default. The inline deferral is unnecessary there. So we disable the | ||||
// inline deferral logic in module inliner. | // inline deferral logic in module inliner. | ||||
IP.EnableDeferral = false; | IP.EnableDeferral = false; | ||||
return ModuleInlinerPass(IP, UseInlineAdvisor); | MPM.addPass(ModuleInlinerPass(IP, UseInlineAdvisor)); | ||||
MPM.addPass(createModuleToFunctionPassAdaptor( | |||||
buildFunctionSimplificationPipeline(Level, Phase), | |||||
PTO.EagerlyInvalidateAnalyses)); | |||||
MPM.addPass(createModuleToPostOrderCGSCCPassAdaptor( | |||||
CoroSplitPass(Level != OptimizationLevel::O0))); | |||||
return MPM; | |||||
} | } | ||||
ModulePassManager | ModulePassManager | ||||
PassBuilder::buildModuleSimplificationPipeline(OptimizationLevel Level, | PassBuilder::buildModuleSimplificationPipeline(OptimizationLevel Level, | ||||
ThinOrFullLTOPhase Phase) { | ThinOrFullLTOPhase Phase) { | ||||
ModulePassManager MPM; | ModulePassManager MPM; | ||||
// Place pseudo probe instrumentation as the first pass of the pipeline to | // Place pseudo probe instrumentation as the first pass of the pipeline to | ||||
▲ Show 20 Lines • Show All 1,016 Lines • Show Last 20 Lines |