Skip to content

Commit c0022b4

Browse files
committed
[InlineCost] Set LastCallToStaticBonus in ML inlining models.
This patch set LastCallToStaticBonus based on check, it has no noticeable size reduction on an internal workload and linux kernel with Os/Oz. Differential Revision: https://reviews.llvm.org/D124233
1 parent 4620032 commit c0022b4

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

llvm/lib/Analysis/InlineCost.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1203,6 +1203,10 @@ class InlineCostFeaturesAnalyzer final : public CallAnalyzer {
12031203
set(InlineCostFeatureIndex::ColdCcPenalty,
12041204
(F.getCallingConv() == CallingConv::Cold));
12051205

1206+
set(InlineCostFeatureIndex::LastCallToStaticBonus,
1207+
(F.hasLocalLinkage() && F.hasOneLiveUse() &&
1208+
&F == CandidateCall.getCalledFunction()));
1209+
12061210
// FIXME: we shouldn't repeat this logic in both the Features and Cost
12071211
// analyzer - instead, we should abstract it to a common method in the
12081212
// CallAnalyzer

0 commit comments

Comments
 (0)