[llvm] [PSI] Drop AllowSynthetic parameter to getProfileCount (PR #204765)

via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 19 15:52:35 PDT 2026


llvmorg-github-actions[bot] wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-llvm-analysis

Author: Aiden Grossman (boomanaiden154)

<details>
<summary>Changes</summary>

This was not set anywhere and synthetic profile counts are not
emitted/used anywhere, so remove it.


---
Full diff: https://github.com/llvm/llvm-project/pull/204765.diff


2 Files Affected:

- (modified) llvm/include/llvm/Analysis/ProfileSummaryInfo.h (+1-2) 
- (modified) llvm/lib/Analysis/ProfileSummaryInfo.cpp (+4-3) 


``````````diff
diff --git a/llvm/include/llvm/Analysis/ProfileSummaryInfo.h b/llvm/include/llvm/Analysis/ProfileSummaryInfo.h
index 96af93dfc9cf4..7038b4efebf2e 100644
--- a/llvm/include/llvm/Analysis/ProfileSummaryInfo.h
+++ b/llvm/include/llvm/Analysis/ProfileSummaryInfo.h
@@ -102,8 +102,7 @@ class ProfileSummaryInfo {
 
   /// Returns the profile count for \p CallInst.
   LLVM_ABI std::optional<uint64_t>
-  getProfileCount(const CallBase &CallInst, BlockFrequencyInfo *BFI,
-                  bool AllowSynthetic = false) const;
+  getProfileCount(const CallBase &CallInst, BlockFrequencyInfo *BFI) const;
   /// Returns true if module \c M has partial-profile sample profile.
   LLVM_ABI bool hasPartialSampleProfile() const;
   /// Returns true if the working set size of the code is considered huge.
diff --git a/llvm/lib/Analysis/ProfileSummaryInfo.cpp b/llvm/lib/Analysis/ProfileSummaryInfo.cpp
index 44d7a175cc7fe..59726e8ecdab1 100644
--- a/llvm/lib/Analysis/ProfileSummaryInfo.cpp
+++ b/llvm/lib/Analysis/ProfileSummaryInfo.cpp
@@ -75,8 +75,9 @@ void ProfileSummaryInfo::refresh(std::unique_ptr<ProfileSummary> &&Other) {
   computeThresholds();
 }
 
-std::optional<uint64_t> ProfileSummaryInfo::getProfileCount(
-    const CallBase &Call, BlockFrequencyInfo *BFI, bool AllowSynthetic) const {
+std::optional<uint64_t>
+ProfileSummaryInfo::getProfileCount(const CallBase &Call,
+                                    BlockFrequencyInfo *BFI) const {
   assert((isa<CallInst>(Call) || isa<InvokeInst>(Call)) &&
          "We can only get profile count for call/invoke instruction.");
   if (hasSampleProfile()) {
@@ -90,7 +91,7 @@ std::optional<uint64_t> ProfileSummaryInfo::getProfileCount(
     return std::nullopt;
   }
   if (BFI)
-    return BFI->getBlockProfileCount(Call.getParent(), AllowSynthetic);
+    return BFI->getBlockProfileCount(Call.getParent());
   return std::nullopt;
 }
 

``````````

</details>


https://github.com/llvm/llvm-project/pull/204765


More information about the llvm-commits mailing list