@@ -779,21 +779,21 @@ want_inline_small_function_p (struct cgraph_edge *e, bool report)
779
779
{
780
780
int growth = estimate_edge_growth (e );
781
781
ipa_hints hints = estimate_edge_hints (e );
782
- bool big_speedup = big_speedup_p ( e );
782
+ int big_speedup = -1 ; /* compute this lazily */
783
783
784
784
if (growth <= 0 )
785
785
;
786
786
/* Apply MAX_INLINE_INSNS_SINGLE limit. Do not do so when
787
787
hints suggests that inlining given function is very profitable. */
788
788
else if (DECL_DECLARED_INLINE_P (callee -> decl )
789
789
&& growth >= MAX_INLINE_INSNS_SINGLE
790
- && ((! big_speedup
791
- && !(hints & (INLINE_HINT_indirect_call
790
+ && (growth >= MAX_INLINE_INSNS_SINGLE * 16
791
+ || ( !(hints & (INLINE_HINT_indirect_call
792
792
| INLINE_HINT_known_hot
793
793
| INLINE_HINT_loop_iterations
794
794
| INLINE_HINT_array_index
795
- | INLINE_HINT_loop_stride )))
796
- || growth >= MAX_INLINE_INSNS_SINGLE * 16 ))
795
+ | INLINE_HINT_loop_stride ))
796
+ && !( big_speedup = big_speedup_p ( e ))) ))
797
797
{
798
798
e -> inline_failed = CIF_MAX_INLINE_INSNS_SINGLE_LIMIT ;
799
799
want_inline = false;
@@ -813,15 +813,15 @@ want_inline_small_function_p (struct cgraph_edge *e, bool report)
813
813
Upgrade it to MAX_INLINE_INSNS_SINGLE when hints suggests that
814
814
inlining given function is very profitable. */
815
815
else if (!DECL_DECLARED_INLINE_P (callee -> decl )
816
- && !big_speedup
817
816
&& !(hints & INLINE_HINT_known_hot )
818
817
&& growth >= ((hints & (INLINE_HINT_indirect_call
819
818
| INLINE_HINT_loop_iterations
820
819
| INLINE_HINT_array_index
821
820
| INLINE_HINT_loop_stride ))
822
821
? MAX (MAX_INLINE_INSNS_AUTO ,
823
822
MAX_INLINE_INSNS_SINGLE )
824
- : MAX_INLINE_INSNS_AUTO ))
823
+ : MAX_INLINE_INSNS_AUTO )
824
+ && !(big_speedup == -1 ? big_speedup_p (e ) : big_speedup ))
825
825
{
826
826
/* growth_likely_positive is expensive, always test it last. */
827
827
if (growth >= MAX_INLINE_INSNS_SINGLE
0 commit comments