47 cl::desc(
"Run the Loop vectorization passes"));
51 cl::desc(
"Run the SLP vectorization passes"));
55 cl::desc(
"Run the BB vectorization passes"));
60 cl::desc(
"Run GVN instead of Early CSE after vectorization passes"));
64 cl::desc(
"Run cleanup optimization passes after vectorization."));
68 cl::desc(
"Run the loop rerolling pass"));
72 cl::desc(
"Run the load combining pass"));
80 cl::desc(
"Run the SLP vectorizer (and BB vectorizer) after the Loop "
81 "vectorizer instead of before"));
87 cl::desc(
"Enable the new, experimental CFL alias analysis"),
90 "Enable unification-based CFL-AA"),
92 "Enable inclusion-based CFL-AA"),
94 "Enable both variants of CFL-AA")));
98 cl::desc(
"Enable motion of merged load and store"));
102 cl::desc(
"Enable the new, experimental LoopInterchange Pass"));
107 "Enable the GlobalsModRef AliasAnalysis outside of the LTO pipeline."));
111 cl::desc(
"Enable the LoopLoadElimination Pass"));
115 cl::desc(
"Enable preparation for ThinLTO."));
119 cl::desc(
"Enable PGO instrumentation."));
123 cl::desc(
"Specify the path of profile data file."));
127 cl::desc(
"Enable use phase of PGO instrumentation and specify the path "
128 "of profile data file"));
132 cl::desc(
"Enable the experimental Loop Versioning LICM pass"));
136 cl::desc(
"Disable pre-instrumentation inliner"));
140 cl::desc(
"Control the amount of inlining in pre-instrumentation inliner "
145 cl::desc(
"Enable the GVN hoisting pass"));
150 cl::desc(
"Disable shrink-wrap library calls"));
193 Extensions.push_back(std::make_pair(Ty, std::move(Fn)));
196 void PassManagerBuilder::addExtensionsToPM(ExtensionPointTy ETy,
201 for (
unsigned i = 0, e = Extensions.size();
i != e; ++
i)
202 if (Extensions[
i].first == ETy)
203 Extensions[
i].second(*
this, PM);
206 void PassManagerBuilder::addInitialAliasAnalysisPasses(
230 void PassManagerBuilder::addInstructionCombiningPass(
232 bool ExpensiveCombines =
OptLevel > 2;
246 addInitialAliasAnalysisPasses(FPM);
291 void PassManagerBuilder::addFunctionSimplificationPasses(
303 addInstructionCombiningPass(MPM);
316 addInstructionCombiningPass(MPM);
344 addInstructionCombiningPass(MPM);
361 addInstructionCombiningPass(MPM);
382 addInstructionCombiningPass(MPM);
399 addPGOInstrPasses(MPM);
427 addInitialAliasAnalysisPasses(MPM);
452 addInstructionCombiningPass(MPM);
460 addPGOInstrPasses(MPM);
486 addFunctionSimplificationPasses(MPM);
580 addInstructionCombiningPass(MPM);
590 addInstructionCombiningPass(MPM);
594 addInstructionCombiningPass(MPM);
607 addInstructionCombiningPass(MPM);
624 addInstructionCombiningPass(MPM);
630 addInstructionCombiningPass(MPM);
674 addInitialAliasAnalysisPasses(PM);
728 addInstructionCombiningPass(PM);
750 addInstructionCombiningPass(PM);
787 addInstructionCombiningPass(PM);
790 addInstructionCombiningPass(PM);
806 addInstructionCombiningPass(PM);
812 void PassManagerBuilder::addLateLTOOptimizationPasses(
851 addLTOOptimizationPasses(PM);
864 addLateLTOOptimizationPasses(PM);
897 unsigned SizeLevel) {
954 if (RunInliner && !Builder->
Inliner)
Super simple passes to force specific function attrs from the commandline into the IR for debugging p...
static cl::opt< bool > RunLoadCombine("combine-loads", cl::init(false), cl::Hidden, cl::desc("Run the load combining pass"))
ModulePass * createNameAnonGlobalPass()
===------------------------------------------------------------------—===//
FunctionPass * createGVNPass(bool NoLoads=false)
Create a legacy GVN pass.
Pass * createLoopRerollPass()
Thresholds to tune inline cost analysis.
ModulePass * createStripDeadPrototypesPass()
createStripDeadPrototypesPass - This pass removes any function declarations (prototypes) that are not...
ModulePass * createPGOInstrumentationGenLegacyPass()
static cl::opt< bool > UseLoopVersioningLICM("enable-loop-versioning-licm", cl::init(false), cl::Hidden, cl::desc("Enable the experimental Loop Versioning LICM pass"))
PassManagerBuilder - This class is used to set up a standard optimization sequence for languages like...
bool EnablePGOInstrGen
Enable profile instrumentation pass.
static cl::opt< bool > RunBBVectorization("vectorize-slp-aggressive", cl::Hidden, cl::desc("Run the BB vectorization passes"))
This is the interface for LLVM's inclusion-based alias analysis implemented with CFL graph reachabili...
static cl::opt< bool > RunSLPAfterLoopVectorization("run-slp-after-loop-vectorization", cl::init(true), cl::Hidden, cl::desc("Run the SLP vectorizer (and BB vectorizer) after the Loop ""vectorizer instead of before"))
This is the interface for a simple mod/ref and alias analysis over globals.
ModulePass * createMergeFunctionsPass()
createMergeFunctionsPass - This pass discovers identical functions and collapses them.
void populateThinLTOPassManager(legacy::PassManagerBase &PM)
This is the interface for a metadata-based scoped no-alias analysis.
EP_ScalarOptimizerLate - This extension point allows adding optimization passes after most of the mai...
FunctionPass * createVerifierPass(bool FatalErrors=true)
ModulePass * createIPSCCPPass()
createIPSCCPPass - This pass propagates constants from call sites into the bodies of functions...
FunctionPass * createFloat2IntPass()
virtual void add(Pass *P)=0
Add a pass to the queue of passes to run.
static cl::opt< std::string > PGOOutputFile("profile-generate-file", cl::init(""), cl::Hidden, cl::desc("Specify the path of profile data file."))
ModulePass * createEliminateAvailableExternallyPass()
This transform is designed to eliminate available external globals (functions or global variables) ...
FunctionPass * createGVNHoistPass()
static cl::opt< bool > RunPGOInstrGen("profile-generate", cl::init(false), cl::Hidden, cl::desc("Enable PGO instrumentation."))
ModulePass * createInstrProfilingLegacyPass(const InstrProfOptions &Options=InstrProfOptions())
Insert frontend instrumentation based profiling.
std::string PGOSampleUse
Path of the sample Profile data file.
ImmutablePass * createScopedNoAliasAAWrapperPass()
FunctionPass * createAlignmentFromAssumptionsPass()
Pass * Inliner
Inliner - Specifies the inliner to use.
FunctionPass * createJumpThreadingPass(int Threshold=-1)
static cl::opt< bool > RunLoopVectorization("vectorize-loops", cl::Hidden, cl::desc("Run the Loop vectorization passes"))
Attribute unwrap(LLVMAttributeRef Attr)
static void addGlobalExtension(ExtensionPointTy Ty, ExtensionFn Fn)
Adds an extension that will be used by all PassManagerBuilder instances.
Optional< int > HintThreshold
Threshold to use for callees with inline hint.
void populateLTOPassManager(legacy::PassManagerBase &PM)
ModulePass * createCrossDSOCFIPass()
This pass export CFI checks for use by external modules.
static cl::opt< bool > ExtraVectorizerPasses("extra-vectorizer-passes", cl::init(false), cl::Hidden, cl::desc("Run cleanup optimization passes after vectorization."))
FunctionPass * createReassociatePass()
Pass * createArgumentPromotionPass(unsigned maxElements=3)
createArgumentPromotionPass - This pass promotes "by reference" arguments to be passed by value if th...
static cl::opt< bool > EnablePrepareForThinLTO("prepare-for-thinlto", cl::init(false), cl::Hidden, cl::desc("Enable preparation for ThinLTO."))
EP_ModuleOptimizerEarly - This extension point allows adding passes just before the main module-level...
FunctionPass * createSCCPPass()
EP_EnabledOnOptLevel0 - This extension point allows adding passes that should not be disabled by O0 o...
std::function< void(const PassManagerBuilder &Builder, legacy::PassManagerBase &PM)> ExtensionFn
Extensions are passed the builder itself (so they can see how it is configured) as well as the pass m...
unsigned OptLevel
The Optimization Level - Specify the basic optimization level.
Pass * createLoopUnswitchPass(bool OptimizeForSize=false)
static cl::opt< std::string > RunPGOInstrUse("profile-use", cl::init(""), cl::Hidden, cl::value_desc("filename"), cl::desc("Enable use phase of PGO instrumentation and specify the path ""of profile data file"))
static cl::opt< bool > UseGVNAfterVectorization("use-gvn-after-vectorization", cl::init(false), cl::Hidden, cl::desc("Run GVN instead of Early CSE after vectorization passes"))
Pass * createLoopVectorizePass(bool NoUnrolling=false, bool AlwaysVectorize=true)
void populateModulePassManager(legacy::PassManagerBase &MPM)
populateModulePassManager - This sets up the primary pass manager.
static cl::opt< bool > DisablePreInliner("disable-preinline", cl::init(false), cl::Hidden, cl::desc("Disable pre-instrumentation inliner"))
void add(Pass *P) override
Add a pass to the queue of passes to run.
ModulePass * createWholeProgramDevirtPass()
This pass implements whole-program devirtualization using type metadata.
static ManagedStatic< SmallVector< std::pair< PassManagerBuilder::ExtensionPointTy, PassManagerBuilder::ExtensionFn >, 8 > > GlobalExtensions
Set of global extensions, automatically added as part of the standard set.
static cl::opt< bool > RunSLPVectorization("vectorize-slp", cl::Hidden, cl::desc("Run the SLP vectorization passes"))
FunctionPass * createNewGVNPass()
ModulePass * createSampleProfileLoaderPass()
FunctionPass * createInstructionCombiningPass(bool ExpensiveCombines=true)
ModulePass * createGlobalDCEPass()
createGlobalDCEPass - This transform is designed to eliminate unreachable internal globals (functions...
std::string PGOInstrUse
Path of the profile data file.
ValuesClass values(OptsTy...Options)
Helper to build a ValuesClass by forwarding a variable number of arguments as an initializer list to ...
Pass * createCorrelatedValuePropagationPass()
This is the interface for LLVM's unification-based alias analysis implemented with CFL graph reachabi...
initializer< Ty > init(const Ty &Val)
static cl::opt< bool > EnableMLSM("mlsm", cl::init(true), cl::Hidden, cl::desc("Enable motion of merged load and store"))
This is the interface for a metadata-based TBAA.
FunctionPass * createTailCallEliminationPass()
This file provides the interface for LLVM's Global Value Numbering pass which eliminates fully redund...
FunctionPass * createPromoteMemoryToRegisterPass()
TargetLibraryInfoImpl * LibraryInfo
LibraryInfo - Specifies information about the runtime library for the optimizer.
ModulePass * createDeadArgEliminationPass()
createDeadArgEliminationPass - This pass removes arguments from functions which are not used by the b...
FunctionPass * createCFGSimplificationPass(int Threshold=-1, std::function< bool(const Function &)> Ftor=nullptr)
FunctionPass * createDeadStoreEliminationPass()
ModulePass * createPGOInstrumentationUseLegacyPass(StringRef Filename=StringRef(""))
ModulePass * createPGOIndirectCallPromotionLegacyPass(bool InLTO=false)
ModulePass * createBarrierNoopPass()
createBarrierNoopPass - This pass is purely a module pass barrier in a pass manager.
FunctionPass * createMemCpyOptPass()
The public interface to this file...
FunctionPass * createBitTrackingDCEPass()
ModulePass * createConstantMergePass()
createConstantMergePass - This function returns a new pass that merges duplicate global constants tog...
Pass * createLoopSinkPass()
ModulePass * createGlobalOptimizerPass()
createGlobalOptimizerPass - This function returns a new pass that optimizes non-address taken interna...
Pass * createReversePostOrderFunctionAttrsPass()
createReversePostOrderFunctionAttrsPass - This pass walks SCCs of the call graph in RPO to deduce and...
void populateFunctionPassManager(legacy::FunctionPassManager &FPM)
populateFunctionPassManager - This fills in the function pass manager, which is expected to be run on...
FunctionPassManager manages FunctionPasses and BasicBlockPassManagers.
Pass * createPostOrderFunctionAttrsLegacyPass()
Create a legacy pass manager instance of a pass to compute function attrs in post-order.
std::string InstrProfileOutput
Pass * createLoopVersioningLICMPass()
ModulePass * createGlobalSplitPass()
This pass splits globals into pieces for the benefit of whole-program devirtualization and control-fl...
EP_OptimizerLast – This extension point allows adding passes that run after everything else...
EP_EarlyAsPossible - This extension point allows adding passes before any other transformations, allowing them to see the code as it is coming out of the frontend.
static cl::opt< bool > EnableLoopInterchange("enable-loopinterchange", cl::init(false), cl::Hidden, cl::desc("Enable the new, experimental LoopInterchange Pass"))
EP_CGSCCOptimizerLate - This extension point allows adding CallGraphSCC passes at the end of the main...
EP_VectorizerStart - This extension point allows adding optimization passes before the vectorizer and...
static cl::opt< bool > EnableLoopLoadElim("enable-loop-load-elim", cl::init(true), cl::Hidden, cl::desc("Enable the LoopLoadElimination Pass"))
BasicBlockPass * createLoadCombinePass()
Pass * createLoopInterchangePass()
PassManagerBase - An abstract interface to allow code to add passes to a pass manager without having ...
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small...
FunctionPass * createLoopLoadEliminationPass()
Pass * createLoopUnrollPass(int Threshold=-1, int Count=-1, int AllowPartial=-1, int Runtime=-1, int UpperBound=-1)
FunctionPass * createSpeculativeExecutionIfHasBranchDivergencePass()
static cl::opt< int > PreInlineThreshold("preinline-threshold", cl::Hidden, cl::init(75), cl::ZeroOrMore, cl::desc("Control the amount of inlining in pre-instrumentation inliner ""(default = 75)"))
FunctionPass * createMergedLoadStoreMotionPass()
createMergedLoadStoreMotionPass - The public interface to this file.
FunctionPass * createLibCallsShrinkWrapPass()
struct LLVMOpaquePassManager * LLVMPassManagerRef
Pass * createLoopDeletionPass()
Options for the frontend instrumentation based profiling pass.
BasicBlockPass * createBBVectorizePass(const VectorizeConfig &C=VectorizeConfig())
EP_Peephole - This extension point allows adding passes that perform peephole optimizations similar t...
Pass * createLoopIdiomPass()
#define clEnumValN(ENUMVAL, FLAGNAME, DESC)
Interfaces for passes which infer implicit function attributes from the name and signature of functio...
std::string PGOInstrGen
Profile data file name that the instrumentation will be written to.
ModulePass * createLowerTypeTestsPass(LowerTypeTestsSummaryAction Action, ModuleSummaryIndex *Index)
This pass lowers type metadata and the llvm.type.test intrinsic to bitsets.
LLVMAttributeRef wrap(Attribute Attr)
unsigned SizeLevel
SizeLevel - How much we're optimizing for size.
static cl::opt< bool > DisableLibCallsShrinkWrap("disable-libcalls-shrinkwrap", cl::init(false), cl::Hidden, cl::desc("Disable shrink-wrap library calls"))
ModulePass * createGlobalsAAWrapperPass()
FunctionPass * createSROAPass()
Pass * createInferFunctionAttrsLegacyPass()
Create a legacy pass manager instance of a pass to infer function attributes.
static cl::opt< bool > EnableNonLTOGlobalsModRef("enable-non-lto-gmr", cl::init(true), cl::Hidden, cl::desc("Enable the GlobalsModRef AliasAnalysis outside of the LTO pipeline."))
Provides passes for computing function attributes based on interprocedural analyses.
ImmutablePass * createCFLSteensAAWrapperPass()
ImmutablePass * createTypeBasedAAWrapperPass()
Pass * createSLPVectorizerPass()
static int const Threshold
TODO: Write a new FunctionPass AliasAnalysis so that it can keep a cache.
static cl::opt< CFLAAType > UseCFLAA("use-cfl-aa", cl::init(CFLAAType::None), cl::Hidden, cl::desc("Enable the new, experimental CFL alias analysis"), cl::values(clEnumValN(CFLAAType::None,"none","Disable CFL-AA"), clEnumValN(CFLAAType::Steensgaard,"steens","Enable unification-based CFL-AA"), clEnumValN(CFLAAType::Andersen,"anders","Enable inclusion-based CFL-AA"), clEnumValN(CFLAAType::Both,"both","Enable both variants of CFL-AA")))
ModuleSummaryIndex.h This file contains the declarations the classes that hold the module index and s...
Pass * createFunctionInliningPass()
createFunctionInliningPass - Return a new pass object that uses a heuristic to inline direct function...
Pass * createPruneEHPass()
createPruneEHPass - Return a new pass object which transforms invoke instructions into calls...
LLVM Value Representation.
Pass * createSimpleLoopUnrollPass()
FunctionPass * createEarlyCSEPass(bool UseMemorySSA=false)
This is the interface for LLVM's primary stateless and local alias analysis.
ManagedStatic - This transparently changes the behavior of global statics to be lazily constructed on...
ImmutablePass * createCFLAndersAAWrapperPass()
void addExtension(ExtensionPointTy Ty, ExtensionFn Fn)
FunctionPass * createInstructionSimplifierPass()
static cl::opt< bool > EnableGVNHoist("enable-gvn-hoist", cl::init(false), cl::Hidden, cl::desc("Enable the GVN hoisting pass"))
Pass * createForceFunctionAttrsLegacyPass()
Create a legacy pass manager instance of a pass to force function attrs.
Pass * createLoopRotatePass(int MaxHeaderSize=-1)
Pass * createIndVarSimplifyPass()
FunctionPass * createAggressiveDCEPass()
int DefaultThreshold
The default threshold to start with for a callee.
FunctionPass * createLoopDistributePass()
FunctionPass * createLowerExpectIntrinsicPass()
EP_LoopOptimizerEnd - This extension point allows adding loop passes to the end of the loop optimizer...
static cl::opt< bool > RunLoopRerolling("reroll-loops", cl::Hidden, cl::desc("Run the loop rerolling pass"))
static cl::opt< bool > RunNewGVN("enable-newgvn", cl::init(false), cl::Hidden, cl::desc("Run the NewGVN pass"))