+2018-11-07 Richard Biener <rguenther@suse.de>
+
+ * ipa-inline.c (want_inline_small_function_p): Compute
+ big_speedup_p lazily and last.
+
2018-11-07 Jan Hubicka <jh@suse.cz>
* tree.c (fld_type_variant_equal_p): Skip TYPE_ALIGN check when
{
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)
;
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;
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
| 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