Skip to content

Commit 04e78b4

Browse files
authored
[BOLT][NFC] Drop unused profile staleness stats (#165489)
Equal number of blocks in a function/instructions in a block between stale profile and the binary isn't used in the matching. Remove these stats to declutter the output. Test Plan: NFC
1 parent 1bd0fdf commit 04e78b4

File tree

3 files changed

+0
-25
lines changed

3 files changed

+0
-25
lines changed

bolt/include/bolt/Core/BinaryContext.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -781,11 +781,6 @@ class BinaryContext {
781781
uint64_t PseudoProbeLooseMatchedSampleCount{0};
782782
/// the count of call matched samples
783783
uint64_t CallMatchedSampleCount{0};
784-
/// the number of stale functions that have matching number of blocks in
785-
/// the profile
786-
uint64_t NumStaleFuncsWithEqualBlockCount{0};
787-
/// the number of blocks that have matching size but a differing hash
788-
uint64_t NumStaleBlocksWithEqualIcount{0};
789784
} Stats;
790785

791786
// Original binary execution count stats.

bolt/lib/Passes/BinaryPasses.cpp

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1508,12 +1508,6 @@ Error PrintProgramStats::runOnFunctions(BinaryContext &BC) {
15081508
if (NumAllStaleFunctions) {
15091509
const float PctStale =
15101510
NumAllStaleFunctions / (float)NumAllProfiledFunctions * 100.0f;
1511-
const float PctStaleFuncsWithEqualBlockCount =
1512-
(float)BC.Stats.NumStaleFuncsWithEqualBlockCount /
1513-
NumAllStaleFunctions * 100.0f;
1514-
const float PctStaleBlocksWithEqualIcount =
1515-
(float)BC.Stats.NumStaleBlocksWithEqualIcount /
1516-
BC.Stats.NumStaleBlocks * 100.0f;
15171511
auto printErrorOrWarning = [&]() {
15181512
if (PctStale > opts::StaleThreshold)
15191513
BC.errs() << "BOLT-ERROR: ";
@@ -1536,17 +1530,6 @@ Error PrintProgramStats::runOnFunctions(BinaryContext &BC) {
15361530
<< "%) belong to functions with invalid"
15371531
" (possibly stale) profile.\n";
15381532
}
1539-
BC.outs() << "BOLT-INFO: " << BC.Stats.NumStaleFuncsWithEqualBlockCount
1540-
<< " stale function"
1541-
<< (BC.Stats.NumStaleFuncsWithEqualBlockCount == 1 ? "" : "s")
1542-
<< format(" (%.1f%% of all stale)",
1543-
PctStaleFuncsWithEqualBlockCount)
1544-
<< " have matching block count.\n";
1545-
BC.outs() << "BOLT-INFO: " << BC.Stats.NumStaleBlocksWithEqualIcount
1546-
<< " stale block"
1547-
<< (BC.Stats.NumStaleBlocksWithEqualIcount == 1 ? "" : "s")
1548-
<< format(" (%.1f%% of all stale)", PctStaleBlocksWithEqualIcount)
1549-
<< " have matching icount.\n";
15501533
if (PctStale > opts::StaleThreshold) {
15511534
return createFatalBOLTError(
15521535
Twine("BOLT-ERROR: stale functions exceed specified threshold of ") +

bolt/lib/Profile/YAMLProfileReader.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -350,9 +350,6 @@ bool YAMLProfileReader::parseFunctionProfile(
350350
<< MismatchedCalls << " calls, and " << MismatchedEdges
351351
<< " edges in profile did not match function " << BF << '\n';
352352

353-
if (YamlBF.NumBasicBlocks != BF.size())
354-
++BC.Stats.NumStaleFuncsWithEqualBlockCount;
355-
356353
if (!opts::InferStaleProfile)
357354
return false;
358355
ArrayRef<ProbeMatchSpec> ProbeMatchSpecs;

0 commit comments

Comments
 (0)