[PATCH] D122210: [llvm-profdata] Unify default cutoffs for detailed summary printing

Wenlei He via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 21 23:34:00 PDT 2022


wenlei created this revision.
wenlei added reviewers: hoy, xur, wlei.
Herald added a subscriber: modimo.
Herald added a project: All.
wenlei requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Use `ProfileSummaryBuilder::DefaultCutoffs` for llvm-profdata detailed summary printing for Instr profile.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D122210

Files:
  llvm/test/tools/llvm-profdata/suppl-instr-with-sample.test
  llvm/tools/llvm-profdata/llvm-profdata.cpp


Index: llvm/tools/llvm-profdata/llvm-profdata.cpp
===================================================================
--- llvm/tools/llvm-profdata/llvm-profdata.cpp
+++ llvm/tools/llvm-profdata/llvm-profdata.cpp
@@ -2133,7 +2133,7 @@
   auto ReaderOrErr = InstrProfReader::create(Filename);
   std::vector<uint32_t> Cutoffs = std::move(DetailedSummaryCutoffs);
   if (ShowDetailedSummary && Cutoffs.empty()) {
-    Cutoffs = {800000, 900000, 950000, 990000, 999000, 999900, 999990};
+    Cutoffs = ProfileSummaryBuilder::DefaultCutoffs;
   }
   InstrProfSummaryBuilder Builder(std::move(Cutoffs));
   if (Error E = ReaderOrErr.takeError())
Index: llvm/test/tools/llvm-profdata/suppl-instr-with-sample.test
===================================================================
--- llvm/test/tools/llvm-profdata/suppl-instr-with-sample.test
+++ llvm/test/tools/llvm-profdata/suppl-instr-with-sample.test
@@ -93,6 +93,14 @@
 MIX5-NEXT: Total number of blocks: 9
 MIX5-NEXT: Total count: 6525
 MIX5-NEXT: Detailed summary:
+MIX5-NEXT: 1 blocks with count >= 3000 account for 1 percentage of the total counts.
+MIX5-NEXT: 1 blocks with count >= 3000 account for 10 percentage of the total counts.
+MIX5-NEXT: 1 blocks with count >= 3000 account for 20 percentage of the total counts.
+MIX5-NEXT: 1 blocks with count >= 3000 account for 30 percentage of the total counts.
+MIX5-NEXT: 1 blocks with count >= 3000 account for 40 percentage of the total counts.
+MIX5-NEXT: 2 blocks with count >= 2000 account for 50 percentage of the total counts.
+MIX5-NEXT: 2 blocks with count >= 2000 account for 60 percentage of the total counts.
+MIX5-NEXT: 2 blocks with count >= 2000 account for 70 percentage of the total counts.
 MIX5-NEXT: 3 blocks with count >= 1000 account for 80 percentage of the total counts.
 MIX5-NEXT: 3 blocks with count >= 1000 account for 90 percentage of the total counts.
 MIX5-NEXT: 4 blocks with count >= 500 account for 95 percentage of the total counts.
@@ -100,3 +108,4 @@
 MIX5-NEXT: 6 blocks with count >= 12 account for 99.9 percentage of the total counts.
 MIX5-NEXT: 6 blocks with count >= 12 account for 99.99 percentage of the total counts.
 MIX5-NEXT: 6 blocks with count >= 12 account for 99.999 percentage of the total counts.
+MIX5-NEXT: 6 blocks with count >= 12 account for 99.9999 percentage of the total counts.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D122210.417197.patch
Type: text/x-patch
Size: 2346 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220322/6e724926/attachment.bin>


More information about the llvm-commits mailing list