[Inliner] Compute the full cost for the cost benefit analsysis
authorKazu Hirata <kazu@google.com>
Tue, 5 Jan 2021 20:48:49 +0000 (12:48 -0800)
committerKazu Hirata <kazu@google.com>
Tue, 5 Jan 2021 20:48:49 +0000 (12:48 -0800)
commit65cd3cbb3fc9ee440234a5adbfea6cbe4834f3d3
treef2d5a2bf40e5cc6b682c62e402b2733fe04ebc4d
parent4ef91f5871a3c38bb2324f89b47a2a845e8a33fd
[Inliner] Compute the full cost for the cost benefit analsysis

This patch teaches the inliner to compute the full cost for a call
site where the newly introduced cost benefit analysis is enabled.

Note that the cost benefit analysis requires the full cost to be
computed.  However, without this patch or the -inline-cost-full
option, the early termination logic would kick in when the cost
exceeds the threshold, so we don't get to perform the cost benefit
analysis.  For this reason, we would need to specify four clang
options:

  -mllvm -inline-cost-full
  -mllvm -inline-enable-cost-benefit-analysis

This patch eliminates the need to specify -inline-cost-full.

Differential Revision: https://reviews.llvm.org/D93658
llvm/lib/Analysis/InlineCost.cpp