Changeset View
Changeset View
Standalone View
Standalone View
llvm/lib/Transforms/IPO/PassManagerBuilder.cpp
Show First 20 Lines • Show All 1,081 Lines • ▼ Show 20 Lines | PM.add(createLoopUnrollPass(OptLevel, DisableUnrollLoops, | ||||
ForgetAllSCEVInLoopUnroll)); | ForgetAllSCEVInLoopUnroll)); | ||||
PM.add(createWarnMissedTransformationsPass()); | PM.add(createWarnMissedTransformationsPass()); | ||||
// Now that we've optimized loops (in particular loop induction variables), | // Now that we've optimized loops (in particular loop induction variables), | ||||
// we may have exposed more scalar opportunities. Run parts of the scalar | // we may have exposed more scalar opportunities. Run parts of the scalar | ||||
// optimizer again at this point. | // optimizer again at this point. | ||||
PM.add(createInstructionCombiningPass()); // Initial cleanup | PM.add(createInstructionCombiningPass()); // Initial cleanup | ||||
PM.add(createCFGSimplificationPass()); // if-convert | PM.add(createCFGSimplificationPass(SimplifyCFGOptions() // if-convert | ||||
.hoistCommonInsts(true))); | |||||
PM.add(createSCCPPass()); // Propagate exposed constants | PM.add(createSCCPPass()); // Propagate exposed constants | ||||
PM.add(createInstructionCombiningPass()); // Clean up again | PM.add(createInstructionCombiningPass()); // Clean up again | ||||
PM.add(createBitTrackingDCEPass()); | PM.add(createBitTrackingDCEPass()); | ||||
// More scalar chains could be vectorized due to more alias information | // More scalar chains could be vectorized due to more alias information | ||||
if (SLPVectorize) | if (SLPVectorize) | ||||
PM.add(createSLPVectorizerPass()); // Vectorize parallel scalar chains. | PM.add(createSLPVectorizerPass()); // Vectorize parallel scalar chains. | ||||
Show All 13 Lines | |||||
void PassManagerBuilder::addLateLTOOptimizationPasses( | void PassManagerBuilder::addLateLTOOptimizationPasses( | ||||
legacy::PassManagerBase &PM) { | legacy::PassManagerBase &PM) { | ||||
// See comment in the new PM for justification of scheduling splitting at | // See comment in the new PM for justification of scheduling splitting at | ||||
// this stage (\ref buildLTODefaultPipeline). | // this stage (\ref buildLTODefaultPipeline). | ||||
if (EnableHotColdSplit) | if (EnableHotColdSplit) | ||||
PM.add(createHotColdSplittingPass()); | PM.add(createHotColdSplittingPass()); | ||||
// Delete basic blocks, which optimization passes may have killed. | // Delete basic blocks, which optimization passes may have killed. | ||||
PM.add(createCFGSimplificationPass()); | PM.add( | ||||
createCFGSimplificationPass(SimplifyCFGOptions().hoistCommonInsts(true))); | |||||
// Drop bodies of available externally objects to improve GlobalDCE. | // Drop bodies of available externally objects to improve GlobalDCE. | ||||
PM.add(createEliminateAvailableExternallyPass()); | PM.add(createEliminateAvailableExternallyPass()); | ||||
// Now that we have optimized the program, discard unreachable functions. | // Now that we have optimized the program, discard unreachable functions. | ||||
PM.add(createGlobalDCEPass()); | PM.add(createGlobalDCEPass()); | ||||
// FIXME: this is profitable (for compiler time) to do at -O0 too, but | // FIXME: this is profitable (for compiler time) to do at -O0 too, but | ||||
▲ Show 20 Lines • Show All 159 Lines • Show Last 20 Lines |