[llvm] 0ca8ff4 - [llvm-profdata] Unify default cutoffs for detailed summary printing

Wenlei He via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 23 14:57:38 PDT 2022


Author: Wenlei He
Date: 2022-03-23T14:38:53-07:00
New Revision: 0ca8ff4da1bd21974cebd35c3b357d1ef8c51e32

URL: https://github.com/llvm/llvm-project/commit/0ca8ff4da1bd21974cebd35c3b357d1ef8c51e32
DIFF: https://github.com/llvm/llvm-project/commit/0ca8ff4da1bd21974cebd35c3b357d1ef8c51e32.diff

LOG: [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

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/llvm/test/tools/llvm-profdata/suppl-instr-with-sample.test b/llvm/test/tools/llvm-profdata/suppl-instr-with-sample.test
index 29d3c7c66b0f3..8b1016eac6709 100644
--- a/llvm/test/tools/llvm-profdata/suppl-instr-with-sample.test
+++ b/llvm/test/tools/llvm-profdata/suppl-instr-with-sample.test
@@ -93,6 +93,14 @@ MIX5-NEXT: Maximum internal block count: 2000
 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: 4 blocks with count >= 500 account for 99 percentage of the total cou
 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.

diff  --git a/llvm/tools/llvm-profdata/llvm-profdata.cpp b/llvm/tools/llvm-profdata/llvm-profdata.cpp
index df56a76b1552e..b9245fdfb997b 100644
--- a/llvm/tools/llvm-profdata/llvm-profdata.cpp
+++ b/llvm/tools/llvm-profdata/llvm-profdata.cpp
@@ -2133,7 +2133,7 @@ static int showInstrProfile(const std::string &Filename, bool ShowCounts,
   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())


        


More information about the llvm-commits mailing list