35 cl::desc(
"Run the Loop vectorization passes"));
39 cl::desc(
"Run the SLP vectorization passes"));
43 cl::desc(
"Run the BB vectorization passes"));
48 cl::desc(
"Run GVN instead of Early CSE after vectorization passes"));
52 cl::desc(
"Run cleanup optimization passes after vectorization."));
56 cl::desc(
"Enable the new, experimental SROA pass"));
60 cl::desc(
"Run the loop rerolling pass"));
64 cl::desc(
"Run the float2int (float demotion) pass"));
68 cl::desc(
"Run the load combining pass"));
73 cl::desc(
"Run the SLP vectorizer (and BB vectorizer) after the Loop "
74 "vectorizer instead of before"));
78 cl::desc(
"Enable the new, experimental CFL alias analysis"));
82 cl::desc(
"Enable motion of merged load and store"));
86 cl::desc(
"Enable the new, experimental LoopInterchange Pass"));
90 cl::desc(
"Enable the new, experimental LoopDistribution Pass"));
127 Extensions.push_back(std::make_pair(Ty, Fn));
130 void PassManagerBuilder::addExtensionsToPM(ExtensionPointTy ETy,
135 for (
unsigned i = 0, e = Extensions.size(); i != e; ++i)
136 if (Extensions[i].first == ETy)
137 Extensions[i].second(*
this, PM);
140 void PassManagerBuilder::addInitialAliasAnalysisPasses(
162 addInitialAliasAnalysisPasses(FPM);
201 addInitialAliasAnalysisPasses(MPM);
429 addInitialAliasAnalysisPasses(PM);
522 void PassManagerBuilder::addLateLTOOptimizationPasses(
544 addLTOOptimizationPasses(PM);
552 addLateLTOOptimizationPasses(PM);
585 unsigned SizeLevel) {
642 if (RunInliner && !Builder->
Inliner)
static cl::opt< bool > RunLoadCombine("combine-loads", cl::init(false), cl::Hidden, cl::desc("Run the load combining pass"))
FunctionPass * createGVNPass(bool NoLoads=false)
Pass * createLoopRerollPass()
PassManagerBuilder - This class is used to set up a standard optimization sequence for languages like...
static cl::opt< bool > RunBBVectorization("vectorize-slp-aggressive", cl::Hidden, cl::desc("Run the BB vectorization passes"))
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"))
FunctionPass * createScalarReplAggregatesPass(signed Threshold=-1, bool UseDomTree=true, signed StructMemberThreshold=-1, signed ArrayElementThreshold=-1, signed ScalarLoadThreshold=-1)
ModulePass * createMergeFunctionsPass()
createMergeFunctionsPass - This pass discovers identical functions and collapses them.
EP_ScalarOptimizerLate - This extension point allows adding optimization passes after most of the mai...
FunctionPass * createVerifierPass(bool FatalErrors=true)
Create a verifier pass.
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.
ModulePass * createEliminateAvailableExternallyPass()
This transform is designed to eliminate available external globals (functions or global variables) ...
FunctionPass * createAlignmentFromAssumptionsPass()
Pass * Inliner
Inliner - Specifies the inliner to use.
FunctionPass * createJumpThreadingPass(int Threshold=-1)
Pass * createFunctionAttrsPass()
createFunctionAttrsPass - This pass discovers functions that do not access memory, or only read memory, and gives them the readnone/readonly attribute.
static cl::opt< bool > RunLoopVectorization("vectorize-loops", cl::Hidden, cl::desc("Run the Loop vectorization passes"))
static cl::opt< bool > EnableLoopDistribute("enable-loop-distribute", cl::init(false), cl::Hidden, cl::desc("Enable the new, experimental LoopDistribution Pass"))
static void addGlobalExtension(ExtensionPointTy Ty, ExtensionFn Fn)
Adds an extension that will be used by all PassManagerBuilder instances.
void populateLTOPassManager(legacy::PassManagerBase &PM)
FunctionPass * createSROAPass(bool RequiresDomTree=true)
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...
EP_ModuleOptimizerEarly - This extension point allows adding passes just before the main module-level...
LLVMTargetDataRef wrap(const DataLayout *P)
Pass * createGlobalsModRefPass()
EP_EnabledOnOptLevel0 - This extension point allows adding passes that should not be disabled by O0 o...
FunctionPass * createLoopDistributePass()
unsigned OptLevel
The Optimization Level - Specify the basic optimization level.
Pass * createLoopUnswitchPass(bool OptimizeForSize=false)
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.
void add(Pass *P) override
Add a pass to the queue of passes to run.
ImmutablePass * createBasicAliasAnalysisPass()
ImmutablePass * createScopedNoAliasAAPass()
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"))
ImmutablePass * createCFLAliasAnalysisPass()
Pass * createLoopUnrollPass(int Threshold=-1, int Count=-1, int AllowPartial=-1, int Runtime=-1)
FunctionPass * createInstructionCombiningPass()
ModulePass * createGlobalDCEPass()
createGlobalDCEPass - This transform is designed to eliminate unreachable internal globals (functions...
static cl::opt< bool > UseNewSROA("use-new-sroa", cl::init(true), cl::Hidden, cl::desc("Enable the new, experimental SROA pass"))
Pass * createCorrelatedValuePropagationPass()
Inliner - This class contains all of the helper code which is used to perform the inlining operations...
initializer< Ty > init(const Ty &Val)
DataLayout * unwrap(LLVMTargetDataRef P)
Pass * createLoopRotatePass(int MaxHeaderSize=-1)
ImmutablePass * createTypeBasedAliasAnalysisPass()
static cl::opt< bool > EnableMLSM("mlsm", cl::init(true), cl::Hidden, cl::desc("Enable motion of merged load and store"))
FunctionPass * createTailCallEliminationPass()
TargetLibraryInfoImpl * LibraryInfo
LibraryInfo - Specifies information about the runtime library for the optimizer.
ModulePass * createLowerBitSetsPass()
This pass lowers bitset metadata and the llvm.bitset.test intrinsic to bitsets.
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)
ModulePass * createBarrierNoopPass()
createBarrierNoopPass - This pass is purely a module pass barrier in a pass manager.
FunctionPass * createMemCpyOptPass()
FunctionPass * createBitTrackingDCEPass()
ModulePass * createConstantMergePass()
createConstantMergePass - This function returns a new pass that merges duplicate global constants tog...
void(* ExtensionFn)(const PassManagerBuilder &Builder, legacy::PassManagerBase &PM)
Extensions are passed the builder itself (so they can see how it is configured) as well as the pass m...
FunctionPass * createEarlyCSEPass()
ModulePass * createGlobalOptimizerPass()
createGlobalOptimizerPass - This function returns a new pass that optimizes non-address taken interna...
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.
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"))
static cl::opt< bool > RunFloat2Int("float-to-int", cl::Hidden, cl::init(true), cl::desc("Run the float2int (float demotion) pass"))
BasicBlockPass * createLoadCombinePass()
Pass * createLoopInterchangePass()
PassManagerBase - An abstract interface to allow code to add passes to a pass manager without having ...
FunctionPass * createDeadStoreEliminationPass()
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small...
FunctionPass * createMergedLoadStoreMotionPass()
createMergedLoadStoreMotionPass - The public interface to this file.
Pass * createLoopDeletionPass()
BasicBlockPass * createBBVectorizePass(const VectorizeConfig &C=VectorizeConfig())
EP_Peephole - This extension point allows adding passes that perform peephole optimizations similar t...
Pass * createLoopIdiomPass()
static cl::opt< bool > UseCFLAA("use-cfl-aa", cl::init(false), cl::Hidden, cl::desc("Enable the new, experimental CFL alias analysis"))
FunctionPass * createSCCPPass()
FunctionPass * createAggressiveDCEPass()
struct LLVMOpaquePassManager * LLVMPassManagerRef
unsigned SizeLevel
SizeLevel - How much we're optimizing for size.
Pass * createSLPVectorizerPass()
static int const Threshold
TODO: Write a new FunctionPass AliasAnalysis so that it can keep a cache.
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()
ModulePass * createStripDeadPrototypesPass()
createStripDeadPrototypesPass - This pass removes any function declarations (prototypes) that are not...
ManagedStatic - This transparently changes the behavior of global statics to be lazily constructed on...
void addExtension(ExtensionPointTy Ty, ExtensionFn Fn)
Pass * createIndVarSimplifyPass()
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"))