summaryrefslogtreecommitdiff
path: root/gcc/ipa-inline-analysis.c
diff options
context:
space:
mode:
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2012-10-30 16:51:12 +0000
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2012-10-30 16:51:12 +0000
commit11f20fbaf7e630e6fc7b5ec5fcc48c63b568348b (patch)
tree6c4362f693319e55f9260978be0a1bcb1af32e73 /gcc/ipa-inline-analysis.c
parentcbe26b293dd751e67e598be62cf5df40e1268992 (diff)
downloadgcc-11f20fbaf7e630e6fc7b5ec5fcc48c63b568348b.tar.gz
* ipa-inline-analysis.c (eliminated_by_inlining_prob): Cleanup.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@192991 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ipa-inline-analysis.c')
-rw-r--r--gcc/ipa-inline-analysis.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/gcc/ipa-inline-analysis.c b/gcc/ipa-inline-analysis.c
index a8d16a8c8c6..8baaced2bd9 100644
--- a/gcc/ipa-inline-analysis.c
+++ b/gcc/ipa-inline-analysis.c
@@ -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,12 +1595,9 @@ 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))
- rhs_free = true;
- }
+ 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