mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-22 18:54:02 +01:00
Revert "[NewPM] Add OptimizationLevel param to registerPipelineStartEPCallback"
This reverts commit 7a83aa0520d24ee5285a9c60b97b57a1db1d65e8. Causing buildbot failures.
This commit is contained in:
parent
753c4830f9
commit
3a6a4e9f83
@ -587,7 +587,7 @@ public:
|
|||||||
/// pipeline. This does not apply to 'backend' compiles (LTO and ThinLTO
|
/// pipeline. This does not apply to 'backend' compiles (LTO and ThinLTO
|
||||||
/// link-time pipelines).
|
/// link-time pipelines).
|
||||||
void registerPipelineStartEPCallback(
|
void registerPipelineStartEPCallback(
|
||||||
const std::function<void(ModulePassManager &, OptimizationLevel)> &C) {
|
const std::function<void(ModulePassManager &)> &C) {
|
||||||
PipelineStartEPCallbacks.push_back(C);
|
PipelineStartEPCallbacks.push_back(C);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -722,7 +722,7 @@ private:
|
|||||||
SmallVector<std::function<void(ModulePassManager &, OptimizationLevel)>, 2>
|
SmallVector<std::function<void(ModulePassManager &, OptimizationLevel)>, 2>
|
||||||
OptimizerLastEPCallbacks;
|
OptimizerLastEPCallbacks;
|
||||||
// Module callbacks
|
// Module callbacks
|
||||||
SmallVector<std::function<void(ModulePassManager &, OptimizationLevel)>, 2>
|
SmallVector<std::function<void(ModulePassManager &)>, 2>
|
||||||
PipelineStartEPCallbacks;
|
PipelineStartEPCallbacks;
|
||||||
SmallVector<std::function<void(ModuleAnalysisManager &)>, 2>
|
SmallVector<std::function<void(ModuleAnalysisManager &)>, 2>
|
||||||
ModuleAnalysisRegistrationCallbacks;
|
ModuleAnalysisRegistrationCallbacks;
|
||||||
|
@ -1319,7 +1319,7 @@ PassBuilder::buildPerModuleDefaultPipeline(OptimizationLevel Level,
|
|||||||
|
|
||||||
// Apply module pipeline start EP callback.
|
// Apply module pipeline start EP callback.
|
||||||
for (auto &C : PipelineStartEPCallbacks)
|
for (auto &C : PipelineStartEPCallbacks)
|
||||||
C(MPM, Level);
|
C(MPM);
|
||||||
|
|
||||||
if (PGOOpt && PGOOpt->SamplePGOSupport)
|
if (PGOOpt && PGOOpt->SamplePGOSupport)
|
||||||
MPM.addPass(createModuleToFunctionPassAdaptor(AddDiscriminatorsPass()));
|
MPM.addPass(createModuleToFunctionPassAdaptor(AddDiscriminatorsPass()));
|
||||||
@ -1348,7 +1348,7 @@ PassBuilder::buildThinLTOPreLinkDefaultPipeline(OptimizationLevel Level) {
|
|||||||
|
|
||||||
// Apply module pipeline start EP callback.
|
// Apply module pipeline start EP callback.
|
||||||
for (auto &C : PipelineStartEPCallbacks)
|
for (auto &C : PipelineStartEPCallbacks)
|
||||||
C(MPM, Level);
|
C(MPM);
|
||||||
|
|
||||||
// If we are planning to perform ThinLTO later, we don't bloat the code with
|
// If we are planning to perform ThinLTO later, we don't bloat the code with
|
||||||
// unrolling/vectorization/... now. Just simplify the module as much as we
|
// unrolling/vectorization/... now. Just simplify the module as much as we
|
||||||
|
@ -125,13 +125,12 @@ void BPFTargetMachine::adjustPassManager(PassManagerBuilder &Builder) {
|
|||||||
|
|
||||||
void BPFTargetMachine::registerPassBuilderCallbacks(PassBuilder &PB,
|
void BPFTargetMachine::registerPassBuilderCallbacks(PassBuilder &PB,
|
||||||
bool DebugPassManager) {
|
bool DebugPassManager) {
|
||||||
PB.registerPipelineStartEPCallback(
|
PB.registerPipelineStartEPCallback([=](ModulePassManager &MPM) {
|
||||||
[=](ModulePassManager &MPM, PassBuilder::OptimizationLevel) {
|
FunctionPassManager FPM(DebugPassManager);
|
||||||
FunctionPassManager FPM(DebugPassManager);
|
FPM.addPass(BPFAbstractMemberAccessPass(this));
|
||||||
FPM.addPass(BPFAbstractMemberAccessPass(this));
|
FPM.addPass(BPFPreserveDITypePass());
|
||||||
FPM.addPass(BPFPreserveDITypePass());
|
MPM.addPass(createModuleToFunctionPassAdaptor(std::move(FPM)));
|
||||||
MPM.addPass(createModuleToFunctionPassAdaptor(std::move(FPM)));
|
});
|
||||||
});
|
|
||||||
PB.registerPeepholeEPCallback([=](FunctionPassManager &FPM,
|
PB.registerPeepholeEPCallback([=](FunctionPassManager &FPM,
|
||||||
PassBuilder::OptimizationLevel Level) {
|
PassBuilder::OptimizationLevel Level) {
|
||||||
FPM.addPass(SimplifyCFGPass(SimplifyCFGOptions().hoistCommonInsts(true)));
|
FPM.addPass(SimplifyCFGPass(SimplifyCFGOptions().hoistCommonInsts(true)));
|
||||||
|
@ -190,11 +190,10 @@ static void registerEPCallbacks(PassBuilder &PB) {
|
|||||||
Err(PB.parsePassPipeline(PM, VectorizerStartEPPipeline));
|
Err(PB.parsePassPipeline(PM, VectorizerStartEPPipeline));
|
||||||
});
|
});
|
||||||
if (tryParsePipelineText<ModulePassManager>(PB, PipelineStartEPPipeline))
|
if (tryParsePipelineText<ModulePassManager>(PB, PipelineStartEPPipeline))
|
||||||
PB.registerPipelineStartEPCallback(
|
PB.registerPipelineStartEPCallback([&PB](ModulePassManager &PM) {
|
||||||
[&PB](ModulePassManager &PM, PassBuilder::OptimizationLevel) {
|
ExitOnError Err("Unable to parse PipelineStartEP pipeline: ");
|
||||||
ExitOnError Err("Unable to parse PipelineStartEP pipeline: ");
|
Err(PB.parsePassPipeline(PM, PipelineStartEPPipeline));
|
||||||
Err(PB.parsePassPipeline(PM, PipelineStartEPPipeline));
|
});
|
||||||
});
|
|
||||||
if (tryParsePipelineText<FunctionPassManager>(PB, OptimizerLastEPPipeline))
|
if (tryParsePipelineText<FunctionPassManager>(PB, OptimizerLastEPPipeline))
|
||||||
PB.registerOptimizerLastEPCallback(
|
PB.registerOptimizerLastEPCallback(
|
||||||
[&PB](ModulePassManager &PM, PassBuilder::OptimizationLevel) {
|
[&PB](ModulePassManager &PM, PassBuilder::OptimizationLevel) {
|
||||||
|
Loading…
Reference in New Issue
Block a user