Commit fd9710dc by Richard Biener Committed by Richard Biener

re PR ipa/60243 (IPA is slow on large cgraph tree)

2014-02-19  Richard Biener  <rguenther@suse.de>

	PR ipa/60243
	* tree-inline.c (estimate_num_insns): Avoid calling cgraph_get_node
	for all calls.

From-SVN: r207899
parent 73cc5f91
2014-02-19 Richard Biener <rguenther@suse.de> 2014-02-19 Richard Biener <rguenther@suse.de>
PR ipa/60243 PR ipa/60243
* tree-inline.c (estimate_num_insns): Avoid calling cgraph_get_node
for all calls.
2014-02-19 Richard Biener <rguenther@suse.de>
PR ipa/60243
* ipa-prop.c: Include stringpool.h and tree-ssanames.h. * ipa-prop.c: Include stringpool.h and tree-ssanames.h.
(ipa_modify_call_arguments): Emit an argument load explicitely and (ipa_modify_call_arguments): Emit an argument load explicitely and
preserve virtual SSA form there and for the replacement call. preserve virtual SSA form there and for the replacement call.
......
...@@ -3824,14 +3824,16 @@ estimate_num_insns (gimple stmt, eni_weights *weights) ...@@ -3824,14 +3824,16 @@ estimate_num_insns (gimple stmt, eni_weights *weights)
case GIMPLE_CALL: case GIMPLE_CALL:
{ {
tree decl; tree decl;
struct cgraph_node *node = NULL;
/* Do not special case builtins where we see the body.
This just confuse inliner. */
if (gimple_call_internal_p (stmt)) if (gimple_call_internal_p (stmt))
return 0; return 0;
else if (!(decl = gimple_call_fndecl (stmt)) else if ((decl = gimple_call_fndecl (stmt))
|| !(node = cgraph_get_node (decl)) && DECL_BUILT_IN (decl))
{
/* Do not special case builtins where we see the body.
This just confuse inliner. */
struct cgraph_node *node;
if (!(node = cgraph_get_node (decl))
|| node->definition) || node->definition)
; ;
/* For buitins that are likely expanded to nothing or /* For buitins that are likely expanded to nothing or
...@@ -3853,8 +3855,8 @@ estimate_num_insns (gimple stmt, eni_weights *weights) ...@@ -3853,8 +3855,8 @@ estimate_num_insns (gimple stmt, eni_weights *weights)
if (TREE_CODE (gimple_call_arg (stmt, 1)) == REAL_CST if (TREE_CODE (gimple_call_arg (stmt, 1)) == REAL_CST
&& REAL_VALUES_EQUAL && REAL_VALUES_EQUAL
(TREE_REAL_CST (gimple_call_arg (stmt, 1)), dconst2)) (TREE_REAL_CST (gimple_call_arg (stmt, 1)), dconst2))
return estimate_operator_cost (MULT_EXPR, weights, return estimate_operator_cost
gimple_call_arg (stmt, 0), (MULT_EXPR, weights, gimple_call_arg (stmt, 0),
gimple_call_arg (stmt, 0)); gimple_call_arg (stmt, 0));
break; break;
...@@ -3862,8 +3864,9 @@ estimate_num_insns (gimple stmt, eni_weights *weights) ...@@ -3862,8 +3864,9 @@ estimate_num_insns (gimple stmt, eni_weights *weights)
break; break;
} }
} }
}
cost = node ? weights->call_cost : weights->indirect_call_cost; cost = decl ? weights->call_cost : weights->indirect_call_cost;
if (gimple_call_lhs (stmt)) if (gimple_call_lhs (stmt))
cost += estimate_move_cost (TREE_TYPE (gimple_call_lhs (stmt))); cost += estimate_move_cost (TREE_TYPE (gimple_call_lhs (stmt)));
for (i = 0; i < gimple_call_num_args (stmt); i++) for (i = 0; i < gimple_call_num_args (stmt); i++)
......
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