mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-25 04:02:41 +01:00
[NFC][PassBuilder] addVectorPasses(): clarify that 'IsLTO' is actually 'IsFullLTO'
I.e. it will be `false` for thin lto.
This commit is contained in:
parent
a315353f43
commit
e9c11e84f4
@ -710,7 +710,7 @@ private:
|
||||
void addRequiredLTOPreLinkPasses(ModulePassManager &MPM);
|
||||
|
||||
void addVectorPasses(OptimizationLevel Level, FunctionPassManager &FPM,
|
||||
bool IsLTO);
|
||||
bool IsFullLTO);
|
||||
|
||||
static Optional<std::vector<PipelineElement>>
|
||||
parsePipelineText(StringRef Text);
|
||||
|
@ -218,8 +218,8 @@ private:
|
||||
void addLateLTOOptimizationPasses(legacy::PassManagerBase &PM);
|
||||
void addPGOInstrPasses(legacy::PassManagerBase &MPM, bool IsCS);
|
||||
void addFunctionSimplificationPasses(legacy::PassManagerBase &MPM);
|
||||
void addVectorPasses(legacy::PassManagerBase &PM, bool IsLTO);
|
||||
|
||||
void addVectorPasses(legacy::PassManagerBase &PM, bool IsFullLTO);
|
||||
|
||||
public:
|
||||
/// populateFunctionPassManager - This fills in the function pass manager,
|
||||
/// which is expected to be run on each function immediately as it is
|
||||
|
@ -1198,11 +1198,11 @@ PassBuilder::buildModuleSimplificationPipeline(OptimizationLevel Level,
|
||||
|
||||
/// TODO: Should LTO cause any differences to this set of passes?
|
||||
void PassBuilder::addVectorPasses(OptimizationLevel Level,
|
||||
FunctionPassManager &FPM, bool IsLTO) {
|
||||
FunctionPassManager &FPM, bool IsFullLTO) {
|
||||
FPM.addPass(LoopVectorizePass(
|
||||
LoopVectorizeOptions(!PTO.LoopInterleaving, !PTO.LoopVectorization)));
|
||||
|
||||
if (IsLTO) {
|
||||
if (IsFullLTO) {
|
||||
// The vectorizer may have significantly shortened a loop body; unroll
|
||||
// again. Unroll small loops to hide loop backedge latency and saturate any
|
||||
// parallel execution resources of an out-of-order processor. We also then
|
||||
@ -1220,7 +1220,7 @@ void PassBuilder::addVectorPasses(OptimizationLevel Level,
|
||||
FPM.addPass(WarnMissedTransformationsPass());
|
||||
}
|
||||
|
||||
if (!IsLTO) {
|
||||
if (!IsFullLTO) {
|
||||
// Eliminate loads by forwarding stores from the previous iteration to loads
|
||||
// of the current iteration.
|
||||
FPM.addPass(LoopLoadEliminationPass());
|
||||
@ -1267,7 +1267,7 @@ void PassBuilder::addVectorPasses(OptimizationLevel Level,
|
||||
.hoistCommonInsts(true)
|
||||
.sinkCommonInsts(true)));
|
||||
|
||||
if (IsLTO) {
|
||||
if (IsFullLTO) {
|
||||
FPM.addPass(SCCPPass());
|
||||
FPM.addPass(InstCombinePass());
|
||||
FPM.addPass(BDCEPass());
|
||||
@ -1283,7 +1283,7 @@ void PassBuilder::addVectorPasses(OptimizationLevel Level,
|
||||
// Enhance/cleanup vector code.
|
||||
FPM.addPass(VectorCombinePass());
|
||||
|
||||
if (!IsLTO) {
|
||||
if (!IsFullLTO) {
|
||||
FPM.addPass(InstCombinePass());
|
||||
// Unroll small loops to hide loop backedge latency and saturate any
|
||||
// parallel execution resources of an out-of-order processor. We also then
|
||||
@ -1312,7 +1312,7 @@ void PassBuilder::addVectorPasses(OptimizationLevel Level,
|
||||
// alignment information, try to re-derive it here.
|
||||
FPM.addPass(AlignmentFromAssumptionsPass());
|
||||
|
||||
if (IsLTO)
|
||||
if (IsFullLTO)
|
||||
FPM.addPass(InstCombinePass());
|
||||
}
|
||||
|
||||
@ -1410,7 +1410,7 @@ PassBuilder::buildModuleOptimizationPipeline(OptimizationLevel Level,
|
||||
// from the TargetLibraryInfo.
|
||||
OptimizePM.addPass(InjectTLIMappings());
|
||||
|
||||
addVectorPasses(Level, OptimizePM, /* IsLTO */ false);
|
||||
addVectorPasses(Level, OptimizePM, /* IsFullLTO */ false);
|
||||
|
||||
// Split out cold code. Splitting is done late to avoid hiding context from
|
||||
// other optimizations and inadvertently regressing performance. The tradeoff
|
||||
@ -1862,7 +1862,7 @@ PassBuilder::buildLTODefaultPipeline(OptimizationLevel Level,
|
||||
|
||||
MainFPM.addPass(LoopDistributePass());
|
||||
|
||||
addVectorPasses(Level, MainFPM, /* IsLTO */ true);
|
||||
addVectorPasses(Level, MainFPM, /* IsFullLTO */ true);
|
||||
|
||||
invokePeepholeEPCallbacks(MainFPM, Level);
|
||||
MainFPM.addPass(JumpThreadingPass(/*InsertFreezeWhenUnfoldingSelect*/ true));
|
||||
|
@ -531,10 +531,10 @@ void PassManagerBuilder::addFunctionSimplificationPasses(
|
||||
|
||||
/// FIXME: Should LTO cause any differences to this set of passes?
|
||||
void PassManagerBuilder::addVectorPasses(legacy::PassManagerBase &PM,
|
||||
bool IsLTO) {
|
||||
bool IsFullLTO) {
|
||||
PM.add(createLoopVectorizePass(!LoopsInterleaved, !LoopVectorize));
|
||||
|
||||
if (IsLTO) {
|
||||
if (IsFullLTO) {
|
||||
// The vectorizer may have significantly shortened a loop body; unroll
|
||||
// again. Unroll small loops to hide loop backedge latency and saturate any
|
||||
// parallel execution resources of an out-of-order processor. We also then
|
||||
@ -550,7 +550,7 @@ void PassManagerBuilder::addVectorPasses(legacy::PassManagerBase &PM,
|
||||
PM.add(createWarnMissedTransformationsPass());
|
||||
}
|
||||
|
||||
if (!IsLTO) {
|
||||
if (!IsFullLTO) {
|
||||
// Eliminate loads by forwarding stores from the previous iteration to loads
|
||||
// of the current iteration.
|
||||
PM.add(createLoopLoadEliminationPass());
|
||||
@ -590,7 +590,7 @@ void PassManagerBuilder::addVectorPasses(legacy::PassManagerBase &PM,
|
||||
.hoistCommonInsts(true)
|
||||
.sinkCommonInsts(true)));
|
||||
|
||||
if (IsLTO) {
|
||||
if (IsFullLTO) {
|
||||
PM.add(createSCCPPass()); // Propagate exposed constants
|
||||
PM.add(createInstructionCombiningPass()); // Clean up again
|
||||
PM.add(createBitTrackingDCEPass());
|
||||
@ -606,7 +606,7 @@ void PassManagerBuilder::addVectorPasses(legacy::PassManagerBase &PM,
|
||||
// Enhance/cleanup vector code.
|
||||
PM.add(createVectorCombinePass());
|
||||
|
||||
if (!IsLTO) {
|
||||
if (!IsFullLTO) {
|
||||
addExtensionsToPM(EP_Peephole, PM);
|
||||
PM.add(createInstructionCombiningPass());
|
||||
|
||||
@ -639,7 +639,7 @@ void PassManagerBuilder::addVectorPasses(legacy::PassManagerBase &PM,
|
||||
// about pointer alignments.
|
||||
PM.add(createAlignmentFromAssumptionsPass());
|
||||
|
||||
if (IsLTO)
|
||||
if (IsFullLTO)
|
||||
PM.add(createInstructionCombiningPass());
|
||||
}
|
||||
|
||||
@ -918,7 +918,7 @@ void PassManagerBuilder::populateModulePassManager(
|
||||
// llvm.loop.distribute=true or when -enable-loop-distribute is specified.
|
||||
MPM.add(createLoopDistributePass());
|
||||
|
||||
addVectorPasses(MPM, /* IsLTO */ false);
|
||||
addVectorPasses(MPM, /* IsFullLTO */ false);
|
||||
|
||||
// FIXME: We shouldn't bother with this anymore.
|
||||
MPM.add(createStripDeadPrototypesPass()); // Get rid of dead prototypes
|
||||
@ -1133,7 +1133,7 @@ void PassManagerBuilder::addLTOOptimizationPasses(legacy::PassManagerBase &PM) {
|
||||
ForgetAllSCEVInLoopUnroll));
|
||||
PM.add(createLoopDistributePass());
|
||||
|
||||
addVectorPasses(PM, /* IsLTO */ true);
|
||||
addVectorPasses(PM, /* IsFullLTO */ true);
|
||||
|
||||
addExtensionsToPM(EP_Peephole, PM);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user