[llvm] 9173b5a - Revert "[NewPM] Add OptimizationLevel param to registerPipelineStartEPCallback"

Arthur Eubanks via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 4 12:57:56 PST 2020


Author: Arthur Eubanks
Date: 2020-11-04T12:57:32-08:00
New Revision: 9173b5a99daea1768adacefd690243522b567d1a

URL: https://github.com/llvm/llvm-project/commit/9173b5a99daea1768adacefd690243522b567d1a
DIFF: https://github.com/llvm/llvm-project/commit/9173b5a99daea1768adacefd690243522b567d1a.diff

LOG: Revert "[NewPM] Add OptimizationLevel param to registerPipelineStartEPCallback"

This reverts commit 7a83aa0520d24ee5285a9c60b97b57a1db1d65e8.

Causing buildbot failures.

Added: 
    

Modified: 
    llvm/include/llvm/Passes/PassBuilder.h
    llvm/lib/Passes/PassBuilder.cpp
    llvm/lib/Target/BPF/BPFTargetMachine.cpp
    llvm/tools/opt/NewPMDriver.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/Passes/PassBuilder.h b/llvm/include/llvm/Passes/PassBuilder.h
index 31c4782eaba3..356b70d368bb 100644
--- a/llvm/include/llvm/Passes/PassBuilder.h
+++ b/llvm/include/llvm/Passes/PassBuilder.h
@@ -587,7 +587,7 @@ class PassBuilder {
   /// pipeline. This does not apply to 'backend' compiles (LTO and ThinLTO
   /// link-time pipelines).
   void registerPipelineStartEPCallback(
-      const std::function<void(ModulePassManager &, OptimizationLevel)> &C) {
+      const std::function<void(ModulePassManager &)> &C) {
     PipelineStartEPCallbacks.push_back(C);
   }
 
@@ -722,7 +722,7 @@ class PassBuilder {
   SmallVector<std::function<void(ModulePassManager &, OptimizationLevel)>, 2>
       OptimizerLastEPCallbacks;
   // Module callbacks
-  SmallVector<std::function<void(ModulePassManager &, OptimizationLevel)>, 2>
+  SmallVector<std::function<void(ModulePassManager &)>, 2>
       PipelineStartEPCallbacks;
   SmallVector<std::function<void(ModuleAnalysisManager &)>, 2>
       ModuleAnalysisRegistrationCallbacks;

diff  --git a/llvm/lib/Passes/PassBuilder.cpp b/llvm/lib/Passes/PassBuilder.cpp
index 68bbb01d1fda..fd16bedc70aa 100644
--- a/llvm/lib/Passes/PassBuilder.cpp
+++ b/llvm/lib/Passes/PassBuilder.cpp
@@ -1319,7 +1319,7 @@ PassBuilder::buildPerModuleDefaultPipeline(OptimizationLevel Level,
 
   // Apply module pipeline start EP callback.
   for (auto &C : PipelineStartEPCallbacks)
-    C(MPM, Level);
+    C(MPM);
 
   if (PGOOpt && PGOOpt->SamplePGOSupport)
     MPM.addPass(createModuleToFunctionPassAdaptor(AddDiscriminatorsPass()));
@@ -1348,7 +1348,7 @@ PassBuilder::buildThinLTOPreLinkDefaultPipeline(OptimizationLevel Level) {
 
   // Apply module pipeline start EP callback.
   for (auto &C : PipelineStartEPCallbacks)
-    C(MPM, Level);
+    C(MPM);
 
   // 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

diff  --git a/llvm/lib/Target/BPF/BPFTargetMachine.cpp b/llvm/lib/Target/BPF/BPFTargetMachine.cpp
index 25fccea256f1..7ef35105083f 100644
--- a/llvm/lib/Target/BPF/BPFTargetMachine.cpp
+++ b/llvm/lib/Target/BPF/BPFTargetMachine.cpp
@@ -125,13 +125,12 @@ void BPFTargetMachine::adjustPassManager(PassManagerBuilder &Builder) {
 
 void BPFTargetMachine::registerPassBuilderCallbacks(PassBuilder &PB,
                                                     bool DebugPassManager) {
-  PB.registerPipelineStartEPCallback(
-      [=](ModulePassManager &MPM, PassBuilder::OptimizationLevel) {
-        FunctionPassManager FPM(DebugPassManager);
-        FPM.addPass(BPFAbstractMemberAccessPass(this));
-        FPM.addPass(BPFPreserveDITypePass());
-        MPM.addPass(createModuleToFunctionPassAdaptor(std::move(FPM)));
-      });
+  PB.registerPipelineStartEPCallback([=](ModulePassManager &MPM) {
+    FunctionPassManager FPM(DebugPassManager);
+    FPM.addPass(BPFAbstractMemberAccessPass(this));
+    FPM.addPass(BPFPreserveDITypePass());
+    MPM.addPass(createModuleToFunctionPassAdaptor(std::move(FPM)));
+  });
   PB.registerPeepholeEPCallback([=](FunctionPassManager &FPM,
                                     PassBuilder::OptimizationLevel Level) {
     FPM.addPass(SimplifyCFGPass(SimplifyCFGOptions().hoistCommonInsts(true)));

diff  --git a/llvm/tools/opt/NewPMDriver.cpp b/llvm/tools/opt/NewPMDriver.cpp
index 6d134afc96c3..609f64ca76b7 100644
--- a/llvm/tools/opt/NewPMDriver.cpp
+++ b/llvm/tools/opt/NewPMDriver.cpp
@@ -190,11 +190,10 @@ static void registerEPCallbacks(PassBuilder &PB) {
           Err(PB.parsePassPipeline(PM, VectorizerStartEPPipeline));
         });
   if (tryParsePipelineText<ModulePassManager>(PB, PipelineStartEPPipeline))
-    PB.registerPipelineStartEPCallback(
-        [&PB](ModulePassManager &PM, PassBuilder::OptimizationLevel) {
-          ExitOnError Err("Unable to parse PipelineStartEP pipeline: ");
-          Err(PB.parsePassPipeline(PM, PipelineStartEPPipeline));
-        });
+    PB.registerPipelineStartEPCallback([&PB](ModulePassManager &PM) {
+      ExitOnError Err("Unable to parse PipelineStartEP pipeline: ");
+      Err(PB.parsePassPipeline(PM, PipelineStartEPPipeline));
+    });
   if (tryParsePipelineText<FunctionPassManager>(PB, OptimizerLastEPPipeline))
     PB.registerOptimizerLastEPCallback(
         [&PB](ModulePassManager &PM, PassBuilder::OptimizationLevel) {


        


More information about the llvm-commits mailing list