[llvm-branch-commits] [llvm] [llvm-profgen] Infer callsite samples from callee head samples (PR #235988)

Kunal Pathak via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Wed Nov 18 14:09:06 PST 2026


================
@@ -219,7 +219,7 @@ bool CSPreInliner::shouldInline(ProfiledInlineCandidate &Candidate) {
       SampleThreshold *= CSPreinlMultiplierForPrevInl;
   }
 
-  return (Candidate.SizeCost < SampleThreshold);
+  return (Candidate.SizeCost <= SampleThreshold);
----------------
kunalspathak wrote:

This changes the boundary for every candidate, not just zero-size ones, and the [compiler side uses `Cost < Threshold`](https://github.com/llvm/llvm-project/blob/3c67042a157a3b92902ed7d28bc9dec81ddc8dea/llvm/include/llvm/Analysis/InlineCost.h#L140-L141). Could we special-case it instead, e.g. `Candidate.SizeCost == 0 || Candidate.SizeCost < SampleThreshold`?

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


More information about the llvm-branch-commits mailing list