[Analysis] Introduce getStaticBonusApplied (NFC)
authorKazu Hirata <kazu@google.com>
Mon, 26 Sep 2022 06:21:40 +0000 (23:21 -0700)
committerKazu Hirata <kazu@google.com>
Mon, 26 Sep 2022 06:21:40 +0000 (23:21 -0700)
commite2398a4d7cfc0415c63cc13792bda80045c7c803
treec6d99d71ce8627c28bcd8b039c32d93379eb8957
parent06b1e5fdc32db61b59ad9ca605137d2a369e562e
[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
llvm/include/llvm/Analysis/InlineCost.h
llvm/lib/Analysis/InlineCost.cpp