[llvm-branch-commits] [llvm] [BOLT] Add profile density computation (PR #101094)

Amir Ayupov via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Fri Aug 9 11:17:07 PDT 2024


https://github.com/aaupov updated https://github.com/llvm/llvm-project/pull/101094

>From f598510001859a29f6f1ff6362fb9950ab6340cd Mon Sep 17 00:00:00 2001
From: Amir Ayupov <aaupov at fb.com>
Date: Mon, 29 Jul 2024 16:14:08 -0700
Subject: [PATCH 1/2] Update test to check the option with llvm-bolt with
 fdata, YAML, and pre-aggregated profile

Created using spr 1.3.4
---
 bolt/test/X86/pre-aggregated-perf.test | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/bolt/test/X86/pre-aggregated-perf.test b/bolt/test/X86/pre-aggregated-perf.test
index fc6f332d53dfb8..0f5137309e85d1 100644
--- a/bolt/test/X86/pre-aggregated-perf.test
+++ b/bolt/test/X86/pre-aggregated-perf.test
@@ -15,9 +15,15 @@ RUN:   --show-density --profile-density-threshold=9 \
 RUN:   --profile-density-cutoff-hot=970000 \
 RUN:   --profile-use-dfs | FileCheck %s
 
-RUN: llvm-bolt %t.exe -data %t -o %t.null | FileCheck %s
-RUN: llvm-bolt %t.exe -data %t.new -o %t.null | FileCheck %s
-RUN: llvm-bolt %t.exe -p %p/Inputs/pre-aggregated.txt --pa -o %t.null | FileCheck %s
+RUN: llvm-bolt %t.exe -data %t -o %t.null \
+RUN:   --show-density --profile-density-threshold=9 \
+RUN:   --profile-density-cutoff-hot=970000 | FileCheck %s
+RUN: llvm-bolt %t.exe -data %t.new -o %t.null \
+RUN:   --show-density --profile-density-threshold=9 \
+RUN:   --profile-density-cutoff-hot=970000 | FileCheck %s
+RUN: llvm-bolt %t.exe -p %p/Inputs/pre-aggregated.txt --pa -o %t.null \
+RUN:   --show-density --profile-density-threshold=9 \
+RUN:   --profile-density-cutoff-hot=970000 | FileCheck %s
 
 CHECK: BOLT-INFO: 4 out of 7 functions in the binary (57.1%) have non-empty execution profile
 CHECK: BOLT-INFO: Functions with density >= 9.4 account for 97.00% total sample counts.

>From e91907e57b39c8c79eb58b4d28d78fa253b130cb Mon Sep 17 00:00:00 2001
From: Amir Ayupov <aaupov at fb.com>
Date: Mon, 29 Jul 2024 20:09:08 -0700
Subject: [PATCH 2/2] show-density init(true)

Created using spr 1.3.4
---
 bolt/lib/Passes/BinaryPasses.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bolt/lib/Passes/BinaryPasses.cpp b/bolt/lib/Passes/BinaryPasses.cpp
index 23009bf74e0773..83fd6b2562eca8 100644
--- a/bolt/lib/Passes/BinaryPasses.cpp
+++ b/bolt/lib/Passes/BinaryPasses.cpp
@@ -224,7 +224,7 @@ static cl::opt<unsigned> TopCalledLimit(
     cl::init(100), cl::Hidden, cl::cat(BoltCategory));
 
 // Profile density options, synced with llvm-profgen/ProfileGenerator.cpp
-static cl::opt<bool> ShowDensity("show-density", cl::init(false),
+static cl::opt<bool> ShowDensity("show-density", cl::init(true),
                                  cl::desc("show profile density details"),
                                  cl::Optional);
 



More information about the llvm-branch-commits mailing list