Skip to content

Commit 296b0b0

Browse files
rguenthRichard Biener
authored andcommitted
ipa-inline.c (want_inline_small_function_p): Compute big_speedup_p lazily and last.
2018-11-07 Richard Biener <[email protected]> * ipa-inline.c (want_inline_small_function_p): Compute big_speedup_p lazily and last. From-SVN: r265873
1 parent 6fe2da9 commit 296b0b0

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed

gcc/ChangeLog

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
2018-11-07 Richard Biener <[email protected]>
2+
3+
* ipa-inline.c (want_inline_small_function_p): Compute
4+
big_speedup_p lazily and last.
5+
16
2018-11-07 Jan Hubicka <[email protected]>
27

38
* tree.c (fld_type_variant_equal_p): Skip TYPE_ALIGN check when

gcc/ipa-inline.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -779,21 +779,21 @@ want_inline_small_function_p (struct cgraph_edge *e, bool report)
779779
{
780780
int growth = estimate_edge_growth (e);
781781
ipa_hints hints = estimate_edge_hints (e);
782-
bool big_speedup = big_speedup_p (e);
782+
int big_speedup = -1; /* compute this lazily */
783783

784784
if (growth <= 0)
785785
;
786786
/* Apply MAX_INLINE_INSNS_SINGLE limit. Do not do so when
787787
hints suggests that inlining given function is very profitable. */
788788
else if (DECL_DECLARED_INLINE_P (callee->decl)
789789
&& 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
792792
| INLINE_HINT_known_hot
793793
| INLINE_HINT_loop_iterations
794794
| 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)))))
797797
{
798798
e->inline_failed = CIF_MAX_INLINE_INSNS_SINGLE_LIMIT;
799799
want_inline = false;
@@ -813,15 +813,15 @@ want_inline_small_function_p (struct cgraph_edge *e, bool report)
813813
Upgrade it to MAX_INLINE_INSNS_SINGLE when hints suggests that
814814
inlining given function is very profitable. */
815815
else if (!DECL_DECLARED_INLINE_P (callee->decl)
816-
&& !big_speedup
817816
&& !(hints & INLINE_HINT_known_hot)
818817
&& growth >= ((hints & (INLINE_HINT_indirect_call
819818
| INLINE_HINT_loop_iterations
820819
| INLINE_HINT_array_index
821820
| INLINE_HINT_loop_stride))
822821
? MAX (MAX_INLINE_INSNS_AUTO,
823822
MAX_INLINE_INSNS_SINGLE)
824-
: MAX_INLINE_INSNS_AUTO))
823+
: MAX_INLINE_INSNS_AUTO)
824+
&& !(big_speedup == -1 ? big_speedup_p (e) : big_speedup))
825825
{
826826
/* growth_likely_positive is expensive, always test it last. */
827827
if (growth >= MAX_INLINE_INSNS_SINGLE

0 commit comments

Comments
 (0)