Commit 061ddf67 by Jan Hubicka Committed by Jan Hubicka

ipa-inline-analysis.c (will_be_nonconstant_predicate): Consider return values of…

ipa-inline-analysis.c (will_be_nonconstant_predicate): Consider return values of const calls as constants.

	* 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.

From-SVN: r218796
parent 8c7d662b
2014-12-16 Jan Hubicka <hubicka@ucw.cz> 2014-12-16 Jan Hubicka <hubicka@ucw.cz>
* 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.
2014-12-16 Jan Hubicka <hubicka@ucw.cz>
* hwint.c (abs_hwi, absu_hwi): Move to ... * hwint.c (abs_hwi, absu_hwi): Move to ...
* hwint.h (abs_hwi, absu_hwi): ... here; make inline. * hwint.h (abs_hwi, absu_hwi): ... here; make inline.
...@@ -2036,12 +2036,12 @@ will_be_nonconstant_predicate (struct ipa_node_params *info, ...@@ -2036,12 +2036,12 @@ will_be_nonconstant_predicate (struct ipa_node_params *info,
struct agg_position_info aggpos; struct agg_position_info aggpos;
/* What statments might be optimized away /* What statments might be optimized away
when their arguments are constant when their arguments are constant. */
TODO: also trivial builtins.
builtin_constant_p is already handled later. */
if (gimple_code (stmt) != GIMPLE_ASSIGN if (gimple_code (stmt) != GIMPLE_ASSIGN
&& gimple_code (stmt) != GIMPLE_COND && 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; return p;
/* Stores will stay anyway. */ /* Stores will stay anyway. */
...@@ -2101,9 +2101,10 @@ will_be_nonconstant_predicate (struct ipa_node_params *info, ...@@ -2101,9 +2101,10 @@ will_be_nonconstant_predicate (struct ipa_node_params *info,
p = nonconstant_names[SSA_NAME_VERSION (use)]; p = nonconstant_names[SSA_NAME_VERSION (use)];
op_non_const = or_predicates (summary->conds, &p, &op_non_const); op_non_const = or_predicates (summary->conds, &p, &op_non_const);
} }
if (gimple_code (stmt) == GIMPLE_ASSIGN if ((gimple_code (stmt) == GIMPLE_ASSIGN || gimple_code (stmt) == GIMPLE_CALL)
&& TREE_CODE (gimple_assign_lhs (stmt)) == SSA_NAME) && gimple_op (stmt, 0)
nonconstant_names[SSA_NAME_VERSION (gimple_assign_lhs (stmt))] && TREE_CODE (gimple_op (stmt, 0)) == SSA_NAME)
nonconstant_names[SSA_NAME_VERSION (gimple_op (stmt, 0))]
= op_non_const; = op_non_const;
return op_non_const; return op_non_const;
} }
...@@ -2683,7 +2684,9 @@ estimate_function_body_sizes (struct cgraph_node *node, bool early) ...@@ -2683,7 +2684,9 @@ estimate_function_body_sizes (struct cgraph_node *node, bool early)
else else
p = true_predicate (); 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; time += this_time;
size += this_size; size += this_size;
......
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