[PATCH] D134373: [Analysis] Introduce getLastCallToStaticBonusApplied

Kazu Hirata via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 21 10:11:43 PDT 2022


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

InlineCostCallAnalyzer encourages inlining of the last call to the
static function by subtracting LastCallToStaticBonus from Cost.

This patch introduces getLastCallToStaticBonusApplied to make
available the amount of LastCallToStaticBonus applied.

The intent is to allow the module inliner to determine whether
inlining a given call site is expected to reduce the caller size with
an expression like:

  IC.getCost() + IC.getLastCallToStaticBonusApplied() < 0

This patch does not add a use of getLastCallToStaticBonus yet.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D134373

Files:
  llvm/include/llvm/Analysis/InlineCost.h
  llvm/lib/Analysis/InlineCost.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D134373.461941.patch
Type: text/x-patch
Size: 4557 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220921/8d779d4b/attachment.bin>


More information about the llvm-commits mailing list