-
Notifications
You must be signed in to change notification settings - Fork 15.1k
[BOLT][NFC] Drop unused profile staleness stats #165489
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
aaupov
merged 1 commit into
main
from
users/aaupov/spr/boltnfc-drop-unused-profile-staleness-stats
Oct 29, 2025
Merged
[BOLT][NFC] Drop unused profile staleness stats #165489
aaupov
merged 1 commit into
main
from
users/aaupov/spr/boltnfc-drop-unused-profile-staleness-stats
Oct 29, 2025
+0
−25
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Created using spr 1.3.4
|
@llvm/pr-subscribers-bolt Author: Amir Ayupov (aaupov) ChangesEqual number of blocks in a function/instructions in a block between Remove these stats to unclog the output. Test Plan: NFC Full diff: https://github.com/llvm/llvm-project/pull/165489.diff 3 Files Affected:
diff --git a/bolt/include/bolt/Core/BinaryContext.h b/bolt/include/bolt/Core/BinaryContext.h
index 082f1cec34d52..47ee892728ad0 100644
--- a/bolt/include/bolt/Core/BinaryContext.h
+++ b/bolt/include/bolt/Core/BinaryContext.h
@@ -775,11 +775,6 @@ class BinaryContext {
uint64_t PseudoProbeLooseMatchedSampleCount{0};
/// the count of call matched samples
uint64_t CallMatchedSampleCount{0};
- /// the number of stale functions that have matching number of blocks in
- /// the profile
- uint64_t NumStaleFuncsWithEqualBlockCount{0};
- /// the number of blocks that have matching size but a differing hash
- uint64_t NumStaleBlocksWithEqualIcount{0};
} Stats;
// Original binary execution count stats.
diff --git a/bolt/lib/Passes/BinaryPasses.cpp b/bolt/lib/Passes/BinaryPasses.cpp
index 06e840e84f53b..00680045882fc 100644
--- a/bolt/lib/Passes/BinaryPasses.cpp
+++ b/bolt/lib/Passes/BinaryPasses.cpp
@@ -1505,12 +1505,6 @@ Error PrintProgramStats::runOnFunctions(BinaryContext &BC) {
if (NumAllStaleFunctions) {
const float PctStale =
NumAllStaleFunctions / (float)NumAllProfiledFunctions * 100.0f;
- const float PctStaleFuncsWithEqualBlockCount =
- (float)BC.Stats.NumStaleFuncsWithEqualBlockCount /
- NumAllStaleFunctions * 100.0f;
- const float PctStaleBlocksWithEqualIcount =
- (float)BC.Stats.NumStaleBlocksWithEqualIcount /
- BC.Stats.NumStaleBlocks * 100.0f;
auto printErrorOrWarning = [&]() {
if (PctStale > opts::StaleThreshold)
BC.errs() << "BOLT-ERROR: ";
@@ -1533,17 +1527,6 @@ Error PrintProgramStats::runOnFunctions(BinaryContext &BC) {
<< "%) belong to functions with invalid"
" (possibly stale) profile.\n";
}
- BC.outs() << "BOLT-INFO: " << BC.Stats.NumStaleFuncsWithEqualBlockCount
- << " stale function"
- << (BC.Stats.NumStaleFuncsWithEqualBlockCount == 1 ? "" : "s")
- << format(" (%.1f%% of all stale)",
- PctStaleFuncsWithEqualBlockCount)
- << " have matching block count.\n";
- BC.outs() << "BOLT-INFO: " << BC.Stats.NumStaleBlocksWithEqualIcount
- << " stale block"
- << (BC.Stats.NumStaleBlocksWithEqualIcount == 1 ? "" : "s")
- << format(" (%.1f%% of all stale)", PctStaleBlocksWithEqualIcount)
- << " have matching icount.\n";
if (PctStale > opts::StaleThreshold) {
return createFatalBOLTError(
Twine("BOLT-ERROR: stale functions exceed specified threshold of ") +
diff --git a/bolt/lib/Profile/YAMLProfileReader.cpp b/bolt/lib/Profile/YAMLProfileReader.cpp
index 086e47b661e10..f0f87f9baec38 100644
--- a/bolt/lib/Profile/YAMLProfileReader.cpp
+++ b/bolt/lib/Profile/YAMLProfileReader.cpp
@@ -350,9 +350,6 @@ bool YAMLProfileReader::parseFunctionProfile(
<< MismatchedCalls << " calls, and " << MismatchedEdges
<< " edges in profile did not match function " << BF << '\n';
- if (YamlBF.NumBasicBlocks != BF.size())
- ++BC.Stats.NumStaleFuncsWithEqualBlockCount;
-
if (!opts::InferStaleProfile)
return false;
ArrayRef<ProbeMatchSpec> ProbeMatchSpecs;
|
yozhu
approved these changes
Oct 29, 2025
aokblast
pushed a commit
to aokblast/llvm-project
that referenced
this pull request
Oct 30, 2025
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
DEBADRIBASAK
pushed a commit
to DEBADRIBASAK/llvm-project
that referenced
this pull request
Nov 3, 2025
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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