+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>
* lto-streamer-in.c (input_function): Remove streamed-in inline debug
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
skipped lattices were newly marked as containing variable, set *CHANGE to
- true. */
+ true. MAX_AGG_ITEMS is the maximum number of lattices. */
static bool
merge_agg_lats_step (class ipcp_param_lattices *dest_plats,
HOST_WIDE_INT offset, HOST_WIDE_INT val_size,
struct ipcp_agg_lattice ***aglat,
- bool pre_existing, bool *change)
+ bool pre_existing, bool *change, int max_agg_items)
{
gcc_checking_assert (offset >= 0);
set_agg_lats_to_bottom (dest_plats);
return false;
}
- if (dest_plats->aggs_count == param_ipa_max_agg_items)
+ if (dest_plats->aggs_count == max_agg_items)
return false;
dest_plats->aggs_count++;
new_al = ipcp_agg_lattice_pool.allocate ();
ret |= set_agg_lats_contain_variable (dest_plats);
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;
src_aglat;
src_aglat = src_aglat->next)
if (new_offset < 0)
continue;
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;
if (set_check_aggs_by_ref (dest_plats, jfunc->agg.by_ref))
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)
{
HOST_WIDE_INT val_size;
val_size = tree_to_shwi (TYPE_SIZE (item->type));
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);
aglat = &(*aglat)->next;
tree arg_base;
bool check_ref, by_ref;
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;
/* The function operates in three stages. First, we prepare check_ref, r,
operands, whose definitions can finally reach the call. */
add_to_agg_contents_list (&list, (*copy = *content, copy));
- if (++value_count == param_ipa_max_agg_items)
+ if (++value_count == max_agg_items)
break;
}
/* Add to the list consisting of all dominating virtual operands. */
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;
}
dom_vuse = gimple_vuse (stmt);