[Pipelines] Remove redundant O0 check (NFC)
authorNikita Popov <npopov@redhat.com>
Tue, 11 Apr 2023 11:05:56 +0000 (13:05 +0200)
committerNikita Popov <npopov@redhat.com>
Tue, 11 Apr 2023 11:13:36 +0000 (13:13 +0200)
buildModuleSimplificationPipeline() is not used for O0.

llvm/lib/Passes/PassBuilderPipelines.cpp

index 1700347..925bb4b 100644 (file)
@@ -924,6 +924,8 @@ PassBuilder::buildModuleInlinerPipeline(OptimizationLevel Level,
 ModulePassManager
 PassBuilder::buildModuleSimplificationPipeline(OptimizationLevel Level,
                                                ThinOrFullLTOPhase Phase) {
+  assert(Level != OptimizationLevel::O0 &&
+         "Should not be used for O0 pipeline");
   ModulePassManager MPM;
 
   // Place pseudo probe instrumentation as the first pass of the pipeline to
@@ -1000,8 +1002,7 @@ PassBuilder::buildModuleSimplificationPipeline(OptimizationLevel Level,
 
   // Try to perform OpenMP specific optimizations on the module. This is a
   // (quick!) no-op if there are no OpenMP runtime calls present in the module.
-  if (Level != OptimizationLevel::O0)
-    MPM.addPass(OpenMPOptPass());
+  MPM.addPass(OpenMPOptPass());
 
   if (AttributorRun & AttributorRunOption::MODULE)
     MPM.addPass(AttributorPass());