[PATCH] D106307: [NewPM][opt] Add -debug-pass-manager=quiet to not print analysis info

Arthur Eubanks via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 19 15:08:47 PDT 2021


This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG5de114b650d7: [NewPM][opt] Add -debug-pass-manager=quiet to not print analysis info (authored by aeubanks).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D106307/new/

https://reviews.llvm.org/D106307

Files:
  llvm/test/Other/debug-pass-manager.ll
  llvm/tools/opt/NewPMDriver.cpp


Index: llvm/tools/opt/NewPMDriver.cpp
===================================================================
--- llvm/tools/opt/NewPMDriver.cpp
+++ llvm/tools/opt/NewPMDriver.cpp
@@ -52,7 +52,7 @@
                    cl::value_desc("filename"));
 } // namespace llvm
 
-enum class DebugLogging { None, Normal, Verbose };
+enum class DebugLogging { None, Normal, Verbose, Quiet };
 
 static cl::opt<DebugLogging> DebugPM(
     "debug-pass-manager", cl::Hidden, cl::ValueOptional,
@@ -60,6 +60,8 @@
     cl::init(DebugLogging::None),
     cl::values(
         clEnumValN(DebugLogging::Normal, "", ""),
+        clEnumValN(DebugLogging::Quiet, "quiet",
+                   "Skip printing info about analyses"),
         clEnumValN(
             DebugLogging::Verbose, "verbose",
             "Print extra information about adaptors and pass managers")));
@@ -293,6 +295,7 @@
   PassInstrumentationCallbacks PIC;
   PrintPassOptions PrintPassOpts;
   PrintPassOpts.Verbose = DebugPM == DebugLogging::Verbose;
+  PrintPassOpts.SkipAnalyses = DebugPM == DebugLogging::Quiet;
   StandardInstrumentations SI(DebugPM != DebugLogging::None, VerifyEachPass,
                               PrintPassOpts);
   SI.registerCallbacks(PIC, &FAM);
Index: llvm/test/Other/debug-pass-manager.ll
===================================================================
--- /dev/null
+++ llvm/test/Other/debug-pass-manager.ll
@@ -0,0 +1,19 @@
+; RUN: opt -passes=inline < %s -debug-pass-manager 2>&1 | FileCheck %s --check-prefix=NORMAL
+; RUN: opt -passes=inline < %s -debug-pass-manager=quiet 2>&1 | FileCheck %s --check-prefix=QUIET
+; RUN: opt -passes=inline < %s -debug-pass-manager=verbose 2>&1 | FileCheck %s --check-prefix=VERBOSE
+
+define void @a() {
+  ret void
+}
+
+; QUIET-NOT: Running pass: ModuleToPostOrderCGSCCPassAdaptor
+; QUIET: Running pass: InlinerPass
+; QUIET-NOT: Running analysis
+
+; NORMAL-NOT: Running pass: ModuleToPostOrderCGSCCPassAdaptor
+; NORMAL: Running pass: InlinerPass
+; NORMAL: Running analysis
+
+; VERBOSE: Running pass: ModuleToPostOrderCGSCCPassAdaptor
+; VERBOSE: Running pass: InlinerPass
+; VERBOSE: Running analysis


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D106307.359937.patch
Type: text/x-patch
Size: 2136 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210719/cf7ce79d/attachment.bin>


More information about the llvm-commits mailing list