[llvm] [SizeOpts] Remove dead struct BasicBlockBFIAdapter (NFC) (PR #222536)
Kazu Hirata via llvm-commits
llvm-commits at lists.llvm.org
Thu Sep 10 01:05:46 PDT 2026
https://github.com/kazutakahirata created https://github.com/llvm/llvm-project/pull/222536
The last uses were removed on June 28, 2023 in commit
80155cbf0be1744953edf68b9729c24bd0de79c4 when hotness/coldness queries
were refactored into templated ProfileSummaryInfo member functions.
Assisted-by: Antigravity
>From 2015a98094459545d10267180b20a817b743c0dd Mon Sep 17 00:00:00 2001
From: Kazu Hirata <kazu at google.com>
Date: Thu, 10 Sep 2026 00:46:56 -0700
Subject: [PATCH] [SizeOpts] Remove dead struct BasicBlockBFIAdapter (NFC)
The last uses were removed on June 28, 2023 in commit
80155cbf0be1744953edf68b9729c24bd0de79c4 when hotness/coldness queries
were refactored into templated ProfileSummaryInfo member functions.
Assisted-by: Antigravity
---
llvm/lib/Transforms/Utils/SizeOpts.cpp | 38 --------------------------
1 file changed, 38 deletions(-)
diff --git a/llvm/lib/Transforms/Utils/SizeOpts.cpp b/llvm/lib/Transforms/Utils/SizeOpts.cpp
index 7c95e7e6b996b..db5f0f1fab506 100644
--- a/llvm/lib/Transforms/Utils/SizeOpts.cpp
+++ b/llvm/lib/Transforms/Utils/SizeOpts.cpp
@@ -58,44 +58,6 @@ cl::opt<int> llvm::PgsoCutoffSampleProf(
cl::desc("The profile guided size optimization profile summary cutoff "
"for sample profile."));
-namespace {
-struct BasicBlockBFIAdapter {
- static bool isFunctionColdInCallGraph(const Function *F,
- ProfileSummaryInfo *PSI,
- BlockFrequencyInfo &BFI) {
- return PSI->isFunctionColdInCallGraph(F, BFI);
- }
- static bool isFunctionHotInCallGraphNthPercentile(int CutOff,
- const Function *F,
- ProfileSummaryInfo *PSI,
- BlockFrequencyInfo &BFI) {
- return PSI->isFunctionHotInCallGraphNthPercentile(CutOff, F, BFI);
- }
- static bool isFunctionColdInCallGraphNthPercentile(int CutOff,
- const Function *F,
- ProfileSummaryInfo *PSI,
- BlockFrequencyInfo &BFI) {
- return PSI->isFunctionColdInCallGraphNthPercentile(CutOff, F, BFI);
- }
- static bool isColdBlock(const BasicBlock *BB,
- ProfileSummaryInfo *PSI,
- BlockFrequencyInfo *BFI) {
- return PSI->isColdBlock(BB, BFI);
- }
- static bool isHotBlockNthPercentile(int CutOff,
- const BasicBlock *BB,
- ProfileSummaryInfo *PSI,
- BlockFrequencyInfo *BFI) {
- return PSI->isHotBlockNthPercentile(CutOff, BB, BFI);
- }
- static bool isColdBlockNthPercentile(int CutOff, const BasicBlock *BB,
- ProfileSummaryInfo *PSI,
- BlockFrequencyInfo *BFI) {
- return PSI->isColdBlockNthPercentile(CutOff, BB, BFI);
- }
-};
-} // end anonymous namespace
-
bool llvm::shouldOptimizeForSize(const Function *F, ProfileSummaryInfo *PSI,
BlockFrequencyInfo *BFI,
PGSOQueryType QueryType) {
More information about the llvm-commits
mailing list