Commit b0d55476 by Jan Hubicka Committed by Jan Hubicka

ipa-fnsummary.c (evaluate_conditions_for_known_args): Be ready for some vectors…

ipa-fnsummary.c (evaluate_conditions_for_known_args): Be ready for some vectors to not be allocated.


	* ipa-fnsummary.c (evaluate_conditions_for_known_args): Be
	ready for some vectors to not be allocated.
	(evaluate_properties_for_edge): Document better; make
	known_vals and known_aggs caller allocated; avoid determining
	values of parameters which are not used.
	(ipa_merge_fn_summary_after_inlining): Pre allocate known_vals and
	known_aggs.
	* ipa-inline-analysis.c (do_estimate_edge_time): Likewise.
	(do_estimate_edge_size): Likewise.
	(do_estimate_edge_hints): Likewise.
	* ipa-cp.c (ipa_get_indirect_edge_target_1): Do not early exit when
	values are not known.
	(ipa_release_agg_values): Add option to not release vector itself.

From-SVN: r278553
parent 48ffab98
2019-11-21 Jan Hubicka <jh@suse.cz>
* ipa-fnsummary.c (evaluate_conditions_for_known_args): Be
ready for some vectors to not be allocated.
(evaluate_properties_for_edge): Document better; make
known_vals and known_aggs caller allocated; avoid determining
values of parameters which are not used.
(ipa_merge_fn_summary_after_inlining): Pre allocate known_vals and
known_aggs.
* ipa-inline-analysis.c (do_estimate_edge_time): Likewise.
(do_estimate_edge_size): Likewise.
(do_estimate_edge_hints): Likewise.
* ipa-cp.c (ipa_get_indirect_edge_target_1): Do not early exit when
values are not known.
(ipa_release_agg_values): Add option to not release vector itself.
2019-11-21 Richard Biener <rguenther@suse.de>
* cfgloop.h (loop_iterator::~loop_iterator): Remove.
......@@ -2744,18 +2744,17 @@ ipa_get_indirect_edge_target_1 (struct cgraph_edge *ie,
{
int param_index = ie->indirect_info->param_index;
HOST_WIDE_INT anc_offset;
tree t;
tree t = NULL;
tree target = NULL;
*speculative = false;
if (param_index == -1
|| known_csts.length () <= (unsigned int) param_index)
if (param_index == -1)
return NULL_TREE;
if (!ie->indirect_info->polymorphic)
{
tree t;
tree t = NULL;
if (ie->indirect_info->agg_contents)
{
......@@ -2782,7 +2781,11 @@ ipa_get_indirect_edge_target_1 (struct cgraph_edge *ie,
else
agg = NULL;
bool from_global_constant;
t = ipa_find_agg_cst_for_param (agg, known_csts[param_index],
t = ipa_find_agg_cst_for_param (agg,
(unsigned) param_index
< known_csts.length ()
? known_csts[param_index]
: NULL,
ie->indirect_info->offset,
ie->indirect_info->by_ref,
&from_global_constant);
......@@ -2792,7 +2795,7 @@ ipa_get_indirect_edge_target_1 (struct cgraph_edge *ie,
t = NULL_TREE;
}
}
else
else if ((unsigned) param_index < known_csts.length ())
t = known_csts[param_index];
if (t
......@@ -2833,7 +2836,10 @@ ipa_get_indirect_edge_target_1 (struct cgraph_edge *ie,
&& !ie->indirect_info->by_ref)
{
struct ipa_agg_value_set *agg = &known_aggs[param_index];
t = ipa_find_agg_cst_for_param (agg, known_csts[param_index],
t = ipa_find_agg_cst_for_param (agg,
(unsigned) param_index
< known_csts.length ()
? known_csts[param_index] : NULL,
ie->indirect_info->offset, true);
}
......@@ -2867,7 +2873,7 @@ ipa_get_indirect_edge_target_1 (struct cgraph_edge *ie,
}
/* Do we know the constant value of pointer? */
if (!t)
if (!t && (unsigned) param_index < known_csts.length ())
t = known_csts[param_index];
gcc_checking_assert (!t || TREE_CODE (t) != TREE_BINFO);
......
......@@ -186,9 +186,9 @@ do_estimate_edge_time (struct cgraph_edge *edge, sreal *ret_nonspec_time)
ipa_hints hints;
struct cgraph_node *callee;
clause_t clause, nonspec_clause;
vec<tree> known_vals;
vec<ipa_polymorphic_call_context> known_contexts;
vec<ipa_agg_value_set> known_aggs;
auto_vec<tree, 32> known_vals;
auto_vec<ipa_polymorphic_call_context, 32> known_contexts;
auto_vec<ipa_agg_value_set, 32> known_aggs;
class ipa_call_summary *es = ipa_call_summaries->get (edge);
int min_size = -1;
......@@ -308,9 +308,9 @@ do_estimate_edge_size (struct cgraph_edge *edge)
int size;
struct cgraph_node *callee;
clause_t clause, nonspec_clause;
vec<tree> known_vals;
vec<ipa_polymorphic_call_context> known_contexts;
vec<ipa_agg_value_set> known_aggs;
auto_vec<tree, 32> known_vals;
auto_vec<ipa_polymorphic_call_context, 32> known_contexts;
auto_vec<ipa_agg_value_set, 32> known_aggs;
/* When we do caching, use do_estimate_edge_time to populate the entry. */
......@@ -347,9 +347,9 @@ do_estimate_edge_hints (struct cgraph_edge *edge)
ipa_hints hints;
struct cgraph_node *callee;
clause_t clause, nonspec_clause;
vec<tree> known_vals;
vec<ipa_polymorphic_call_context> known_contexts;
vec<ipa_agg_value_set> known_aggs;
auto_vec<tree, 32> known_vals;
auto_vec<ipa_polymorphic_call_context, 32> known_contexts;
auto_vec<ipa_agg_value_set, 32> known_aggs;
/* When we do caching, use do_estimate_edge_time to populate the entry. */
......
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