HomePhabricator

[Inliner] Compute the full cost for the cost benefit analsysis

Authored by kazu on Tue, Jan 5, 12:48 PM.

Description

[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