summaryrefslogtreecommitdiff
path: root/gcc/ipa-inline-analysis.c
diff options
context:
space:
mode:
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2014-12-16 22:16:17 +0000
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2014-12-16 22:16:17 +0000
commit1d4ee63fd95232b8bfe1d0202d3ccb4252d7d31d (patch)
treeb7bf593dc9aaae190f0a6bc84296f3a61d79e92c /gcc/ipa-inline-analysis.c
parent070339409c5eec9b8e9716bdd619731782581ae9 (diff)
downloadgcc-1d4ee63fd95232b8bfe1d0202d3ccb4252d7d31d.tar.gz
* ipa-inline-analysis.c (will_be_nonconstant_predicate): Consider
return values of const calls as constants. (estimate_function_body_sizes): Expect calls to have false predicates. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@218796 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ipa-inline-analysis.c')
-rw-r--r--gcc/ipa-inline-analysis.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/gcc/ipa-inline-analysis.c b/gcc/ipa-inline-analysis.c
index fb4e81ebba4..3b622f2f0e4 100644
--- a/gcc/ipa-inline-analysis.c
+++ b/gcc/ipa-inline-analysis.c
@@ -2036,12 +2036,12 @@ will_be_nonconstant_predicate (struct ipa_node_params *info,
struct agg_position_info aggpos;
/* What statments might be optimized away
- when their arguments are constant
- TODO: also trivial builtins.
- builtin_constant_p is already handled later. */
+ when their arguments are constant. */
if (gimple_code (stmt) != GIMPLE_ASSIGN
&& gimple_code (stmt) != GIMPLE_COND
- && gimple_code (stmt) != GIMPLE_SWITCH)
+ && gimple_code (stmt) != GIMPLE_SWITCH
+ && (gimple_code (stmt) != GIMPLE_CALL
+ || !(gimple_call_flags (stmt) & ECF_CONST)))
return p;
/* Stores will stay anyway. */
@@ -2101,9 +2101,10 @@ will_be_nonconstant_predicate (struct ipa_node_params *info,
p = nonconstant_names[SSA_NAME_VERSION (use)];
op_non_const = or_predicates (summary->conds, &p, &op_non_const);
}
- if (gimple_code (stmt) == GIMPLE_ASSIGN
- && TREE_CODE (gimple_assign_lhs (stmt)) == SSA_NAME)
- nonconstant_names[SSA_NAME_VERSION (gimple_assign_lhs (stmt))]
+ if ((gimple_code (stmt) == GIMPLE_ASSIGN || gimple_code (stmt) == GIMPLE_CALL)
+ && gimple_op (stmt, 0)
+ && TREE_CODE (gimple_op (stmt, 0)) == SSA_NAME)
+ nonconstant_names[SSA_NAME_VERSION (gimple_op (stmt, 0))]
= op_non_const;
return op_non_const;
}
@@ -2683,7 +2684,9 @@ estimate_function_body_sizes (struct cgraph_node *node, bool early)
else
p = true_predicate ();
- if (!false_predicate_p (&p))
+ if (!false_predicate_p (&p)
+ || (is_gimple_call (stmt)
+ && !false_predicate_p (&bb_predicate)))
{
time += this_time;
size += this_size;