[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:
@@ -17,6 +17,5 @@ add_llvm_library(LLVMBOLTProfile
|
||||
target_link_libraries(LLVMBOLTProfile
|
||||
PRIVATE
|
||||
LLVMBOLTCore
|
||||
LLVMBOLTPasses
|
||||
LLVMBOLTUtils
|
||||
)
|
||||
|
||||
@@ -613,8 +613,6 @@ Error DataAggregator::readProfile(BinaryContext &BC) {
|
||||
if (std::error_code EC = writeBATYAML(BC, opts::SaveProfile))
|
||||
report_error("cannot create output data file", EC);
|
||||
}
|
||||
PrintProgramStats PPS(BAT);
|
||||
BC.logBOLTErrorsAndQuitOnFatal(PPS.runOnFunctions(BC));
|
||||
}
|
||||
|
||||
return Error::success();
|
||||
|
||||
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user