[all-commits] [llvm/llvm-project] e2398a: [Analysis] Introduce getStaticBonusApplied (NFC)

kazutakahirata via All-commits all-commits at lists.llvm.org
Sun Sep 25 23:21:58 PDT 2022

  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: e2398a4d7cfc0415c63cc13792bda80045c7c803
  Author: Kazu Hirata <kazu at google.com>
  Date:   2022-09-25 (Sun, 25 Sep 2022)

  Changed paths:
    M llvm/include/llvm/Analysis/InlineCost.h
    M llvm/lib/Analysis/InlineCost.cpp

  Log Message:
  [Analysis] Introduce getStaticBonusApplied (NFC)

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

This patch introduces getStaticBonusApplied 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.getStaticBonusApplied() < 0

This patch does not add a use of getStaticBonus yet.

Differential Revision: https://reviews.llvm.org/D134373

More information about the All-commits mailing list