[llvm] [Inliner] Don't apply the cold-callsite threshold in non-callable functions (PR #211255)

Spencer Bryngelson via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 3 06:57:41 PDT 2026


================
@@ -2151,7 +2151,13 @@ void InlineCostCallAnalyzer::updateThreshold(CallBase &Call, Function &Callee) {
       // behavior to prevent inlining of hot callsites during ThinLTO
       // compile phase.
       Threshold = *HotCallSiteThreshold;
-    } else if (isColdCallSite(Call, CallerBFI)) {
+    } else if (isColdCallSite(Call, CallerBFI) &&
+               isCallableCC(Caller->getCallingConv())) {
----------------
sbryngelson wrote:

Applied, sorry for the delay - I replied to your description comment and missed this inline suggestion.

`isCallableCC` is `constexpr` while `isColdCallSite` does BFI block-frequency queries, so putting the cheap one first short-circuits those away for kernels. Both are pure, so the result is unchanged. clang-format left the continuation aligned to the open paren; `git-clang-format --diff origin/main` is clean.

Inline suite: 291 passed, 1 expected failure, no failures.


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


More information about the llvm-commits mailing list