[PATCH] D71985: [NewPM] Fix -lto-debug-pass-manager in LLD.

Hugh Wang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Dec 29 21:03:00 PST 2019


hghwng created this revision.
hghwng added a reviewer: davide.
Herald added subscribers: llvm-commits, dang, dexonsmith, steven_wu, hiraditya, inglorion, mehdi_amini.
Herald added a project: LLVM.

https://reviews.llvm.org/D71985

Files:
  llvm/lib/LTO/LTOBackend.cpp


Index: llvm/lib/LTO/LTOBackend.cpp
===================================================================
--- llvm/lib/LTO/LTOBackend.cpp
+++ llvm/lib/LTO/LTOBackend.cpp
@@ -222,7 +222,8 @@
 static void runNewPMCustomPasses(Module &Mod, TargetMachine *TM,
                                  std::string PipelineDesc,
                                  std::string AAPipelineDesc,
-                                 bool DisableVerify) {
+                                 bool DisableVerify,
+                                 bool DebugPassManager) {
   PassBuilder PB(TM);
   AAManager AA;
 
@@ -232,10 +233,10 @@
       report_fatal_error("unable to parse AA pipeline description '" +
                          AAPipelineDesc + "': " + toString(std::move(Err)));
 
-  LoopAnalysisManager LAM;
-  FunctionAnalysisManager FAM;
-  CGSCCAnalysisManager CGAM;
-  ModuleAnalysisManager MAM;
+  LoopAnalysisManager LAM(DebugPassManager);
+  FunctionAnalysisManager FAM(DebugPassManager);
+  CGSCCAnalysisManager CGAM(DebugPassManager);
+  ModuleAnalysisManager MAM(DebugPassManager);
 
   // Register the AA manager first so that our version is the one used.
   FAM.registerPass([&] { return std::move(AA); });
@@ -247,13 +248,13 @@
   PB.registerLoopAnalyses(LAM);
   PB.crossRegisterProxies(LAM, FAM, CGAM, MAM);
 
-  ModulePassManager MPM;
+  ModulePassManager MPM(DebugPassManager);
 
   // Always verify the input.
   MPM.addPass(VerifierPass());
 
   // Now, add all the passes we've been requested to.
-  if (auto Err = PB.parsePassPipeline(MPM, PipelineDesc))
+  if (auto Err = PB.parsePassPipeline(MPM, PipelineDesc, true, DebugPassManager))
     report_fatal_error("unable to parse pass pipeline description '" +
                        PipelineDesc + "': " + toString(std::move(Err)));
 
@@ -299,7 +300,7 @@
   // FIXME: Plumb the combined index into the new pass manager.
   if (!Conf.OptPipeline.empty())
     runNewPMCustomPasses(Mod, TM, Conf.OptPipeline, Conf.AAPipeline,
-                         Conf.DisableVerify);
+                         Conf.DisableVerify, Conf.DebugPassManager);
   else if (Conf.UseNewPM)
     runNewPMPasses(Conf, Mod, TM, Conf.OptLevel, IsThinLTO, ExportSummary,
                    ImportSummary);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D71985.235538.patch
Type: text/x-patch
Size: 2232 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191230/82c2690c/attachment.bin>


More information about the llvm-commits mailing list