[llvm] [BFI] Remove AllowSynthetic parameter (PR #227469)

Aiden Grossman via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 2 13:55:58 PDT 2026


https://github.com/boomanaiden154 updated https://github.com/llvm/llvm-project/pull/227469

>From 7fb4380fd9eba056a61d8d1eeff53e0ffcf5c773 Mon Sep 17 00:00:00 2001
From: Aiden Grossman <aidengrossman at google.com>
Date: Tue, 29 Sep 2026 21:01:05 +0000
Subject: [PATCH] [BFI] Remove AllowSynthetic parameter

Support for synthetic profile information was mostly removed a while
ago. This parameter does nothing and was apparently left over, so remove
it.
---
 llvm/include/llvm/Analysis/BlockFrequencyInfo.h | 2 +-
 llvm/lib/Analysis/BlockFrequencyInfo.cpp        | 3 +--
 llvm/lib/Transforms/Coroutines/CoroSplit.cpp    | 3 +--
 llvm/lib/Transforms/IPO/MergeFunctions.cpp      | 2 +-
 4 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/llvm/include/llvm/Analysis/BlockFrequencyInfo.h b/llvm/include/llvm/Analysis/BlockFrequencyInfo.h
index c5120eca584f5..88d4e6325bf3d 100644
--- a/llvm/include/llvm/Analysis/BlockFrequencyInfo.h
+++ b/llvm/include/llvm/Analysis/BlockFrequencyInfo.h
@@ -70,7 +70,7 @@ class BlockFrequencyInfo {
   /// This computes the relative block frequency of \p BB and multiplies it by
   /// the enclosing function's count (if available) and returns the value.
   LLVM_ABI std::optional<uint64_t>
-  getBlockProfileCount(const BasicBlock *BB, bool AllowSynthetic = false) const;
+  getBlockProfileCount(const BasicBlock *BB) const;
 
   /// Returns the estimated profile count of \p Freq.
   /// This uses the frequency \p Freq and multiplies it by
diff --git a/llvm/lib/Analysis/BlockFrequencyInfo.cpp b/llvm/lib/Analysis/BlockFrequencyInfo.cpp
index 5f8f073c1de8c..d6802708885c1 100644
--- a/llvm/lib/Analysis/BlockFrequencyInfo.cpp
+++ b/llvm/lib/Analysis/BlockFrequencyInfo.cpp
@@ -202,8 +202,7 @@ BlockFrequency BlockFrequencyInfo::getBlockFreq(const BasicBlock *BB) const {
 }
 
 std::optional<uint64_t>
-BlockFrequencyInfo::getBlockProfileCount(const BasicBlock *BB,
-                                         bool AllowSynthetic) const {
+BlockFrequencyInfo::getBlockProfileCount(const BasicBlock *BB) const {
   if (!BFI)
     return std::nullopt;
 
diff --git a/llvm/lib/Transforms/Coroutines/CoroSplit.cpp b/llvm/lib/Transforms/Coroutines/CoroSplit.cpp
index db8f835a5cedf..62503fbae9396 100644
--- a/llvm/lib/Transforms/Coroutines/CoroSplit.cpp
+++ b/llvm/lib/Transforms/Coroutines/CoroSplit.cpp
@@ -2365,8 +2365,7 @@ PreservedAnalyses CoroSplitPass::run(LazyCallGraph::SCC &C,
 
       // Query BFI to get the actual estimated execution profile count of the
       // basic block where this suspension point resides.
-      std::optional<uint64_t> Count =
-          BFI.getBlockProfileCount(BB, /*AllowSynthetic=*/true);
+      std::optional<uint64_t> Count = BFI.getBlockProfileCount(BB);
       if (Count.has_value()) {
         if (!Shape.ResumeEntryCount.has_value()) {
           // For the first suspend point visited, initialize the total sum.
diff --git a/llvm/lib/Transforms/IPO/MergeFunctions.cpp b/llvm/lib/Transforms/IPO/MergeFunctions.cpp
index a122508d5fbad..6275f8f5c2be5 100644
--- a/llvm/lib/Transforms/IPO/MergeFunctions.cpp
+++ b/llvm/lib/Transforms/IPO/MergeFunctions.cpp
@@ -973,7 +973,7 @@ static bool isODR(const Function *F) {
 
 static uint64_t getBlockCountForMerging(const BlockFrequencyInfo &BFI,
                                         const BasicBlock *BB) {
-  if (auto Count = BFI.getBlockProfileCount(BB, /*AllowSynthetic=*/true))
+  if (auto Count = BFI.getBlockProfileCount(BB))
     return *Count;
   return 1;
 }



More information about the llvm-commits mailing list