[PATCH] D124233: [InlineCost] Set LastCallToStaticBonus in ML inlining models.

JunMa via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 22 00:16:56 PDT 2022


junparser created this revision.
junparser added reviewers: jacobhegna, mtrofin.
Herald added subscribers: ChuanqiXu, haicheng, hiraditya, inglorion.
Herald added a project: All.
junparser requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

This patch set LastCallToStaticBonus based on check, it has
no noticeable size reduction on an internal workload and linux kernel
with Os/Oz.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D124233

Files:
  llvm/lib/Analysis/InlineCost.cpp


Index: llvm/lib/Analysis/InlineCost.cpp
===================================================================
--- llvm/lib/Analysis/InlineCost.cpp
+++ llvm/lib/Analysis/InlineCost.cpp
@@ -1203,6 +1203,10 @@
     set(InlineCostFeatureIndex::ColdCcPenalty,
         (F.getCallingConv() == CallingConv::Cold));
 
+    set(InlineCostFeatureIndex::LastCallToStaticBonus,
+        (F.hasLocalLinkage() && F.hasOneLiveUse() &&
+         &F == CandidateCall.getCalledFunction()));
+
     // FIXME: we shouldn't repeat this logic in both the Features and Cost
     // analyzer - instead, we should abstract it to a common method in the
     // CallAnalyzer


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D124233.424391.patch
Type: text/x-patch
Size: 646 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220422/8d071f62/attachment.bin>


More information about the llvm-commits mailing list