diff --git a/gcc/ChangeLog b/gcc/ChangeLog index f8295d5e86f..899e3fa37e2 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2018-11-07 Richard Biener + + * ipa-inline.c (want_inline_small_function_p): Compute + big_speedup_p lazily and last. + 2018-11-07 Jan Hubicka * tree.c (fld_type_variant_equal_p): Skip TYPE_ALIGN check when diff --git a/gcc/ipa-inline.c b/gcc/ipa-inline.c index 4f8ed1520f1..bcd16537461 100644 --- a/gcc/ipa-inline.c +++ b/gcc/ipa-inline.c @@ -779,7 +779,7 @@ want_inline_small_function_p (struct cgraph_edge *e, bool report) { int growth = estimate_edge_growth (e); ipa_hints hints = estimate_edge_hints (e); - bool big_speedup = big_speedup_p (e); + int big_speedup = -1; /* compute this lazily */ if (growth <= 0) ; @@ -787,13 +787,13 @@ want_inline_small_function_p (struct cgraph_edge *e, bool report) hints suggests that inlining given function is very profitable. */ else if (DECL_DECLARED_INLINE_P (callee->decl) && growth >= MAX_INLINE_INSNS_SINGLE - && ((!big_speedup - && !(hints & (INLINE_HINT_indirect_call + && (growth >= MAX_INLINE_INSNS_SINGLE * 16 + || (!(hints & (INLINE_HINT_indirect_call | INLINE_HINT_known_hot | INLINE_HINT_loop_iterations | INLINE_HINT_array_index - | INLINE_HINT_loop_stride))) - || growth >= MAX_INLINE_INSNS_SINGLE * 16)) + | INLINE_HINT_loop_stride)) + && !(big_speedup = big_speedup_p (e))))) { e->inline_failed = CIF_MAX_INLINE_INSNS_SINGLE_LIMIT; want_inline = false; @@ -813,7 +813,6 @@ want_inline_small_function_p (struct cgraph_edge *e, bool report) Upgrade it to MAX_INLINE_INSNS_SINGLE when hints suggests that inlining given function is very profitable. */ else if (!DECL_DECLARED_INLINE_P (callee->decl) - && !big_speedup && !(hints & INLINE_HINT_known_hot) && growth >= ((hints & (INLINE_HINT_indirect_call | INLINE_HINT_loop_iterations @@ -821,7 +820,8 @@ want_inline_small_function_p (struct cgraph_edge *e, bool report) | INLINE_HINT_loop_stride)) ? MAX (MAX_INLINE_INSNS_AUTO, MAX_INLINE_INSNS_SINGLE) - : MAX_INLINE_INSNS_AUTO)) + : MAX_INLINE_INSNS_AUTO) + && !(big_speedup == -1 ? big_speedup_p (e) : big_speedup)) { /* growth_likely_positive is expensive, always test it last. */ if (growth >= MAX_INLINE_INSNS_SINGLE