Skip to content

Commit 0ca8ff4

Browse files
committed
[llvm-profdata] Unify default cutoffs for detailed summary printing
Use `ProfileSummaryBuilder::DefaultCutoffs` for llvm-profdata detailed summary printing for Instr profile. Differential Revision: https://reviews.llvm.org/D122210
1 parent 450692d commit 0ca8ff4

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

llvm/test/tools/llvm-profdata/suppl-instr-with-sample.test

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,19 @@ MIX5-NEXT: Maximum internal block count: 2000
9393
MIX5-NEXT: Total number of blocks: 9
9494
MIX5-NEXT: Total count: 6525
9595
MIX5-NEXT: Detailed summary:
96+
MIX5-NEXT: 1 blocks with count >= 3000 account for 1 percentage of the total counts.
97+
MIX5-NEXT: 1 blocks with count >= 3000 account for 10 percentage of the total counts.
98+
MIX5-NEXT: 1 blocks with count >= 3000 account for 20 percentage of the total counts.
99+
MIX5-NEXT: 1 blocks with count >= 3000 account for 30 percentage of the total counts.
100+
MIX5-NEXT: 1 blocks with count >= 3000 account for 40 percentage of the total counts.
101+
MIX5-NEXT: 2 blocks with count >= 2000 account for 50 percentage of the total counts.
102+
MIX5-NEXT: 2 blocks with count >= 2000 account for 60 percentage of the total counts.
103+
MIX5-NEXT: 2 blocks with count >= 2000 account for 70 percentage of the total counts.
96104
MIX5-NEXT: 3 blocks with count >= 1000 account for 80 percentage of the total counts.
97105
MIX5-NEXT: 3 blocks with count >= 1000 account for 90 percentage of the total counts.
98106
MIX5-NEXT: 4 blocks with count >= 500 account for 95 percentage of the total counts.
99107
MIX5-NEXT: 4 blocks with count >= 500 account for 99 percentage of the total counts.
100108
MIX5-NEXT: 6 blocks with count >= 12 account for 99.9 percentage of the total counts.
101109
MIX5-NEXT: 6 blocks with count >= 12 account for 99.99 percentage of the total counts.
102110
MIX5-NEXT: 6 blocks with count >= 12 account for 99.999 percentage of the total counts.
111+
MIX5-NEXT: 6 blocks with count >= 12 account for 99.9999 percentage of the total counts.

llvm/tools/llvm-profdata/llvm-profdata.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2133,7 +2133,7 @@ static int showInstrProfile(const std::string &Filename, bool ShowCounts,
21332133
auto ReaderOrErr = InstrProfReader::create(Filename);
21342134
std::vector<uint32_t> Cutoffs = std::move(DetailedSummaryCutoffs);
21352135
if (ShowDetailedSummary && Cutoffs.empty()) {
2136-
Cutoffs = {800000, 900000, 950000, 990000, 999000, 999900, 999990};
2136+
Cutoffs = ProfileSummaryBuilder::DefaultCutoffs;
21372137
}
21382138
InstrProfSummaryBuilder Builder(std::move(Cutoffs));
21392139
if (Error E = ReaderOrErr.takeError())

0 commit comments

Comments
 (0)