[llvm] [InlineCost] Enable the cost benefit analysis for Sample PGO (PR #66457)

via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 14 20:18:22 PDT 2023


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-llvm-analysis
            
<details>
<summary>Changes</summary>
Enables the cost-benefit-analysis-based inliner by default if we have sample profile.
--
Full diff: https://github.com/llvm/llvm-project/pull/66457.diff

1 Files Affected:

- (modified) llvm/lib/Analysis/InlineCost.cpp (+1-1) 


<pre>
diff --git a/llvm/lib/Analysis/InlineCost.cpp b/llvm/lib/Analysis/InlineCost.cpp
index 84dc412a3ab6e18..12c7cb62e799f29 100644
--- a/llvm/lib/Analysis/InlineCost.cpp
+++ b/llvm/lib/Analysis/InlineCost.cpp
@@ -787,7 +787,7 @@ class InlineCostCallAnalyzer final : public CallAnalyzer {
         return false;
     } else {
       // Otherwise, require instrumentation profile.
-      if (!PSI-&gt;hasInstrumentationProfile())
+      if (!(PSI-&gt;hasInstrumentationProfile() || PSI-&gt;hasSampleProfile()))
         return false;
     }
 
</pre>
</details>


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


More information about the llvm-commits mailing list