Commit de2e0835 by Martin Jambor Committed by Martin Jambor

IPA-CP: Always access param_ipa_max_agg_items through opt_for_fn

2020-01-10  Martin Jambor  <mjambor@suse.cz>

	* params.opt (param_ipa_max_agg_items): Mark as Optimization
	* ipa-cp.c (merge_agg_lats_step): New parameter max_agg_items, use
	instead of param_ipa_max_agg_items.
	(merge_aggregate_lattices): Extract param_ipa_max_agg_items from
	optimization info for the callee.

From-SVN: r280098
parent 85095845
2020-01-10 Martin Jambor <mjambor@suse.cz>
* params.opt (param_ipa_max_agg_items): Mark as Optimization
* ipa-cp.c (merge_agg_lats_step): New parameter max_agg_items, use
instead of param_ipa_max_agg_items.
(merge_aggregate_lattices): Extract param_ipa_max_agg_items from
optimization info for the callee.
2020-01-09 Kwok Cheung Yeung <kcy@codesourcery.com> 2020-01-09 Kwok Cheung Yeung <kcy@codesourcery.com>
* lto-streamer-in.c (input_function): Remove streamed-in inline debug * lto-streamer-in.c (input_function): Remove streamed-in inline debug
......
...@@ -2479,13 +2479,13 @@ set_check_aggs_by_ref (class ipcp_param_lattices *dest_plats, ...@@ -2479,13 +2479,13 @@ set_check_aggs_by_ref (class ipcp_param_lattices *dest_plats,
unless there are too many already. If there are two many, return false. If unless there are too many already. If there are two many, return false. If
there are overlaps turn whole DEST_PLATS to bottom and return false. If any there are overlaps turn whole DEST_PLATS to bottom and return false. If any
skipped lattices were newly marked as containing variable, set *CHANGE to skipped lattices were newly marked as containing variable, set *CHANGE to
true. */ true. MAX_AGG_ITEMS is the maximum number of lattices. */
static bool static bool
merge_agg_lats_step (class ipcp_param_lattices *dest_plats, merge_agg_lats_step (class ipcp_param_lattices *dest_plats,
HOST_WIDE_INT offset, HOST_WIDE_INT val_size, HOST_WIDE_INT offset, HOST_WIDE_INT val_size,
struct ipcp_agg_lattice ***aglat, struct ipcp_agg_lattice ***aglat,
bool pre_existing, bool *change) bool pre_existing, bool *change, int max_agg_items)
{ {
gcc_checking_assert (offset >= 0); gcc_checking_assert (offset >= 0);
...@@ -2520,7 +2520,7 @@ merge_agg_lats_step (class ipcp_param_lattices *dest_plats, ...@@ -2520,7 +2520,7 @@ merge_agg_lats_step (class ipcp_param_lattices *dest_plats,
set_agg_lats_to_bottom (dest_plats); set_agg_lats_to_bottom (dest_plats);
return false; return false;
} }
if (dest_plats->aggs_count == param_ipa_max_agg_items) if (dest_plats->aggs_count == max_agg_items)
return false; return false;
dest_plats->aggs_count++; dest_plats->aggs_count++;
new_al = ipcp_agg_lattice_pool.allocate (); new_al = ipcp_agg_lattice_pool.allocate ();
...@@ -2574,6 +2574,8 @@ merge_aggregate_lattices (struct cgraph_edge *cs, ...@@ -2574,6 +2574,8 @@ merge_aggregate_lattices (struct cgraph_edge *cs,
ret |= set_agg_lats_contain_variable (dest_plats); ret |= set_agg_lats_contain_variable (dest_plats);
dst_aglat = &dest_plats->aggs; dst_aglat = &dest_plats->aggs;
int max_agg_items = opt_for_fn (cs->callee->function_symbol ()->decl,
param_ipa_max_agg_items);
for (struct ipcp_agg_lattice *src_aglat = src_plats->aggs; for (struct ipcp_agg_lattice *src_aglat = src_plats->aggs;
src_aglat; src_aglat;
src_aglat = src_aglat->next) src_aglat = src_aglat->next)
...@@ -2583,7 +2585,7 @@ merge_aggregate_lattices (struct cgraph_edge *cs, ...@@ -2583,7 +2585,7 @@ merge_aggregate_lattices (struct cgraph_edge *cs,
if (new_offset < 0) if (new_offset < 0)
continue; continue;
if (merge_agg_lats_step (dest_plats, new_offset, src_aglat->size, if (merge_agg_lats_step (dest_plats, new_offset, src_aglat->size,
&dst_aglat, pre_existing, &ret)) &dst_aglat, pre_existing, &ret, max_agg_items))
{ {
struct ipcp_agg_lattice *new_al = *dst_aglat; struct ipcp_agg_lattice *new_al = *dst_aglat;
...@@ -2763,6 +2765,8 @@ propagate_aggs_across_jump_function (struct cgraph_edge *cs, ...@@ -2763,6 +2765,8 @@ propagate_aggs_across_jump_function (struct cgraph_edge *cs,
if (set_check_aggs_by_ref (dest_plats, jfunc->agg.by_ref)) if (set_check_aggs_by_ref (dest_plats, jfunc->agg.by_ref))
return true; return true;
int max_agg_items = opt_for_fn (cs->callee->function_symbol ()->decl,
param_ipa_max_agg_items);
FOR_EACH_VEC_ELT (*jfunc->agg.items, i, item) FOR_EACH_VEC_ELT (*jfunc->agg.items, i, item)
{ {
HOST_WIDE_INT val_size; HOST_WIDE_INT val_size;
...@@ -2772,7 +2776,7 @@ propagate_aggs_across_jump_function (struct cgraph_edge *cs, ...@@ -2772,7 +2776,7 @@ propagate_aggs_across_jump_function (struct cgraph_edge *cs,
val_size = tree_to_shwi (TYPE_SIZE (item->type)); val_size = tree_to_shwi (TYPE_SIZE (item->type));
if (merge_agg_lats_step (dest_plats, item->offset, val_size, if (merge_agg_lats_step (dest_plats, item->offset, val_size,
&aglat, pre_existing, &ret)) &aglat, pre_existing, &ret, max_agg_items))
{ {
ret |= propagate_aggregate_lattice (cs, item, *aglat); ret |= propagate_aggregate_lattice (cs, item, *aglat);
aglat = &(*aglat)->next; aglat = &(*aglat)->next;
......
...@@ -1852,8 +1852,9 @@ determine_known_aggregate_parts (struct ipa_func_body_info *fbi, ...@@ -1852,8 +1852,9 @@ determine_known_aggregate_parts (struct ipa_func_body_info *fbi,
tree arg_base; tree arg_base;
bool check_ref, by_ref; bool check_ref, by_ref;
ao_ref r; ao_ref r;
int max_agg_items = opt_for_fn (fbi->node->decl, param_ipa_max_agg_items);
if (param_ipa_max_agg_items == 0) if (max_agg_items == 0)
return; return;
/* The function operates in three stages. First, we prepare check_ref, r, /* The function operates in three stages. First, we prepare check_ref, r,
...@@ -1951,14 +1952,14 @@ determine_known_aggregate_parts (struct ipa_func_body_info *fbi, ...@@ -1951,14 +1952,14 @@ determine_known_aggregate_parts (struct ipa_func_body_info *fbi,
operands, whose definitions can finally reach the call. */ operands, whose definitions can finally reach the call. */
add_to_agg_contents_list (&list, (*copy = *content, copy)); add_to_agg_contents_list (&list, (*copy = *content, copy));
if (++value_count == param_ipa_max_agg_items) if (++value_count == max_agg_items)
break; break;
} }
/* Add to the list consisting of all dominating virtual operands. */ /* Add to the list consisting of all dominating virtual operands. */
add_to_agg_contents_list (&all_list, content); add_to_agg_contents_list (&all_list, content);
if (++item_count == 2 * param_ipa_max_agg_items) if (++item_count == 2 * max_agg_items)
break; break;
} }
dom_vuse = gimple_vuse (stmt); dom_vuse = gimple_vuse (stmt);
......
...@@ -227,7 +227,7 @@ Common Joined UInteger Var(param_ipa_max_aa_steps) Init(25000) Param Optimizatio ...@@ -227,7 +227,7 @@ Common Joined UInteger Var(param_ipa_max_aa_steps) Init(25000) Param Optimizatio
Maximum number of statements that will be visited by IPA formal parameter analysis based on alias analysis in any given function. Maximum number of statements that will be visited by IPA formal parameter analysis based on alias analysis in any given function.
-param=ipa-max-agg-items= -param=ipa-max-agg-items=
Common Joined UInteger Var(param_ipa_max_agg_items) Init(16) Param Common Joined UInteger Var(param_ipa_max_agg_items) Init(16) Param Optimization
Maximum number of aggregate content items for a parameter in jump functions and lattices. Maximum number of aggregate content items for a parameter in jump functions and lattices.
-param=ipa-max-param-expr-ops= -param=ipa-max-param-expr-ops=
......
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