aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2018-11-07 13:18:36 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2018-11-07 13:18:36 +0000
commit296b0b042ae6de0541b07a3169f9d12a92a3d672 (patch)
treed234f9310e16fee382da3ac61590ce0cfc733b77
parent6fe2da9fafe878a361e2d23821d590fd53ef99bd (diff)
downloadgcc-296b0b042ae6de0541b07a3169f9d12a92a3d672.zip
gcc-296b0b042ae6de0541b07a3169f9d12a92a3d672.tar.gz
gcc-296b0b042ae6de0541b07a3169f9d12a92a3d672.tar.bz2
ipa-inline.c (want_inline_small_function_p): Compute big_speedup_p lazily and last.
2018-11-07 Richard Biener <rguenther@suse.de> * ipa-inline.c (want_inline_small_function_p): Compute big_speedup_p lazily and last. From-SVN: r265873
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/ipa-inline.c14
2 files changed, 12 insertions, 7 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index f8295d5..899e3fa 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+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
diff --git a/gcc/ipa-inline.c b/gcc/ipa-inline.c
index 4f8ed15..bcd1653 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