From 798e92c6c49127c5b24ea349522c53f2d695bb26 Mon Sep 17 00:00:00 2001 From: Amir Ayupov Date: Wed, 29 Jun 2022 17:01:02 -0700 Subject: [PATCH] [BOLT] Respect shouldPrint in dump-dot-all Don't dump dot CFG graph for functions that should not be printed. Reviewed By: rafauler, maksfb Differential Revision: https://reviews.llvm.org/D128699 --- bolt/lib/Core/BinaryFunction.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/bolt/lib/Core/BinaryFunction.cpp b/bolt/lib/Core/BinaryFunction.cpp index d490c4efc090..46a86d60579a 100644 --- a/bolt/lib/Core/BinaryFunction.cpp +++ b/bolt/lib/Core/BinaryFunction.cpp @@ -3110,8 +3110,12 @@ void BinaryFunction::viewGraph() const { } void BinaryFunction::dumpGraphForPass(std::string Annotation) const { + if (!opts::shouldPrint(*this)) + return; + std::string Filename = constructFilename(getPrintName(), Annotation, ".dot"); - outs() << "BOLT-DEBUG: Dumping CFG to " << Filename << "\n"; + if (opts::Verbosity >= 1) + outs() << "BOLT-INFO: dumping CFG to " << Filename << "\n"; dumpGraphToFile(Filename); } @@ -4373,6 +4377,9 @@ DebugLocationsVector BinaryFunction::translateInputToOutputLocationList( } void BinaryFunction::printLoopInfo(raw_ostream &OS) const { + if (!opts::shouldPrint(*this)) + return; + OS << "Loop Info for Function \"" << *this << "\""; if (hasValidProfile()) OS << " (count: " << getExecutionCount() << ")";