159 cl::desc(
"Enable ML policy for inliner. Currently trained for -Oz only"),
161 "Heuristics-based inliner version"),
163 "Use development mode (runtime-loadable model)"),
165 "Use release mode (AOT-compiled model)")));
171 cl::desc(
"Enable inline deferral during PGO"));
179 cl::desc(
"Perform mandatory inlinings module-wide, before performing "
184 cl::desc(
"Eagerly invalidate more analyses in default pipelines"));
188 cl::desc(
"Enable function merging as part of the optimization pipeline"));
192 cl::desc(
"Run the loop rotation transformation after PGO instrumentation"));
196 cl::desc(
"Enable inter-procedural analyses"));
200 cl::desc(
"Run Partial inlining pass"));
204 cl::desc(
"Run cleanup optimization passes after vectorization"));
211 cl::desc(
"Enable the LoopInterchange Pass"));
215 cl::desc(
"Enable Unroll And Jam Pass"));
219 cl::desc(
"Enable the LoopFlatten Pass"));
228 cl::desc(
"Enable loop header duplication at any optimization level"));
232 cl::desc(
"Enable DFA jump threading"),
237 cl::desc(
"Enable hot-cold splitting pass"));
241 cl::desc(
"Enable ir outliner pass"));
245 cl::desc(
"Disable pre-instrumentation inliner"));
249 cl::desc(
"Control the amount of inlining in pre-instrumentation inliner "
254 cl::desc(
"Enable the GVN hoisting pass (default = off)"));
258 cl::desc(
"Enable the GVN sinking pass (default = off)"));
261 "enable-jump-table-to-switch",
262 cl::desc(
"Enable JumpTableToSwitch pass (default = off)"));
268 cl::desc(
"Enable control height reduction optimization (CHR)"));
272 cl::desc(
"Indicate the sample profile being used is flattened, i.e., "
273 "no inline hierarchy exists in the profile"));
277 cl::desc(
"Enable lowering of the matrix intrinsics"));
282 "Enable pass to eliminate conditions based on linear constraints"));
286 cl::desc(
"Enable the attributor inter-procedural deduction pass"),
288 "enable all attributor runs"),
290 "enable module-wide attributor runs"),
292 "enable call graph SCC attributor runs"),
294 "disable attributor runs")));
298 cl::desc(
"Enable profile instrumentation sampling (default = off)"));
301 cl::desc(
"Enable the experimental Loop Versioning LICM pass"));
304 "instrument-cold-function-only-path",
cl::init(
""),
305 cl::desc(
"File path for cold function only instrumentation(requires use "
306 "with --pgo-instrument-cold-function-only)"),
312 "enable-devirtualize-speculatively",
313 cl::desc(
"Enable speculative devirtualization optimization"),
346 for (
auto &
C : PeepholeEPCallbacks)
351 for (
auto &
C : LateLoopOptimizationsEPCallbacks)
356 for (
auto &
C : LoopOptimizerEndEPCallbacks)
361 for (
auto &
C : ScalarOptimizerLateEPCallbacks)
366 for (
auto &
C : CGSCCOptimizerLateEPCallbacks)
371 for (
auto &
C : VectorizerStartEPCallbacks)
376 for (
auto &
C : VectorizerEndEPCallbacks)
382 for (
auto &
C : OptimizerEarlyEPCallbacks)
388 for (
auto &
C : OptimizerLastEPCallbacks)
393 for (
auto &
C : FullLinkTimeOptimizationEarlyEPCallbacks)
398 for (
auto &
C : FullLinkTimeOptimizationLastEPCallbacks)
403 for (
auto &
C : PipelineStartEPCallbacks)
408 for (
auto &
C : PipelineEarlySimplificationEPCallbacks)
453 FPM.
addPass(CountVisitsPass());
460 FPM.
addPass(EarlyCSEPass(
true ));
464 SimplifyCFGPass(SimplifyCFGOptions().convertSwitchRangeToICmp(
true)));
465 FPM.
addPass(InstCombinePass());
467 FPM.
addPass(LibCallsShrinkWrapPass());
472 SimplifyCFGPass(SimplifyCFGOptions().convertSwitchRangeToICmp(
true)));
477 FPM.
addPass(ReassociatePass());
493 LPM1.addPass(LoopInstSimplifyPass());
494 LPM1.addPass(LoopSimplifyCFGPass());
502 LPM1.addPass(LICMPass(PTO.LicmMssaOptCap, PTO.LicmMssaNoAccForPromotionCap,
505 LPM1.addPass(LoopRotatePass(
true,
508 LPM1.addPass(LICMPass(PTO.LicmMssaOptCap, PTO.LicmMssaNoAccForPromotionCap,
510 LPM1.addPass(SimpleLoopUnswitchPass());
512 LPM1.addPass(LoopFlattenPass());
514 LPM2.addPass(LoopIdiomRecognizePass());
515 LPM2.addPass(IndVarSimplifyPass());
519 LPM2.addPass(LoopDeletionPass());
528 LPM2.addPass(LoopFullUnrollPass(
Level.getSpeedupLevel(),
530 PTO.ForgetAllSCEVInLoopUnroll));
537 SimplifyCFGPass(SimplifyCFGOptions().convertSwitchRangeToICmp(
true)));
538 FPM.
addPass(InstCombinePass());
562 FPM.
addPass(InstCombinePass());
574 SimplifyCFGPass(SimplifyCFGOptions().convertSwitchRangeToICmp(
true)));
575 FPM.
addPass(InstCombinePass());
588 if (Level.getSpeedupLevel() == 1)
589 return buildO1FunctionSimplificationPipeline(Level,
Phase);
634 if (!Level.isOptimizingForSize())
642 !Level.isOptimizingForSize())
646 isInstrumentedPGOUse()));
681 LPM1.addPass(
LICMPass(PTO.LicmMssaOptCap, PTO.LicmMssaNoAccForPromotionCap,
689 LPM1.addPass(
LICMPass(PTO.LicmMssaOptCap, PTO.LicmMssaNoAccForPromotionCap,
703 LPM2.addPass(std::move(ExtraPasses));
719 PTO.ForgetAllSCEVInLoopUnroll));
783 LICMPass(PTO.LicmMssaOptCap, PTO.LicmMssaNoAccForPromotionCap,
792 .convertSwitchRangeToICmp(
true)
793 .convertSwitchToArithmetic(
true)
794 .hoistCommonInsts(
true)
795 .sinkCommonInsts(
true)));
830 FPM.
addPass(SimplifyCFGPass(SimplifyCFGOptions().convertSwitchRangeToICmp(
832 FPM.
addPass(InstCombinePass());
836 std::move(FPM), PTO.EagerlyInvalidateAnalyses));
855 PTO.EagerlyInvalidateAnalyses));
861 bool IsCS,
bool AtomicCounterUpdate,
862 std::string ProfileFile,
863 std::string ProfileRemappingFile) {
866 if (!RunProfileGen) {
867 assert(!ProfileFile.empty() &&
"Profile use expecting a profile file!");
869 PGOInstrumentationUse(ProfileFile, ProfileRemappingFile, IsCS, FS));
872 MPM.
addPass(RequireAnalysisPass<ProfileSummaryAnalysis, Module>());
880 addPostPGOLoopRotation(MPM, Level);
883 if (!ProfileFile.empty())
884 Options.InstrProfileOutput = ProfileFile;
886 Options.DoCounterPromotion =
true;
887 Options.UseBFIInPromotion = IsCS;
892 Options.DoCounterPromotion =
false;
894 Options.Atomic = AtomicCounterUpdate;
899 bool RunProfileGen,
bool IsCS,
900 bool AtomicCounterUpdate,
901 std::string ProfileFile,
902 std::string ProfileRemappingFile) {
903 if (!RunProfileGen) {
904 assert(!ProfileFile.empty() &&
"Profile use expecting a profile file!");
918 if (!ProfileFile.empty())
919 Options.InstrProfileOutput = ProfileFile;
921 Options.DoCounterPromotion =
false;
922 Options.UseBFIInPromotion = IsCS;
923 Options.Atomic = AtomicCounterUpdate;
935 if (PTO.InlinerThreshold == -1)
1006 PTO.EagerlyInvalidateAnalyses,
true));
1066 PTO.EagerlyInvalidateAnalyses));
1082 "Should not be used for O0 pipeline");
1085 "FullLTOPostLink shouldn't call buildModuleSimplificationPipeline!");
1091 if (PGOOpt && PGOOpt->PseudoProbeForProfiling &&
1100 bool LoadSampleProfile =
1142 std::move(EarlyFPM), PTO.EagerlyInvalidateAnalyses));
1145 if (LoadSampleProfile) {
1149 PGOOpt->ProfileFile, PGOOpt->ProfileRemappingFile,
Phase, FS));
1207 PTO.EagerlyInvalidateAnalyses));
1212 const bool IsCtxProfGen =
1214 const bool IsPGOPreLink = !IsCtxProfGen && PGOOpt && IsPreLink;
1215 const bool IsPGOInstrGen =
1217 const bool IsPGOInstrUse =
1219 const bool IsMemprofUse = IsPGOPreLink && !PGOOpt->MemoryProfile.empty();
1223 "Enabling both instrumented PGO and contextual instrumentation is not "
1225 const bool IsCtxProfUse =
1230 "--instrument-cold-function-only-path is provided but "
1231 "--pgo-instrument-cold-function-only is not enabled");
1236 if (IsPGOInstrGen || IsPGOInstrUse || IsMemprofUse || IsCtxProfGen ||
1237 IsCtxProfUse || IsColdFuncOnlyInstrGen)
1238 addPreInlinerPasses(MPM, Level,
Phase);
1241 if (IsPGOInstrGen || IsPGOInstrUse) {
1242 addPGOInstrPasses(MPM, Level,
1244 false, PGOOpt->AtomicCounterUpdate,
1245 PGOOpt->ProfileFile, PGOOpt->ProfileRemappingFile);
1246 }
else if (IsCtxProfGen || IsCtxProfUse) {
1265 addPostPGOLoopRotation(MPM, Level);
1267 }
else if (IsColdFuncOnlyInstrGen) {
1268 addPGOInstrPasses(MPM, Level,
true,
false,
1274 if (IsPGOInstrGen || IsPGOInstrUse || IsCtxProfGen)
1358 FPM.
addPass(InstCombinePass());
1361 ExtraFunctionPassManager<ShouldRunExtraVectorPasses> ExtraPasses;
1368 ExtraPasses.
addPass(EarlyCSEPass());
1369 ExtraPasses.
addPass(CorrelatedValuePropagationPass());
1370 ExtraPasses.
addPass(InstCombinePass());
1372 LPM.addPass(LICMPass(PTO.LicmMssaOptCap, PTO.LicmMssaNoAccForPromotionCap,
1374 LPM.addPass(SimpleLoopUnswitchPass( Level ==
1379 SimplifyCFGPass(SimplifyCFGOptions().convertSwitchRangeToICmp(
true)));
1380 ExtraPasses.
addPass(InstCombinePass());
1381 FPM.
addPass(std::move(ExtraPasses));
1393 FPM.
addPass(SimplifyCFGPass(SimplifyCFGOptions()
1394 .forwardSwitchCondToPhi(
true)
1395 .convertSwitchRangeToICmp(
true)
1396 .convertSwitchToArithmetic(
true)
1397 .convertSwitchToLookupTable(
true)
1398 .needCanonicalLoops(
false)
1399 .hoistCommonInsts(
true)
1400 .sinkCommonInsts(
true)));
1404 FPM.
addPass(InstCombinePass());
1409 if (PTO.SLPVectorization) {
1410 FPM.
addPass(SLPVectorizerPass());
1416 FPM.
addPass(VectorCombinePass());
1419 FPM.
addPass(InstCombinePass());
1429 LoopUnrollAndJamPass(
Level.getSpeedupLevel())));
1431 FPM.
addPass(LoopUnrollPass(LoopUnrollOptions(
1432 Level.getSpeedupLevel(), !PTO.LoopUnrolling,
1433 PTO.ForgetAllSCEVInLoopUnroll)));
1434 FPM.
addPass(WarnMissedTransformationsPass());
1444 FPM.
addPass(InferAlignmentPass());
1445 FPM.
addPass(InstCombinePass());
1454 LICMPass(PTO.LicmMssaOptCap, PTO.LicmMssaNoAccForPromotionCap,
1460 FPM.
addPass(AlignmentFromAssumptionsPass());
1495 if (!LTOPreLink && PGOOpt) {
1497 addPGOInstrPasses(MPM, Level,
true,
1498 true, PGOOpt->AtomicCounterUpdate,
1499 PGOOpt->CSProfileGenFile, PGOOpt->ProfileRemappingFile);
1501 addPGOInstrPasses(MPM, Level,
false,
1502 true, PGOOpt->AtomicCounterUpdate,
1503 PGOOpt->ProfileFile, PGOOpt->ProfileRemappingFile);
1536 LICMPass(PTO.LicmMssaOptCap, PTO.LicmMssaNoAccForPromotionCap,
1575 if (PTO.LoopInterchange)
1596 addVectorPasses(Level, OptimizePM, LTOPhase);
1622 .convertSwitchRangeToICmp(
true)
1623 .convertSwitchToArithmetic(
true)
1624 .speculateUnpredictables(
true)
1625 .hoistLoadsStoresWithCondFaulting(
true)));
1629 PTO.EagerlyInvalidateAnalyses));
1660 if (PTO.MergeFunctions)
1663 if (PTO.CallGraphProfile && !LTOPreLink)
1678 PTO.DevirtualizeSpeculatively));
1725 if (PGOOpt && PGOOpt->DebugInfoForProfiling)
1737 if (PGOOpt && PGOOpt->PseudoProbeForProfiling &&
1745 addRequiredLTOPreLinkPasses(MPM);
1811 if (PGOOpt && PGOOpt->DebugInfoForProfiling)
1826 addRequiredLTOPreLinkPasses(MPM);
1840 if (PGOOpt && PGOOpt->PseudoProbeForProfiling &&
1855 addRequiredLTOPreLinkPasses(MPM);
1870 if (ImportSummary) {
1983 PGOOpt->ProfileRemappingFile,
2001 if (Level.getSpeedupLevel() > 1) {
2093 if (Level.getSpeedupLevel() > 1)
2098 PTO.EagerlyInvalidateAnalyses));
2159 addPGOInstrPasses(MPM, Level,
true,
2160 true, PGOOpt->AtomicCounterUpdate,
2161 PGOOpt->CSProfileGenFile, PGOOpt->ProfileRemappingFile);
2163 addPGOInstrPasses(MPM, Level,
false,
2164 true, PGOOpt->AtomicCounterUpdate,
2165 PGOOpt->ProfileFile, PGOOpt->ProfileRemappingFile);
2178 PTO.EagerlyInvalidateAnalyses));
2195 LICMPass(PTO.LicmMssaOptCap, PTO.LicmMssaNoAccForPromotionCap,
2224 PTO.ForgetAllSCEVInLoopUnroll));
2243 PTO.EagerlyInvalidateAnalyses));
2275 .convertSwitchRangeToICmp(
true)
2276 .convertSwitchToArithmetic(
true)
2277 .hoistCommonInsts(
true)
2278 .speculateUnpredictables(
true)));
2287 if (PTO.MergeFunctions)
2292 if (PTO.CallGraphProfile)
2313 "buildO0DefaultPipeline should only be used with O0");
2321 if (PGOOpt && PGOOpt->PseudoProbeForProfiling)
2329 false, PGOOpt->AtomicCounterUpdate, PGOOpt->ProfileFile,
2330 PGOOpt->ProfileRemappingFile);
2338 if (PGOOpt && PGOOpt->DebugInfoForProfiling)
2345 PGOOpt->ProfileRemappingFile,
2363 if (PTO.MergeFunctions)
2370 if (!CGSCCOptimizerLateEPCallbacks.empty()) {
2376 if (!LateLoopOptimizationsEPCallbacks.empty()) {
2379 if (!LPM.isEmpty()) {
2384 if (!LoopOptimizerEndEPCallbacks.empty()) {
2387 if (!LPM.isEmpty()) {
2392 if (!ScalarOptimizerLateEPCallbacks.empty()) {
2401 if (!VectorizerStartEPCallbacks.empty()) {
2408 if (!VectorizerEndEPCallbacks.empty()) {
2425 addRequiredLTOPreLinkPasses(MPM);
2441 TM->registerEarlyDefaultAliasAnalyses(
AA);
2462 TM->registerDefaultAliasAnalyses(
AA);
2467bool PassBuilder::isInstrumentedPGOUse()
const {
aarch64 falkor hwpf fix Falkor HW Prefetch Fix Late Phase
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
AggressiveInstCombiner - Combine expression patterns to form expressions with fewer,...
Provides passes to inlining "always_inline" functions.
This is the interface for LLVM's primary stateless and local alias analysis.
This file provides the interface for LLVM's Call Graph Profile pass.
This header provides classes for managing passes over SCCs of the call graph.
#define clEnumValN(ENUMVAL, FLAGNAME, DESC)
This file provides the interface for a simple, fast CSE pass.
This file provides a pass which clones the current module and runs the provided pass pipeline on the ...
Super simple passes to force specific function attrs from the commandline into the IR for debugging p...
Provides passes for computing function attributes based on interprocedural analyses.
This file provides the interface for LLVM's Global Value Numbering pass which eliminates fully redund...
This is the interface for a simple mod/ref and alias analysis over globals.
AcceleratorCodeSelection - Identify all functions reachable from a kernel, removing those that are un...
This header defines various interfaces for pass management in LLVM.
Interfaces for passes which infer implicit function attributes from the name and signature of functio...
This file provides the primary interface to the instcombine pass.
Defines passes for running instruction simplification across chunks of IR.
This file provides the interface for LLVM's PGO Instrumentation lowering pass.
See the comments on JumpThreadingPass.
This file implements the Loop Fusion pass.
This header defines the LoopLoadEliminationPass object.
This header provides classes for managing a pipeline of passes over loops in LLVM IR.
The header file for the LowerConstantIntrinsics pass as used by the new pass manager.
The header file for the LowerExpectIntrinsic pass as used by the new pass manager.
This pass performs merges of loads and stores on both sides of a.
This file provides the interface for LLVM's Global Value Numbering pass.
This header enumerates the LLVM-provided high-level optimization levels.
This file provides the interface for IR based instrumentation passes ( (profile-gen,...
Define option tunables for PGO.
static void addAnnotationRemarksPass(ModulePassManager &MPM)
static InlineParams getInlineParamsFromOptLevel(OptimizationLevel Level)
static CoroConditionalWrapper buildCoroWrapper(ThinOrFullLTOPhase Phase)
static bool isLTOPreLink(ThinOrFullLTOPhase Phase)
static bool isLTOPostLink(ThinOrFullLTOPhase Phase)
This file implements relative lookup table converter that converts lookup tables to relative lookup t...
This file provides the interface for LLVM's Scalar Replacement of Aggregates pass.
This file provides the interface for the pseudo probe implementation for AutoFDO.
This file provides the interface for the sampled PGO loader pass.
This is the interface for a metadata-based scoped no-alias analysis.
This file provides the interface for the pass responsible for both simplifying and canonicalizing the...
This file defines the 'Statistic' class, which is designed to be an easy way to expose various metric...
This is the interface for a metadata-based TBAA.
Defines the virtual file system interface vfs::FileSystem.
A manager for alias analyses.
A module pass that rewrites heap allocations to use token-enabled allocation functions based on vario...
Inlines functions marked as "always_inline".
Assign a GUID to functions as metadata.
Analysis pass providing a never-invalidated alias analysis result.
Simple pass that canonicalizes aliases.
A pass that merges duplicate global constants into a single constant.
This class implements a trivial dead store elimination.
Eliminate dead arguments (and return values) from functions.
A pass that transforms external global definitions into declarations.
Pass embeds a copy of the module optimized with the provided pass pipeline into a global variable.
The core GVN pass object.
Pass to remove unused function declarations.
Optimize globals that never have their address taken.
Pass to perform split of global variables.
Analysis pass providing a never-invalidated alias analysis result.
Pass to outline cold regions.
Pass to perform interprocedural constant propagation.
Pass to outline similar regions.
Run instruction simplification across each instruction in the function.
Instrumentation based profiling lowering pass.
This pass performs 'jump threading', which looks at blocks that have multiple predecessors and multip...
Performs Loop Invariant Code Motion Pass.
Loop unroll pass that only does full loop unrolling and peeling.
Performs Loop Idiom Recognize Pass.
Performs Loop Inst Simplify Pass.
A simple loop rotation transformation.
Performs basic CFG simplifications to assist other loop passes.
A pass that does profile-guided sinking of instructions into loops.
A simple loop rotation transformation.
Loop unroll pass that will support both full and partial unrolling.
Strips MemProf attributes and metadata.
Merge identical functions.
The module inliner pass for the new pass manager.
Module pass, wrapping the inliner pass.
void addModulePass(T Pass)
Add a module pass that runs before the CGSCC passes.
Class to hold module path string table and global value map, and encapsulate methods for operating on...
bool withSupportsHotColdNew() const
Simple pass that provides a name to every anonymous globals.
Additional 'norecurse' attribute deduction during postlink LTO phase.
OpenMP optimizations pass.
static LLVM_ABI const OptimizationLevel O3
Optimize for fast execution as much as possible.
static LLVM_ABI const OptimizationLevel Oz
A very specialized mode that will optimize for code size at any and all costs.
static LLVM_ABI const OptimizationLevel O0
Disable as many optimizations as possible.
static LLVM_ABI const OptimizationLevel Os
Similar to O2 but tries to optimize for small code size instead of fast execution without triggering ...
static LLVM_ABI const OptimizationLevel O2
Optimize for fast execution as much as possible without triggering significant incremental compile ti...
static LLVM_ABI const OptimizationLevel O1
Optimize quickly without destroying debuggability.
static bool isCtxIRPGOInstrEnabled()
The instrumentation (profile-instr-gen) pass for IR based PGO.
The instrumentation (profile-instr-gen) pass for IR based PGO.
The profile annotation (profile-instr-use) pass for IR based PGO.
The profile size based optimization pass for memory intrinsics.
Pass to remove unused function declarations.
LLVM_ABI void invokeFullLinkTimeOptimizationLastEPCallbacks(ModulePassManager &MPM, OptimizationLevel Level)
LLVM_ABI ModuleInlinerWrapperPass buildInlinerPipeline(OptimizationLevel Level, ThinOrFullLTOPhase Phase)
Construct the module pipeline that performs inlining as well as the inlining-driven cleanups.
LLVM_ABI void invokeOptimizerEarlyEPCallbacks(ModulePassManager &MPM, OptimizationLevel Level, ThinOrFullLTOPhase Phase)
LLVM_ABI void invokeVectorizerStartEPCallbacks(FunctionPassManager &FPM, OptimizationLevel Level)
LLVM_ABI AAManager buildDefaultAAPipeline()
Build the default AAManager with the default alias analysis pipeline registered.
LLVM_ABI void invokeCGSCCOptimizerLateEPCallbacks(CGSCCPassManager &CGPM, OptimizationLevel Level)
LLVM_ABI ModulePassManager buildThinLTOPreLinkDefaultPipeline(OptimizationLevel Level)
Build a pre-link, ThinLTO-targeting default optimization pipeline to a pass manager.
LLVM_ABI void addPGOInstrPassesForO0(ModulePassManager &MPM, bool RunProfileGen, bool IsCS, bool AtomicCounterUpdate, std::string ProfileFile, std::string ProfileRemappingFile)
Add PGOInstrumenation passes for O0 only.
LLVM_ABI void invokeScalarOptimizerLateEPCallbacks(FunctionPassManager &FPM, OptimizationLevel Level)
LLVM_ABI ModulePassManager buildPerModuleDefaultPipeline(OptimizationLevel Level, ThinOrFullLTOPhase Phase=ThinOrFullLTOPhase::None)
Build a per-module default optimization pipeline.
LLVM_ABI void invokePipelineStartEPCallbacks(ModulePassManager &MPM, OptimizationLevel Level)
LLVM_ABI void invokeVectorizerEndEPCallbacks(FunctionPassManager &FPM, OptimizationLevel Level)
LLVM_ABI ModulePassManager buildO0DefaultPipeline(OptimizationLevel Level, ThinOrFullLTOPhase Phase=ThinOrFullLTOPhase::None)
Build an O0 pipeline with the minimal semantically required passes.
LLVM_ABI FunctionPassManager buildFunctionSimplificationPipeline(OptimizationLevel Level, ThinOrFullLTOPhase Phase)
Construct the core LLVM function canonicalization and simplification pipeline.
LLVM_ABI void invokePeepholeEPCallbacks(FunctionPassManager &FPM, OptimizationLevel Level)
LLVM_ABI void invokePipelineEarlySimplificationEPCallbacks(ModulePassManager &MPM, OptimizationLevel Level, ThinOrFullLTOPhase Phase)
LLVM_ABI void invokeLoopOptimizerEndEPCallbacks(LoopPassManager &LPM, OptimizationLevel Level)
LLVM_ABI ModulePassManager buildLTODefaultPipeline(OptimizationLevel Level, ModuleSummaryIndex *ExportSummary)
Build an LTO default optimization pipeline to a pass manager.
LLVM_ABI ModulePassManager buildModuleInlinerPipeline(OptimizationLevel Level, ThinOrFullLTOPhase Phase)
Construct the module pipeline that performs inlining with module inliner pass.
LLVM_ABI ModulePassManager buildThinLTODefaultPipeline(OptimizationLevel Level, const ModuleSummaryIndex *ImportSummary)
Build a ThinLTO default optimization pipeline to a pass manager.
LLVM_ABI void invokeLateLoopOptimizationsEPCallbacks(LoopPassManager &LPM, OptimizationLevel Level)
LLVM_ABI void invokeFullLinkTimeOptimizationEarlyEPCallbacks(ModulePassManager &MPM, OptimizationLevel Level)
LLVM_ABI ModulePassManager buildFatLTODefaultPipeline(OptimizationLevel Level, bool ThinLTO, bool EmitSummary)
Build a fat object default optimization pipeline.
LLVM_ABI ModulePassManager buildModuleSimplificationPipeline(OptimizationLevel Level, ThinOrFullLTOPhase Phase)
Construct the core LLVM module canonicalization and simplification pipeline.
LLVM_ABI ModulePassManager buildModuleOptimizationPipeline(OptimizationLevel Level, ThinOrFullLTOPhase LTOPhase)
Construct the core LLVM module optimization pipeline.
LLVM_ABI void invokeOptimizerLastEPCallbacks(ModulePassManager &MPM, OptimizationLevel Level, ThinOrFullLTOPhase Phase)
LLVM_ABI ModulePassManager buildLTOPreLinkDefaultPipeline(OptimizationLevel Level)
Build a pre-link, LTO-targeting default optimization pipeline to a pass manager.
LLVM_ATTRIBUTE_MINSIZE std::enable_if_t<!std::is_same_v< PassT, PassManager > > addPass(PassT &&Pass)
bool isEmpty() const
Returns if the pass manager contains any passes.
unsigned LicmMssaNoAccForPromotionCap
Tuning option to disable promotion to scalars in LICM with MemorySSA, if the number of access is too ...
bool SLPVectorization
Tuning option to enable/disable slp loop vectorization, set based on opt level.
bool DevirtualizeSpeculatively
int InlinerThreshold
Tuning option to override the default inliner threshold.
bool LoopFusion
Tuning option to enable/disable loop fusion. Its default value is false.
bool EagerlyInvalidateAnalyses
bool CallGraphProfile
Tuning option to enable/disable call graph profile.
bool MergeFunctions
Tuning option to enable/disable function merging.
bool ForgetAllSCEVInLoopUnroll
Tuning option to forget all SCEV loops in LoopUnroll.
unsigned LicmMssaOptCap
Tuning option to cap the number of calls to retrive clobbering accesses in MemorySSA,...
bool LoopInterleaving
Tuning option to set loop interleaving on/off, set based on opt level.
LLVM_ABI PipelineTuningOptions()
Constructor sets pipeline tuning defaults based on cl::opts.
bool LoopUnrolling
Tuning option to enable/disable loop unrolling. Its default value is true.
bool LoopInterchange
Tuning option to enable/disable loop interchange.
bool LoopVectorization
Tuning option to enable/disable loop vectorization, set based on opt level.
Reassociate commutative expressions.
A pass to do RPO deduction and propagation of function attributes.
This pass performs function-level constant propagation and merging.
The sample profiler data loader pass.
Analysis pass providing a never-invalidated alias analysis result.
This pass transforms loops that contain branches or switches on loop- invariant conditions to have mu...
A pass to simplify and canonicalize the CFG of a function.
Analysis pass providing a never-invalidated alias analysis result.
Optimize scalar/vector interactions in IR using target cost models.
Interfaces for registering analysis passes, producing common pass manager configurations,...
Abstract Attribute helper functions.
@ C
The default llvm calling convention, compatible with C.
ValuesClass values(OptsTy... Options)
Helper to build a ValuesClass by forwarding a variable number of arguments as an initializer list to ...
initializer< Ty > init(const Ty &Val)
@ Assume
Do not drop type tests (default).
@ All
Drop only llvm.assumes using type test value.
This is an optimization pass for GlobalISel generic memory operations.
LLVM_ABI cl::opt< bool > EnableKnowledgeRetention
static cl::opt< bool > RunNewGVN("enable-newgvn", cl::init(false), cl::Hidden, cl::desc("Run the NewGVN pass"))
static cl::opt< bool > DisablePreInliner("disable-preinline", cl::init(false), cl::Hidden, cl::desc("Disable pre-instrumentation inliner"))
static cl::opt< bool > EnableJumpTableToSwitch("enable-jump-table-to-switch", cl::desc("Enable JumpTableToSwitch pass (default = off)"))
static cl::opt< bool > PerformMandatoryInliningsFirst("mandatory-inlining-first", cl::init(false), cl::Hidden, cl::desc("Perform mandatory inlinings module-wide, before performing " "inlining"))
static cl::opt< bool > RunPartialInlining("enable-partial-inlining", cl::init(false), cl::Hidden, cl::desc("Run Partial inlining pass"))
static cl::opt< bool > EnableGVNSink("enable-gvn-sink", cl::desc("Enable the GVN sinking pass (default = off)"))
static cl::opt< bool > EnableLoopHeaderDuplication("enable-loop-header-duplication", cl::init(false), cl::Hidden, cl::desc("Enable loop header duplication at any optimization level"))
static cl::opt< bool > EnableModuleInliner("enable-module-inliner", cl::init(false), cl::Hidden, cl::desc("Enable module inliner"))
static cl::opt< bool > EnableEagerlyInvalidateAnalyses("eagerly-invalidate-analyses", cl::init(true), cl::Hidden, cl::desc("Eagerly invalidate more analyses in default pipelines"))
static cl::opt< bool > EnableMatrix("enable-matrix", cl::init(false), cl::Hidden, cl::desc("Enable lowering of the matrix intrinsics"))
ModuleToFunctionPassAdaptor createModuleToFunctionPassAdaptor(FunctionPassT &&Pass, bool EagerlyInvalidate=false)
A function to deduce a function pass type and wrap it in the templated adaptor.
cl::opt< std::string > UseCtxProfile("use-ctx-profile", cl::init(""), cl::Hidden, cl::desc("Use the specified contextual profile file"))
static cl::opt< bool > EnableSampledInstr("enable-sampled-instrumentation", cl::init(false), cl::Hidden, cl::desc("Enable profile instrumentation sampling (default = off)"))
static cl::opt< bool > EnableLoopFlatten("enable-loop-flatten", cl::init(false), cl::Hidden, cl::desc("Enable the LoopFlatten Pass"))
static cl::opt< InliningAdvisorMode > UseInlineAdvisor("enable-ml-inliner", cl::init(InliningAdvisorMode::Default), cl::Hidden, cl::desc("Enable ML policy for inliner. Currently trained for -Oz only"), cl::values(clEnumValN(InliningAdvisorMode::Default, "default", "Heuristics-based inliner version"), clEnumValN(InliningAdvisorMode::Development, "development", "Use development mode (runtime-loadable model)"), clEnumValN(InliningAdvisorMode::Release, "release", "Use release mode (AOT-compiled model)")))
PassManager< LazyCallGraph::SCC, CGSCCAnalysisManager, LazyCallGraph &, CGSCCUpdateResult & > CGSCCPassManager
The CGSCC pass manager.
static cl::opt< bool > EnableUnrollAndJam("enable-unroll-and-jam", cl::init(false), cl::Hidden, cl::desc("Enable Unroll And Jam Pass"))
ThinOrFullLTOPhase
This enumerates the LLVM full LTO or ThinLTO optimization phases.
@ FullLTOPreLink
Full LTO prelink phase.
@ ThinLTOPostLink
ThinLTO postlink (backend compile) phase.
@ None
No LTO/ThinLTO behavior needed.
@ FullLTOPostLink
Full LTO postlink (backend compile) phase.
@ ThinLTOPreLink
ThinLTO prelink (summary) phase.
PassManager< Loop, LoopAnalysisManager, LoopStandardAnalysisResults &, LPMUpdater & > LoopPassManager
The Loop pass manager.
static cl::opt< bool > EnableConstraintElimination("enable-constraint-elimination", cl::init(true), cl::Hidden, cl::desc("Enable pass to eliminate conditions based on linear constraints"))
ModuleToPostOrderCGSCCPassAdaptor createModuleToPostOrderCGSCCPassAdaptor(CGSCCPassT &&Pass)
A function to deduce a function pass type and wrap it in the templated adaptor.
static cl::opt< bool > EnablePGOInlineDeferral("enable-npm-pgo-inline-deferral", cl::init(true), cl::Hidden, cl::desc("Enable inline deferral during PGO"))
Flag to enable inline deferral during PGO.
FunctionToLoopPassAdaptor createFunctionToLoopPassAdaptor(LoopPassT &&Pass, bool UseMemorySSA=false)
A function to deduce a loop pass type and wrap it in the templated adaptor.
CGSCCToFunctionPassAdaptor createCGSCCToFunctionPassAdaptor(FunctionPassT &&Pass, bool EagerlyInvalidate=false, bool NoRerun=false)
A function to deduce a function pass type and wrap it in the templated adaptor.
cl::opt< bool > ForgetSCEVInLoopUnroll
PassManager< Module > ModulePassManager
Convenience typedef for a pass manager over modules.
static cl::opt< bool > EnablePostPGOLoopRotation("enable-post-pgo-loop-rotation", cl::init(true), cl::Hidden, cl::desc("Run the loop rotation transformation after PGO instrumentation"))
LLVM_ABI bool AreStatisticsEnabled()
Check if statistics are enabled.
static cl::opt< std::string > InstrumentColdFuncOnlyPath("instrument-cold-function-only-path", cl::init(""), cl::desc("File path for cold function only instrumentation(requires use " "with --pgo-instrument-cold-function-only)"), cl::Hidden)
static cl::opt< bool > EnableGlobalAnalyses("enable-global-analyses", cl::init(true), cl::Hidden, cl::desc("Enable inter-procedural analyses"))
static cl::opt< bool > EnableDFAJumpThreading("enable-dfa-jump-thread", cl::desc("Enable DFA jump threading"), cl::init(false), cl::Hidden)
static cl::opt< bool > FlattenedProfileUsed("flattened-profile-used", cl::init(false), cl::Hidden, cl::desc("Indicate the sample profile being used is flattened, i.e., " "no inline hierarchy exists in the profile"))
static cl::opt< bool > ExtraVectorizerPasses("extra-vectorizer-passes", cl::init(false), cl::Hidden, cl::desc("Run cleanup optimization passes after vectorization"))
static cl::opt< bool > EnableHotColdSplit("hot-cold-split", cl::desc("Enable hot-cold splitting pass"))
cl::opt< bool > EnableMemProfContextDisambiguation
Enable MemProf context disambiguation for thin link.
PassManager< Function > FunctionPassManager
Convenience typedef for a pass manager over functions.
LLVM_ABI InlineParams getInlineParams()
Generate the parameters to tune the inline cost analysis based only on the commandline options.
cl::opt< bool > PGOInstrumentColdFunctionOnly
static cl::opt< bool > EnableLoopInterchange("enable-loopinterchange", cl::init(false), cl::Hidden, cl::desc("Enable the LoopInterchange Pass"))
static cl::opt< bool > EnableCHR("enable-chr", cl::init(true), cl::Hidden, cl::desc("Enable control height reduction optimization (CHR)"))
static cl::opt< bool > EnableMergeFunctions("enable-merge-functions", cl::init(false), cl::Hidden, cl::desc("Enable function merging as part of the optimization pipeline"))
static cl::opt< bool > EnableDevirtualizeSpeculatively("enable-devirtualize-speculatively", cl::desc("Enable speculative devirtualization optimization"), cl::init(false))
static cl::opt< bool > EnableGVNHoist("enable-gvn-hoist", cl::desc("Enable the GVN hoisting pass (default = off)"))
cl::opt< unsigned > SetLicmMssaNoAccForPromotionCap
static cl::opt< bool > EnableIROutliner("ir-outliner", cl::init(false), cl::Hidden, cl::desc("Enable ir outliner pass"))
static cl::opt< AttributorRunOption > AttributorRun("attributor-enable", cl::Hidden, cl::init(AttributorRunOption::NONE), cl::desc("Enable the attributor inter-procedural deduction pass"), cl::values(clEnumValN(AttributorRunOption::ALL, "all", "enable all attributor runs"), clEnumValN(AttributorRunOption::MODULE, "module", "enable module-wide attributor runs"), clEnumValN(AttributorRunOption::CGSCC, "cgscc", "enable call graph SCC attributor runs"), clEnumValN(AttributorRunOption::NONE, "none", "disable attributor runs")))
static cl::opt< int > PreInlineThreshold("preinline-threshold", cl::Hidden, cl::init(75), cl::desc("Control the amount of inlining in pre-instrumentation inliner " "(default = 75)"))
static cl::opt< bool > UseLoopVersioningLICM("enable-loop-versioning-licm", cl::init(false), cl::Hidden, cl::desc("Enable the experimental Loop Versioning LICM pass"))
cl::opt< unsigned > MaxDevirtIterations("max-devirt-iterations", cl::ReallyHidden, cl::init(4))
cl::opt< unsigned > SetLicmMssaOptCap
A DCE pass that assumes instructions are dead until proven otherwise.
This pass attempts to minimize the number of assume without loosing any information.
Hoist/decompose integer division and remainder instructions to enable CFG improvements and better cod...
A simple and fast domtree-based CSE pass.
Pass which forces specific function attributes into the IR, primarily as a debugging tool.
A simple and fast domtree-based GVN pass to hoist common expressions from sibling branches.
Uses an "inverted" value numbering to decide the similarity of expressions and sinks similar expressi...
A set of parameters to control various transforms performed by IPSCCP pass.
A pass which infers function attributes from the names and signatures of function declarations in a m...
Provides context on when an inline advisor is constructed in the pipeline (e.g., link phase,...
Thresholds to tune inline cost analysis.
std::optional< int > HotCallSiteThreshold
Threshold to use when the callsite is considered hot.
int DefaultThreshold
The default threshold to start with for a callee.
std::optional< bool > EnableDeferral
Indicate whether we should allow inline deferral.
std::optional< int > HintThreshold
Threshold to use for callees with inline hint.
Options for the frontend instrumentation based profiling pass.
A no-op pass template which simply forces a specific analysis result to be invalidated.
Pass to forward loads in a loop around the backedge to subsequent iterations.
A set of parameters used to control various transforms performed by the LoopUnroll pass.
Computes function attributes in post-order over the call graph.
A utility pass template to force an analysis result to be available.