[BOLT][NFC] Print timers in perf2bolt invocation

When BOLT is run in AggregateOnly mode (perf2bolt), it exits with code
zero so destructors are not run thus TimerGroup never prints the timers.

Add explicit printing just before the exit to honor options requesting
timers (`--time-rewrite`, `--time-aggr`).

Test Plan: updated bolt/test/timers.c

Reviewers: ayermolo, maksfb, rafaelauler, dcci

Reviewed By: dcci

Pull Request: https://github.com/llvm/llvm-project/pull/101270
This commit is contained in:
Amir Ayupov
2024-07-31 22:14:52 -07:00
committed by GitHub
parent fb97b4f962
commit 3f51bec466
2 changed files with 8 additions and 0 deletions

View File

@@ -3200,6 +3200,7 @@ void RewriteInstance::processProfileData() {
if (opts::AggregateOnly) {
PrintProgramStats PPS(&*BAT);
BC->logBOLTErrorsAndQuitOnFatal(PPS.runOnFunctions(*BC));
TimerGroup::printAll(outs());
exit(0);
}
}