Commit 0d4958d0 by Jan Hubicka Committed by Jan Hubicka

re PR tree-optimization/40556 (ICE in IPA-CP with recursion)


	* ipa-cp.c (ipcp_read_summary): Remove now invalid FIXME and
	flag_ltrans check.
	* ipa-inline.c (cgraph_mark_inline_edge,
	cgraph_decide_inlining_of_small_function,
	cgraph_decide_inlining, inline_read_summary): Disable indirect inlining
	for WPA for time being.

	PR tree-optimize/40556                                                                                                                                         
	* ipa-inline.c (cgraph_early_inlining): Fix iterations condition.

Fix PR number for earlier patch to:
	PR lto/41730

From-SVN: r153456
parent 848af81e
2009-10-22 Jan Hubicka <jh@suse.cz>
* ipa-cp.c (ipcp_read_summary): Remove now invalid FIXME and
flag_ltrans check.
* ipa-inline.c (cgraph_mark_inline_edge,
cgraph_decide_inlining_of_small_function,
cgraph_decide_inlining, inline_read_summary): Disable indirect inlining
for WPA for time being.
PR tree-optimize/40556
* ipa-inline.c (cgraph_early_inlining): Fix iterations condition.
2009-10-22 Richard Guenther <rguenther@suse.de> 2009-10-22 Richard Guenther <rguenther@suse.de>
* lto-streamer.h (lto_symtab_clear_resolution): Remove. * lto-streamer.h (lto_symtab_clear_resolution): Remove.
...@@ -5,7 +17,7 @@ ...@@ -5,7 +17,7 @@
2009-10-22 Jan Hubicka <jh@suse.cz> 2009-10-22 Jan Hubicka <jh@suse.cz>
PR tree-optimize/40556 PR lto/41730
* ipa-reference.c (has_proper_scope_for_analysis): Add fixme about * ipa-reference.c (has_proper_scope_for_analysis): Add fixme about
global vars. global vars.
(check_call): Handle only indirect calls. (check_call): Handle only indirect calls.
...@@ -1302,13 +1302,7 @@ ipcp_read_summary (void) ...@@ -1302,13 +1302,7 @@ ipcp_read_summary (void)
static bool static bool
cgraph_gate_cp (void) cgraph_gate_cp (void)
{ {
/* FIXME lto. IPA-CP does not tolerate running when the inlining decisions return flag_ipa_cp;
have not been applied. This happens when WPA modifies the callgraph.
Since those decisions are not applied until after all the IPA passes
have been run in LTRANS, this means that IPA passes may see partially
modified callgraphs. The solution to this is to apply WPA decisions
early during LTRANS. */
return flag_ipa_cp && !flag_ltrans;
} }
struct ipa_opt_pass_d pass_ipa_cp = struct ipa_opt_pass_d pass_ipa_cp =
......
...@@ -310,7 +310,7 @@ cgraph_mark_inline_edge (struct cgraph_edge *e, bool update_original, ...@@ -310,7 +310,7 @@ cgraph_mark_inline_edge (struct cgraph_edge *e, bool update_original,
overall_size -= orig_size; overall_size -= orig_size;
ncalls_inlined++; ncalls_inlined++;
if (flag_indirect_inlining) if (flag_indirect_inlining && !flag_wpa)
return ipa_propagate_indirect_call_infos (curr, new_edges); return ipa_propagate_indirect_call_infos (curr, new_edges);
else else
return false; return false;
...@@ -876,7 +876,7 @@ cgraph_decide_inlining_of_small_functions (void) ...@@ -876,7 +876,7 @@ cgraph_decide_inlining_of_small_functions (void)
int min_size, max_size; int min_size, max_size;
VEC (cgraph_edge_p, heap) *new_indirect_edges = NULL; VEC (cgraph_edge_p, heap) *new_indirect_edges = NULL;
if (flag_indirect_inlining) if (flag_indirect_inlining && !flag_wpa)
new_indirect_edges = VEC_alloc (cgraph_edge_p, heap, 8); new_indirect_edges = VEC_alloc (cgraph_edge_p, heap, 8);
if (dump_file) if (dump_file)
...@@ -1023,10 +1023,10 @@ cgraph_decide_inlining_of_small_functions (void) ...@@ -1023,10 +1023,10 @@ cgraph_decide_inlining_of_small_functions (void)
if (where->global.inlined_to) if (where->global.inlined_to)
where = where->global.inlined_to; where = where->global.inlined_to;
if (!cgraph_decide_recursive_inlining (where, if (!cgraph_decide_recursive_inlining (where,
flag_indirect_inlining flag_indirect_inlining && !flag_wpa
? &new_indirect_edges : NULL)) ? &new_indirect_edges : NULL))
continue; continue;
if (flag_indirect_inlining) if (flag_indirect_inlining && !flag_wpa)
add_new_edges_to_heap (heap, new_indirect_edges); add_new_edges_to_heap (heap, new_indirect_edges);
update_callee_keys (heap, where, updated_nodes); update_callee_keys (heap, where, updated_nodes);
} }
...@@ -1045,7 +1045,7 @@ cgraph_decide_inlining_of_small_functions (void) ...@@ -1045,7 +1045,7 @@ cgraph_decide_inlining_of_small_functions (void)
} }
callee = edge->callee; callee = edge->callee;
cgraph_mark_inline_edge (edge, true, &new_indirect_edges); cgraph_mark_inline_edge (edge, true, &new_indirect_edges);
if (flag_indirect_inlining) if (flag_indirect_inlining && !flag_wpa)
add_new_edges_to_heap (heap, new_indirect_edges); add_new_edges_to_heap (heap, new_indirect_edges);
update_callee_keys (heap, callee, updated_nodes); update_callee_keys (heap, callee, updated_nodes);
...@@ -1114,7 +1114,7 @@ cgraph_decide_inlining (void) ...@@ -1114,7 +1114,7 @@ cgraph_decide_inlining (void)
int initial_size = 0; int initial_size = 0;
cgraph_remove_function_insertion_hook (function_insertion_hook_holder); cgraph_remove_function_insertion_hook (function_insertion_hook_holder);
if (in_lto_p && flag_indirect_inlining) if (in_lto_p && flag_indirect_inlining && !flag_wpa)
ipa_update_after_lto_read (); ipa_update_after_lto_read ();
max_count = 0; max_count = 0;
...@@ -1268,7 +1268,7 @@ cgraph_decide_inlining (void) ...@@ -1268,7 +1268,7 @@ cgraph_decide_inlining (void)
} }
/* Free ipa-prop structures if they are no longer needed. */ /* Free ipa-prop structures if they are no longer needed. */
if (flag_indirect_inlining) if (flag_indirect_inlining && !flag_wpa)
free_all_ipa_structures_after_iinln (); free_all_ipa_structures_after_iinln ();
if (dump_file) if (dump_file)
...@@ -1589,10 +1589,10 @@ cgraph_early_inlining (void) ...@@ -1589,10 +1589,10 @@ cgraph_early_inlining (void)
if (sorrycount || errorcount) if (sorrycount || errorcount)
return 0; return 0;
while (cgraph_decide_inlining_incrementally (node, while (iterations < PARAM_VALUE (PARAM_EARLY_INLINER_MAX_ITERATIONS)
iterations && cgraph_decide_inlining_incrementally (node,
? INLINE_SIZE_NORECURSIVE : INLINE_SIZE, 0) iterations
&& iterations < PARAM_VALUE (PARAM_EARLY_INLINER_MAX_ITERATIONS)) ? INLINE_SIZE_NORECURSIVE : INLINE_SIZE, 0))
{ {
timevar_push (TV_INTEGRATION); timevar_push (TV_INTEGRATION);
todo |= optimize_inline_calls (current_function_decl); todo |= optimize_inline_calls (current_function_decl);
...@@ -1975,7 +1975,7 @@ inline_transform (struct cgraph_node *node) ...@@ -1975,7 +1975,7 @@ inline_transform (struct cgraph_node *node)
static void static void
inline_read_summary (void) inline_read_summary (void)
{ {
if (flag_indirect_inlining) if (flag_indirect_inlining && !flag_wpa)
{ {
ipa_register_cgraph_hooks (); ipa_register_cgraph_hooks ();
if (!flag_ipa_cp) if (!flag_ipa_cp)
......
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