Commit 128e0d89 by Jan Hubicka Committed by Jan Hubicka

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
parent cb261eb7
2012-09-12 Jan Hubicka <jh@suse.cz>
PR fortran/48636
* 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.
2012-09-12 Uros Bizjak <ubizjak@gmail.com>
* config/i386/i386.c (x86_prefetch_sse): Change to unsigned char.
......
......@@ -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)
{
......
......@@ -46,7 +46,8 @@ typedef struct GTY(()) condition
They are represtented as bitmap of the following values. */
enum inline_hints_vals {
INLINE_HINT_indirect_call = 1,
INLINE_HINT_loop_iterations = 2
INLINE_HINT_loop_iterations = 2,
INLINE_HINT_loop_stride = 4
};
typedef int inline_hints;
......@@ -120,9 +121,12 @@ struct GTY(()) inline_summary
conditions conds;
VEC(size_time_entry,gc) *entry;
/* Predicate on when some loop in the function sbecomes to have known
/* Predicate on when some loop in the function becomes to have known
bounds. */
struct predicate * GTY((skip)) loop_iterations;
/* Predicate on when some loop in the function becomes to have known
stride. */
struct predicate * GTY((skip)) loop_stride;
};
......
2012-09-12 Jan Hubicka <jh@suse.cz>
* gcc.dg/ipa/inlinehint-2.c: New testcase.
2012-09-12 H.J. Lu <hongjiu.lu@intel.com>
PR target/54445
......
/* { dg-options "-O3 -c -fdump-ipa-inline-details -fno-early-inlining -fno-ipa-cp" } */
t(int s, void **p)
{
int i;
for (i;i<10000;i+=s)
p[i]=0;
}
m(void **p)
{
t (10, p);
}
/* { dg-final { scan-ipa-dump "loop_stride" "inline" } } */
/* { dg-final { cleanup-ipa-dump "inline" } } */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment