[lto] Enable new PM when the PM config is non-empty
authorBenjamin Kramer <benny.kra@googlemail.com>
Mon, 15 Feb 2021 19:49:09 +0000 (20:49 +0100)
committerBenjamin Kramer <benny.kra@googlemail.com>
Mon, 15 Feb 2021 19:49:09 +0000 (20:49 +0100)
This restores the behavior before 964f8103c58d, which broke 2 tests:
  LLVM :: tools/llvm-lto2/X86/pipeline.ll
  lld :: ELF/lto/ltopasses-custom.ll

llvm/lib/LTO/LTOBackend.cpp

index 5eaa621..954aa2b 100644 (file)
@@ -355,7 +355,7 @@ bool lto::opt(const Config &Conf, TargetMachine *TM, unsigned Task, Module &Mod,
                                /*Cmdline*/ CmdArgs);
   }
   // FIXME: Plumb the combined index into the new pass manager.
-  if (Conf.UseNewPM) {
+  if (Conf.UseNewPM || !Conf.OptPipeline.empty()) {
     runNewPMPasses(Conf, Mod, TM, Conf.OptLevel, IsThinLTO, ExportSummary,
                    ImportSummary);
   } else {