Skip to content

Commit 1529ec0

Browse files
authored
[BOLT][NFC] Move out PrintProgramStats from Profile into Rewrite (llvm#93075)
Eliminate the dependence of Profile on Passes. Test Plan: NFC
1 parent 848bef5 commit 1529ec0

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

bolt/lib/Profile/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,5 @@ add_llvm_library(LLVMBOLTProfile
1717
target_link_libraries(LLVMBOLTProfile
1818
PRIVATE
1919
LLVMBOLTCore
20-
LLVMBOLTPasses
2120
LLVMBOLTUtils
2221
)

bolt/lib/Profile/DataAggregator.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -613,8 +613,6 @@ Error DataAggregator::readProfile(BinaryContext &BC) {
613613
if (std::error_code EC = writeBATYAML(BC, opts::SaveProfile))
614614
report_error("cannot create output data file", EC);
615615
}
616-
PrintProgramStats PPS(BAT);
617-
BC.logBOLTErrorsAndQuitOnFatal(PPS.runOnFunctions(BC));
618616
}
619617

620618
return Error::success();

bolt/lib/Rewrite/RewriteInstance.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#include "bolt/Core/MCPlusBuilder.h"
1818
#include "bolt/Core/ParallelUtilities.h"
1919
#include "bolt/Core/Relocation.h"
20+
#include "bolt/Passes/BinaryPasses.h"
2021
#include "bolt/Passes/CacheMetrics.h"
2122
#include "bolt/Passes/ReorderFunctions.h"
2223
#include "bolt/Profile/BoltAddressTranslation.h"
@@ -3281,8 +3282,11 @@ void RewriteInstance::processProfileData() {
32813282
// Release memory used by profile reader.
32823283
ProfileReader.reset();
32833284

3284-
if (opts::AggregateOnly)
3285+
if (opts::AggregateOnly) {
3286+
PrintProgramStats PPS(&*BAT);
3287+
BC->logBOLTErrorsAndQuitOnFatal(PPS.runOnFunctions(*BC));
32853288
exit(0);
3289+
}
32863290
}
32873291

32883292
void RewriteInstance::disassembleFunctions() {

0 commit comments

Comments
 (0)