From: Amir Ayupov Date: Thu, 30 Jun 2022 00:01:02 +0000 (-0700) Subject: [BOLT] Respect shouldPrint in dump-dot-all X-Git-Tag: upstream/15.0.7~3085 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=798e92c6c49127c5b24ea349522c53f2d695bb26;p=platform%2Fupstream%2Fllvm.git [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 --- diff --git a/bolt/lib/Core/BinaryFunction.cpp b/bolt/lib/Core/BinaryFunction.cpp index d490c4e..46a86d6 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() << ")";