[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
This commit is contained in:
Amir Ayupov 2022-06-29 17:01:02 -07:00
parent dee672ee85
commit 798e92c6c4
1 changed files with 8 additions and 1 deletions

View File

@ -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() << ")";