aboutsummaryrefslogtreecommitdiff
path: root/gcc/ipa-inline.c
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2012-09-12 23:51:14 +0200
committerJan Hubicka <hubicka@gcc.gnu.org>2012-09-12 21:51:14 +0000
commit128e0d8944bc22b8af774c8253462ae5525bb0f5 (patch)
treeb96eb907a02e6b06812636a77d534f0a89958844 /gcc/ipa-inline.c
parentcb261eb7275388a6a96a4cb388dee97274e05c45 (diff)
downloadgcc-128e0d8944bc22b8af774c8253462ae5525bb0f5.zip
gcc-128e0d8944bc22b8af774c8253462ae5525bb0f5.tar.gz
gcc-128e0d8944bc22b8af774c8253462ae5525bb0f5.tar.bz2
re PR fortran/48636 (Enable more inlining with -O2 and higher)
PR fortran/48636 * gcc.dg/ipa/inlinehint-2.c: New testcase. * ipa-inline-analysis.c (dump_inline_hints): Dump loop stride. (set_hint_predicate): New function. (reset_inline_summary): Reset loop stride. (remap_predicate_after_duplication): New function. (remap_hint_predicate_after_duplication): New function. (inline_node_duplication_hook): Update. (dump_inline_summary): Dump stride summaries. (estimate_function_body_sizes): Compute strides. (remap_hint_predicate): New function. (inline_merge_summary): Use it. (inline_read_section): Read stride. (inline_write_summary): Write stride. * ipa-inline.c (want_inline_small_function_p): Handle strides. (edge_badness): Likewise. * ipa-inline.h (inline_hints_vals): Add stride hint. (inline_summary): Update stride. From-SVN: r191232
Diffstat (limited to 'gcc/ipa-inline.c')
-rw-r--r--gcc/ipa-inline.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/gcc/ipa-inline.c b/gcc/ipa-inline.c
index 95842bd..f5c255c 100644
--- a/gcc/ipa-inline.c
+++ b/gcc/ipa-inline.c
@@ -481,7 +481,8 @@ want_inline_small_function_p (struct cgraph_edge *e, bool report)
else if (DECL_DECLARED_INLINE_P (callee->symbol.decl)
&& growth >= MAX_INLINE_INSNS_SINGLE
&& !(hints & (INLINE_HINT_indirect_call
- | INLINE_HINT_loop_iterations)))
+ | INLINE_HINT_loop_iterations
+ | INLINE_HINT_loop_stride)))
{
e->inline_failed = CIF_MAX_INLINE_INSNS_SINGLE_LIMIT;
want_inline = false;
@@ -533,7 +534,8 @@ want_inline_small_function_p (struct cgraph_edge *e, bool report)
inlining given function is very profitable. */
else if (!DECL_DECLARED_INLINE_P (callee->symbol.decl)
&& growth >= ((hints & (INLINE_HINT_indirect_call
- | INLINE_HINT_loop_iterations))
+ | INLINE_HINT_loop_iterations
+ | INLINE_HINT_loop_stride))
? MAX (MAX_INLINE_INSNS_AUTO,
MAX_INLINE_INSNS_SINGLE)
: MAX_INLINE_INSNS_AUTO))
@@ -866,7 +868,8 @@ edge_badness (struct cgraph_edge *edge, bool dump)
fprintf (dump_file, "Badness overflow\n");
}
if (hints & (INLINE_HINT_indirect_call
- | INLINE_HINT_loop_iterations))
+ | INLINE_HINT_loop_iterations
+ | INLINE_HINT_loop_stride))
badness /= 8;
if (dump)
{