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