[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:17:18 PDT 2023


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

Enables the cost-benefit-analysis-based inliner by default if we have sample profile.

>From cac820179736a17168656eaaa6c2aedb48412499 Mon Sep 17 00:00:00 2001
From: Haohai Wen <haohai.wen at intel.com>
Date: Fri, 15 Sep 2023 10:46:11 +0800
Subject: [PATCH] [InlineCost] Enable the cost benefit analysis for Sample PGO

Enables the cost-benefit-analysis-based inliner by default if we have
sample profile.
---
 llvm/lib/Analysis/InlineCost.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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->hasInstrumentationProfile())
+      if (!(PSI->hasInstrumentationProfile() || PSI->hasSampleProfile()))
         return false;
     }
 



More information about the llvm-commits mailing list