Commit 63cf7260 by Jan Hubicka Committed by Jan Hubicka

* ipa-inline-analysis.c (eliminated_by_inlining_prob): Cleanup.

From-SVN: r192991
parent e152d14c
2012-10-30 Jan Hubicka <jh@suse.cz>
* ipa-inline-analysis.c (eliminated_by_inlining_prob): Cleanup.
2012-10-30 Jan Hubicka <jh@suse.cz>
* tree-ssa-loop-niter.c (number_of_iterations_exit): New parameter
EVERY_ITERATION with implicit value of true.
(record_estimate): Check dominance relationship of the basic block
......@@ -1548,6 +1548,7 @@ static int
eliminated_by_inlining_prob (gimple stmt)
{
enum gimple_code code = gimple_code (stmt);
enum tree_code rhs_code;
if (!optimize)
return 0;
......@@ -1560,14 +1561,16 @@ eliminated_by_inlining_prob (gimple stmt)
if (gimple_num_ops (stmt) != 2)
return 0;
rhs_code = gimple_assign_rhs_code (stmt);
/* Casts of parameters, loads from parameters passed by reference
and stores to return value or parameters are often free after
inlining dua to SRA and further combining.
Assume that half of statements goes away. */
if (gimple_assign_rhs_code (stmt) == CONVERT_EXPR
|| gimple_assign_rhs_code (stmt) == NOP_EXPR
|| gimple_assign_rhs_code (stmt) == VIEW_CONVERT_EXPR
|| gimple_assign_rhs_code (stmt) == ADDR_EXPR
if (rhs_code == CONVERT_EXPR
|| rhs_code == NOP_EXPR
|| rhs_code == VIEW_CONVERT_EXPR
|| rhs_code == ADDR_EXPR
|| gimple_assign_rhs_class (stmt) == GIMPLE_SINGLE_RHS)
{
tree rhs = gimple_assign_rhs1 (stmt);
......@@ -1592,13 +1595,10 @@ eliminated_by_inlining_prob (gimple stmt)
tree op = get_base_address (TREE_OPERAND (inner_rhs, 0));
if (TREE_CODE (op) == PARM_DECL)
rhs_free = true;
else if (TREE_CODE (op) == MEM_REF)
{
op = get_base_address (TREE_OPERAND (op, 0));
if (unmodified_parm (stmt, op))
else if (TREE_CODE (op) == MEM_REF
&& unmodified_parm (stmt, TREE_OPERAND (op, 0)))
rhs_free = true;
}
}
/* When parameter is not SSA register because its address is taken
and it is just copied into one, the statement will be completely
......
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