aboutsummaryrefslogtreecommitdiff
path: root/gcc/ipa-inline.c
diff options
context:
space:
mode:
authorJan Hubicka <hubicka@ucw.cz>2019-11-09 18:52:56 +0100
committerJan Hubicka <hubicka@gcc.gnu.org>2019-11-09 17:52:56 +0000
commit49d9c9d283caf5918add61e5f6b35c9cd437e8b6 (patch)
tree0db402ab020b3a5690e4253c117311e4c15806b2 /gcc/ipa-inline.c
parente3bd08dde17aa654c1aecade0807251e082c702c (diff)
downloadgcc-49d9c9d283caf5918add61e5f6b35c9cd437e8b6.zip
gcc-49d9c9d283caf5918add61e5f6b35c9cd437e8b6.tar.gz
gcc-49d9c9d283caf5918add61e5f6b35c9cd437e8b6.tar.bz2
ipa-inline-analysis.c (do_estimate_growth_1): Add support for capping the growth cumulated.
* ipa-inline-analysis.c (do_estimate_growth_1): Add support for capping the growth cumulated. (offline_size): Break out from ... (estimate_growth): ... here. (check_callers): Add N, OFFLINE and MIN_SIZE and KNOWN_EDGE parameters. (growth_likely_positive): Turn to ... (growth_positive_p): Re-implement. * ipa-inline.h (growth_likely_positive): Remove. (growth_positive_p): Declare. * ipa-inline.c (want_inline_small_function_p): Use growth_positive_p. (want_inline_function_to_all_callers_p): Likewise. From-SVN: r278007
Diffstat (limited to 'gcc/ipa-inline.c')
-rw-r--r--gcc/ipa-inline.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/gcc/ipa-inline.c b/gcc/ipa-inline.c
index 9f47239..83764f6 100644
--- a/gcc/ipa-inline.c
+++ b/gcc/ipa-inline.c
@@ -883,9 +883,9 @@ want_inline_small_function_p (struct cgraph_edge *e, bool report)
&& !opt_for_fn (e->caller->decl, flag_inline_functions)
&& growth >= PARAM_VALUE (PARAM_MAX_INLINE_INSNS_SMALL))
{
- /* growth_likely_positive is expensive, always test it last. */
+ /* growth_positive_p is expensive, always test it last. */
if (growth >= inline_insns_single (e->caller, false)
- || growth_likely_positive (callee, growth))
+ || growth_positive_p (callee, e, growth))
{
e->inline_failed = CIF_NOT_DECLARED_INLINED;
want_inline = false;
@@ -899,9 +899,9 @@ want_inline_small_function_p (struct cgraph_edge *e, bool report)
|| growth >= inline_insns_auto (e->caller, true)
|| !big_speedup_p (e)))
{
- /* growth_likely_positive is expensive, always test it last. */
+ /* growth_positive_p is expensive, always test it last. */
if (growth >= inline_insns_single (e->caller, false)
- || growth_likely_positive (callee, growth))
+ || growth_positive_p (callee, e, growth))
{
if (opt_for_fn (e->caller->decl, optimize) >= 3)
e->inline_failed = CIF_MAX_INLINE_INSNS_AUTO_LIMIT;
@@ -913,7 +913,7 @@ want_inline_small_function_p (struct cgraph_edge *e, bool report)
/* If call is cold, do not inline when function body would grow. */
else if (!e->maybe_hot_p ()
&& (growth >= inline_insns_single (e->caller, false)
- || growth_likely_positive (callee, growth)))
+ || growth_positive_p (callee, e, growth)))
{
e->inline_failed = CIF_UNLIKELY_CALL;
want_inline = false;
@@ -1075,7 +1075,7 @@ want_inline_function_to_all_callers_p (struct cgraph_node *node, bool cold)
if (!node->call_for_symbol_and_aliases (has_caller_p, NULL, true))
return false;
/* Inlining into all callers would increase size? */
- if (estimate_growth (node) > 0)
+ if (growth_positive_p (node, NULL, INT_MIN) > 0)
return false;
/* All inlines must be possible. */
if (node->call_for_symbol_and_aliases (check_callers, &has_hot_call,