[BOLT][NFC] Move out PrintProgramStats from Profile into Rewrite (#93075)

Eliminate the dependence of Profile on Passes.

Test Plan: NFC
This commit is contained in:
Amir Ayupov
2024-05-22 13:53:41 -07:00
committed by GitHub
parent 848bef5d85
commit 1529ec085a
3 changed files with 5 additions and 4 deletions

View File

@@ -17,6 +17,7 @@
#include "bolt/Core/MCPlusBuilder.h"
#include "bolt/Core/ParallelUtilities.h"
#include "bolt/Core/Relocation.h"
#include "bolt/Passes/BinaryPasses.h"
#include "bolt/Passes/CacheMetrics.h"
#include "bolt/Passes/ReorderFunctions.h"
#include "bolt/Profile/BoltAddressTranslation.h"
@@ -3281,8 +3282,11 @@ void RewriteInstance::processProfileData() {
// Release memory used by profile reader.
ProfileReader.reset();
if (opts::AggregateOnly)
if (opts::AggregateOnly) {
PrintProgramStats PPS(&*BAT);
BC->logBOLTErrorsAndQuitOnFatal(PPS.runOnFunctions(*BC));
exit(0);
}
}
void RewriteInstance::disassembleFunctions() {