Commit 7d475a54 by Richard Biener Committed by Richard Biener

re PR ipa/67783 (quadratic time consumption in IPA inlining with -O1 and higher)

2015-10-05  Richard Biener  <rguenther@suse.de>

	PR ipa/67783
	* ipa-inline-analysis.c (estimate_function_body_sizes): Only
	consider loop header PHI defs as IVs.

From-SVN: r228472
parent 9c709f64
2015-10-05 Richard Biener <rguenther@suse.de> 2015-10-05 Richard Biener <rguenther@suse.de>
PR ipa/67783
* ipa-inline-analysis.c (estimate_function_body_sizes): Only
consider loop header PHI defs as IVs.
2015-10-05 Richard Biener <rguenther@suse.de>
* tree-ssa-pre.c (create_component_ref_by_pieces_1): Move * tree-ssa-pre.c (create_component_ref_by_pieces_1): Move
call handling ... call handling ...
(create_expression_by_pieces): ... here and build GIMPLE (create_expression_by_pieces): ... here and build GIMPLE
...@@ -2760,9 +2760,8 @@ estimate_function_body_sizes (struct cgraph_node *node, bool early) ...@@ -2760,9 +2760,8 @@ estimate_function_body_sizes (struct cgraph_node *node, bool early)
{ {
vec<edge> exits; vec<edge> exits;
edge ex; edge ex;
unsigned int j, i; unsigned int j;
struct tree_niter_desc niter_desc; struct tree_niter_desc niter_desc;
basic_block *body = get_loop_body (loop);
bb_predicate = *(struct predicate *) loop->header->aux; bb_predicate = *(struct predicate *) loop->header->aux;
exits = get_loop_exit_edges (loop); exits = get_loop_exit_edges (loop);
...@@ -2788,24 +2787,15 @@ estimate_function_body_sizes (struct cgraph_node *node, bool early) ...@@ -2788,24 +2787,15 @@ estimate_function_body_sizes (struct cgraph_node *node, bool early)
} }
exits.release (); exits.release ();
for (i = 0; i < loop->num_nodes; i++) for (gphi_iterator gsi = gsi_start_phis (loop->header);
!gsi_end_p (gsi); gsi_next (&gsi))
{ {
gimple_stmt_iterator gsi; gphi *phi = gsi.phi ();
bb_predicate = *(struct predicate *) body[i]->aux; tree use = gimple_phi_result (phi);
for (gsi = gsi_start_bb (body[i]); !gsi_end_p (gsi);
gsi_next (&gsi))
{
gimple *stmt = gsi_stmt (gsi);
affine_iv iv; affine_iv iv;
ssa_op_iter iter;
tree use;
FOR_EACH_SSA_TREE_OPERAND (use, stmt, iter, SSA_OP_USE)
{
predicate will_be_nonconstant; predicate will_be_nonconstant;
if (virtual_operand_p (use)
if (!simple_iv || !simple_iv (loop, loop, use, &iv, true)
(loop, loop_containing_stmt (stmt), use, &iv, true)
|| is_gimple_min_invariant (iv.step)) || is_gimple_min_invariant (iv.step))
continue; continue;
will_be_nonconstant will_be_nonconstant
...@@ -2813,22 +2803,17 @@ estimate_function_body_sizes (struct cgraph_node *node, bool early) ...@@ -2813,22 +2803,17 @@ estimate_function_body_sizes (struct cgraph_node *node, bool early)
iv.step, iv.step,
nonconstant_names); nonconstant_names);
if (!true_predicate_p (&will_be_nonconstant)) if (!true_predicate_p (&will_be_nonconstant))
will_be_nonconstant will_be_nonconstant = and_predicates (info->conds,
= and_predicates (info->conds,
&bb_predicate, &bb_predicate,
&will_be_nonconstant); &will_be_nonconstant);
if (!true_predicate_p (&will_be_nonconstant) if (!true_predicate_p (&will_be_nonconstant)
&& !false_predicate_p (&will_be_nonconstant)) && !false_predicate_p (&will_be_nonconstant))
/* This is slightly inprecise. We may want to represent /* This is slightly inprecise. We may want to represent
each loop with independent predicate. */ each loop with independent predicate. */
loop_stride = loop_stride = and_predicates (info->conds, &loop_stride,
and_predicates (info->conds, &loop_stride,
&will_be_nonconstant); &will_be_nonconstant);
} }
} }
}
free (body);
}
set_hint_predicate (&inline_summaries->get (node)->loop_iterations, set_hint_predicate (&inline_summaries->get (node)->loop_iterations,
loop_iterations); loop_iterations);
set_hint_predicate (&inline_summaries->get (node)->loop_stride, loop_stride); set_hint_predicate (&inline_summaries->get (node)->loop_stride, loop_stride);
......
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