Please use GitHub pull requests for new patches. Avoid migrating existing patches. Phabricator shutdown timeline
Changeset View
Changeset View
Standalone View
Standalone View
llvm/trunk/lib/Transforms/IPO/PassManagerBuilder.cpp
Show First 20 Lines • Show All 149 Lines • ▼ Show 20 Lines | DisableLibCallsShrinkWrap("disable-libcalls-shrinkwrap", cl::init(false), | ||||
cl::Hidden, | cl::Hidden, | ||||
cl::desc("Disable shrink-wrap library calls")); | cl::desc("Disable shrink-wrap library calls")); | ||||
static cl::opt<bool> | static cl::opt<bool> | ||||
EnableSimpleLoopUnswitch("enable-simple-loop-unswitch", cl::init(false), | EnableSimpleLoopUnswitch("enable-simple-loop-unswitch", cl::init(false), | ||||
cl::Hidden, | cl::Hidden, | ||||
cl::desc("Enable the simple loop unswitch pass.")); | cl::desc("Enable the simple loop unswitch pass.")); | ||||
static cl::opt<bool> EnableGVNSink( | |||||
"enable-gvn-sink", cl::init(false), cl::Hidden, | |||||
cl::desc("Enable the GVN sinking pass (default = on)")); | |||||
PassManagerBuilder::PassManagerBuilder() { | PassManagerBuilder::PassManagerBuilder() { | ||||
OptLevel = 2; | OptLevel = 2; | ||||
SizeLevel = 0; | SizeLevel = 0; | ||||
LibraryInfo = nullptr; | LibraryInfo = nullptr; | ||||
Inliner = nullptr; | Inliner = nullptr; | ||||
DisableUnitAtATime = false; | DisableUnitAtATime = false; | ||||
DisableUnrollLoops = false; | DisableUnrollLoops = false; | ||||
BBVectorize = RunBBVectorization; | BBVectorize = RunBBVectorization; | ||||
▲ Show 20 Lines • Show All 136 Lines • ▼ Show 20 Lines | |||||
void PassManagerBuilder::addFunctionSimplificationPasses( | void PassManagerBuilder::addFunctionSimplificationPasses( | ||||
legacy::PassManagerBase &MPM) { | legacy::PassManagerBase &MPM) { | ||||
// Start of function pass. | // Start of function pass. | ||||
// Break up aggregate allocas, using SSAUpdater. | // Break up aggregate allocas, using SSAUpdater. | ||||
MPM.add(createSROAPass()); | MPM.add(createSROAPass()); | ||||
MPM.add(createEarlyCSEPass()); // Catch trivial redundancies | MPM.add(createEarlyCSEPass()); // Catch trivial redundancies | ||||
if (EnableGVNHoist) | if (EnableGVNHoist) | ||||
MPM.add(createGVNHoistPass()); | MPM.add(createGVNHoistPass()); | ||||
if (EnableGVNSink) { | |||||
MPM.add(createGVNSinkPass()); | |||||
MPM.add(createCFGSimplificationPass()); | |||||
} | |||||
// Speculative execution if the target has divergent branches; otherwise nop. | // Speculative execution if the target has divergent branches; otherwise nop. | ||||
MPM.add(createSpeculativeExecutionIfHasBranchDivergencePass()); | MPM.add(createSpeculativeExecutionIfHasBranchDivergencePass()); | ||||
MPM.add(createJumpThreadingPass()); // Thread jumps. | MPM.add(createJumpThreadingPass()); // Thread jumps. | ||||
MPM.add(createCorrelatedValuePropagationPass()); // Propagate conditionals | MPM.add(createCorrelatedValuePropagationPass()); // Propagate conditionals | ||||
MPM.add(createCFGSimplificationPass()); // Merge & remove BBs | MPM.add(createCFGSimplificationPass()); // Merge & remove BBs | ||||
// Combine silly seq's | // Combine silly seq's | ||||
addInstructionCombiningPass(MPM); | addInstructionCombiningPass(MPM); | ||||
if (SizeLevel == 0 && !DisableLibCallsShrinkWrap) | if (SizeLevel == 0 && !DisableLibCallsShrinkWrap) | ||||
▲ Show 20 Lines • Show All 695 Lines • Show Last 20 Lines |