mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-23 03:02:36 +01:00
[NewPassManager] Add tuning option: LoopUnrolling [NFC].
Summary: Mirror tuning option from old pass manager in new pass manager. Reviewers: chandlerc Subscribers: jlebar, dmgreen, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D61618 llvm-svn: 361540
This commit is contained in:
parent
6db0591e88
commit
f34749eda6
@ -85,6 +85,9 @@ public:
|
||||
/// is that of the flag: `vectorize-slp`.
|
||||
bool SLPVectorization;
|
||||
|
||||
/// Tuning option to enable/disable loop unrolling. Its default value is true.
|
||||
bool LoopUnrolling;
|
||||
|
||||
/// Tuning option to cap the number of calls to retrive clobbering accesses in
|
||||
/// MemorySSA, in LICM.
|
||||
unsigned LicmMssaOptCap;
|
||||
|
@ -217,6 +217,7 @@ PipelineTuningOptions::PipelineTuningOptions() {
|
||||
LoopInterleaving = EnableLoopInterleaving;
|
||||
LoopVectorization = EnableLoopVectorization;
|
||||
SLPVectorization = RunSLPVectorization;
|
||||
LoopUnrolling = true;
|
||||
LicmMssaOptCap = SetLicmMssaOptCap;
|
||||
LicmMssaNoAccForPromotionCap = SetLicmMssaNoAccForPromotionCap;
|
||||
}
|
||||
@ -459,8 +460,9 @@ PassBuilder::buildFunctionSimplificationPipeline(OptimizationLevel Level,
|
||||
// Do not enable unrolling in PreLinkThinLTO phase during sample PGO
|
||||
// because it changes IR to makes profile annotation in back compile
|
||||
// inaccurate.
|
||||
if (Phase != ThinLTOPhase::PreLink || !PGOOpt ||
|
||||
PGOOpt->Action != PGOOptions::SampleUse)
|
||||
if ((Phase != ThinLTOPhase::PreLink || !PGOOpt ||
|
||||
PGOOpt->Action != PGOOptions::SampleUse) &&
|
||||
PTO.LoopUnrolling)
|
||||
LPM2.addPass(LoopFullUnrollPass(Level));
|
||||
|
||||
for (auto &C : LoopOptimizerEndEPCallbacks)
|
||||
@ -907,7 +909,8 @@ ModulePassManager PassBuilder::buildModuleOptimizationPipeline(
|
||||
OptimizePM.addPass(
|
||||
createFunctionToLoopPassAdaptor(LoopUnrollAndJamPass(Level)));
|
||||
}
|
||||
OptimizePM.addPass(LoopUnrollPass(LoopUnrollOptions(Level)));
|
||||
if (PTO.LoopUnrolling)
|
||||
OptimizePM.addPass(LoopUnrollPass(LoopUnrollOptions(Level)));
|
||||
OptimizePM.addPass(WarnMissedTransformationsPass());
|
||||
OptimizePM.addPass(InstCombinePass());
|
||||
OptimizePM.addPass(RequireAnalysisPass<OptimizationRemarkEmitterAnalysis, Function>());
|
||||
|
Loading…
Reference in New Issue
Block a user