{
class ipa_node_params *info;
- info = IPA_NODE_REF (node);
+ info = ipa_node_params_sum->get (node);
/* Skip unoptimized functions and constprop clones since we don't make
lattices for them. */
if (!info || info->ipcp_orig_node)
static bool
ipcp_versionable_function_p (struct cgraph_node *node)
{
- return IPA_NODE_REF (node) && IPA_NODE_REF (node)->versionable;
+ ipa_node_params *info = ipa_node_params_sum->get (node);
+ return info && info->versionable;
}
/* Structure holding accumulated information about callers of a node. */
static inline void
push_node_to_stack (class ipa_topo_info *topo, struct cgraph_node *node)
{
- class ipa_node_params *info = IPA_NODE_REF (node);
+ ipa_node_params *info = ipa_node_params_sum->get (node);
if (info->node_enqueued)
return;
info->node_enqueued = 1;
struct cgraph_node *node;
topo->stack_top--;
node = topo->stack[topo->stack_top];
- IPA_NODE_REF (node)->node_enqueued = 0;
+ ipa_node_params_sum->get (node)->node_enqueued = 0;
return node;
}
else
/* Local thunks can be handled transparently, skip them. */
while (cs && cs->caller->thunk && cs->caller->local)
cs = cs->next_caller;
- if (cs && IPA_NODE_REF (cs->caller))
- {
- IPA_NODE_REF (cs->caller)->node_calling_single_call = true;
- return true;
- }
+ if (cs)
+ if (ipa_node_params* info = ipa_node_params_sum->get (cs->caller))
+ {
+ info->node_calling_single_call = true;
+ return true;
+ }
return false;
}
static void
initialize_node_lattices (struct cgraph_node *node)
{
- class ipa_node_params *info = IPA_NODE_REF (node);
+ ipa_node_params *info = ipa_node_params_sum->get (node);
struct cgraph_edge *ie;
bool disable = false, variable = false;
int i;
ipa_context_from_jfunc (ipa_node_params *info, cgraph_edge *cs, int csidx,
ipa_jump_func *jfunc)
{
- ipa_edge_args *args = IPA_EDGE_REF (cs);
+ ipa_edge_args *args = ipa_edge_args_sum->get (cs);
ipa_polymorphic_call_context ctx;
ipa_polymorphic_call_context *edge_ctx
= cs ? ipa_get_ith_polymorhic_call_context (args, csidx) : NULL;
FOR_EACH_FUNCTION_WITH_GIMPLE_BODY (node)
{
- class ipa_node_params *info = IPA_NODE_REF (node);
+ ipa_node_params *info = ipa_node_params_sum->get (node);
if (!opt_for_fn (node->decl, flag_ipa_cp)
|| !opt_for_fn (node->decl, optimize))
continue;
continue;
if (!info)
- info = IPA_NODE_REF (cs->caller);
+ info = ipa_node_params_sum->get (cs->caller);
class ipcp_param_lattices *plats = ipa_get_parm_lattices (info,
src->index);
else if (jfunc->type == IPA_JF_PASS_THROUGH
|| jfunc->type == IPA_JF_ANCESTOR)
{
- class ipa_node_params *caller_info = IPA_NODE_REF (cs->caller);
+ ipa_node_params *caller_info = ipa_node_params_sum->get (cs->caller);
ipcp_lattice<tree> *src_lat;
int src_idx;
bool ret;
ipa_jump_func *jfunc, int idx,
ipcp_lattice<ipa_polymorphic_call_context> *dest_lat)
{
- ipa_edge_args *args = IPA_EDGE_REF (cs);
if (dest_lat->bottom)
return false;
+ ipa_edge_args *args = ipa_edge_args_sum->get (cs);
bool ret = false;
bool added_sth = false;
bool type_preserved = true;
if (jfunc->type == IPA_JF_PASS_THROUGH
|| jfunc->type == IPA_JF_ANCESTOR)
{
- class ipa_node_params *caller_info = IPA_NODE_REF (cs->caller);
+ ipa_node_params *caller_info = ipa_node_params_sum->get (cs->caller);
int src_idx;
ipcp_lattice<ipa_polymorphic_call_context> *src_lat;
enum availability availability;
cgraph_node *callee = cs->callee->function_symbol (&availability);
- class ipa_node_params *callee_info = IPA_NODE_REF (callee);
+ ipa_node_params *callee_info = ipa_node_params_sum->get (callee);
tree parm_type = ipa_get_type (callee_info, idx);
/* For K&R C programs, ipa_get_type() could return NULL_TREE. Avoid the
if (jfunc->type == IPA_JF_PASS_THROUGH
|| jfunc->type == IPA_JF_ANCESTOR)
{
- class ipa_node_params *caller_info = IPA_NODE_REF (cs->caller);
+ ipa_node_params *caller_info = ipa_node_params_sum->get (cs->caller);
tree operand = NULL_TREE;
enum tree_code code;
unsigned src_idx;
if (jfunc->type == IPA_JF_PASS_THROUGH)
{
enum tree_code operation = ipa_get_jf_pass_through_operation (jfunc);
- class ipa_node_params *caller_info = IPA_NODE_REF (cs->caller);
+ ipa_node_params *caller_info = ipa_node_params_sum->get (cs->caller);
int src_idx = ipa_get_jf_pass_through_formal_id (jfunc);
class ipcp_param_lattices *src_lats
= ipa_get_parm_lattices (caller_info, src_idx);
gcc_checking_assert (item->jftype == IPA_JF_PASS_THROUGH
|| item->jftype == IPA_JF_LOAD_AGG);
- caller_info = IPA_NODE_REF (cs->caller);
+ caller_info = ipa_node_params_sum->get (cs->caller);
src_idx = item->value.pass_through.formal_id;
src_plats = ipa_get_parm_lattices (caller_info, src_idx);
if (jfunc->type == IPA_JF_PASS_THROUGH
&& ipa_get_jf_pass_through_operation (jfunc) == NOP_EXPR)
{
- class ipa_node_params *caller_info = IPA_NODE_REF (cs->caller);
+ ipa_node_params *caller_info = ipa_node_params_sum->get (cs->caller);
int src_idx = ipa_get_jf_pass_through_formal_id (jfunc);
class ipcp_param_lattices *src_plats;
else if (jfunc->type == IPA_JF_ANCESTOR
&& ipa_get_jf_ancestor_agg_preserved (jfunc))
{
- class ipa_node_params *caller_info = IPA_NODE_REF (cs->caller);
+ ipa_node_params *caller_info = ipa_node_params_sum->get (cs->caller);
int src_idx = ipa_get_jf_ancestor_formal_id (jfunc);
class ipcp_param_lattices *src_plats;
if (!callee->definition)
return false;
gcc_checking_assert (callee->has_gimple_body_p ());
- callee_info = IPA_NODE_REF (callee);
+ callee_info = ipa_node_params_sum->get (callee);
if (!callee_info)
return false;
- args = IPA_EDGE_REF (cs);
+ args = ipa_edge_args_sum->get (cs);
parms_count = ipa_get_param_count (callee_info);
if (parms_count == 0)
return false;
gcc_assert (size_cost > 0);
- class ipa_node_params *info = IPA_NODE_REF (node);
+ ipa_node_params *info = ipa_node_params_sum->get (node);
int eval_threshold = opt_for_fn (node->decl, param_ipa_cp_eval_threshold);
if (max_count > profile_count::zero ())
{
static void
estimate_local_effects (struct cgraph_node *node)
{
- class ipa_node_params *info = IPA_NODE_REF (node);
+ ipa_node_params *info = ipa_node_params_sum->get (node);
int i, count = ipa_get_param_count (info);
bool always_const;
int removable_params_cost;
static void
add_all_node_vals_to_toposort (cgraph_node *node, ipa_topo_info *topo)
{
- class ipa_node_params *info = IPA_NODE_REF (node);
+ ipa_node_params *info = ipa_node_params_sum->get (node);
int i, count = ipa_get_param_count (info);
for (i = 0; i < count; i++)
if (!info)
{
- info = IPA_NODE_REF (v);
+ info = ipa_node_params_sum->get (v);
info->node_within_scc = true;
}
&& opt_for_fn (node->decl, flag_ipa_cp)
&& opt_for_fn (node->decl, optimize))
{
- class ipa_node_params *info = IPA_NODE_REF (node);
+ ipa_node_params *info = ipa_node_params_sum->get (node);
determine_versionability (node, info);
unsigned nlattices = ipa_get_param_count (info);
if (cs && !agg_contents && !polymorphic)
{
- class ipa_node_params *info = IPA_NODE_REF (node);
+ ipa_node_params *info = ipa_node_params_sum->get (node);
int c = ipa_get_controlled_uses (info, param_index);
if (c != IPA_UNDESCRIBED_USE)
{
if (!allow_recursion_to_clone && cs->caller == callee)
return false;
- class ipa_node_params *info = IPA_NODE_REF (callee);
+ ipa_node_params *info = ipa_node_params_sum->get (callee);
return info->is_all_contexts_clone && info->ipcp_orig_node == dest;
}
cgraph_edge_brings_value_p (cgraph_edge *cs, ipcp_value_source<tree> *src,
cgraph_node *dest, ipcp_value<tree> *dest_val)
{
- class ipa_node_params *caller_info = IPA_NODE_REF (cs->caller);
+ ipa_node_params *caller_info = ipa_node_params_sum->get (cs->caller);
if (!calls_same_node_or_its_all_contexts_clone_p (cs, dest, !src->val)
|| caller_info->node_dead)
cgraph_node *dest,
ipcp_value<ipa_polymorphic_call_context> *)
{
- class ipa_node_params *caller_info = IPA_NODE_REF (cs->caller);
+ ipa_node_params *caller_info = ipa_node_params_sum->get (cs->caller);
if (!calls_same_node_or_its_all_contexts_clone_p (cs, dest, true)
|| caller_info->node_dead)
*count_sum = cnt;
*caller_count = count;
- if (!hot && IPA_NODE_REF (dest)->node_within_scc)
+ if (!hot && ipa_node_params_sum->get (dest)->node_within_scc)
{
struct cgraph_edge *cs;
{
auto_vec<bool, 16> surviving;
bool filled_vec = false;
- ipa_node_params *info = IPA_NODE_REF (node);
+ ipa_node_params *info = ipa_node_params_sum->get (node);
int i, count = ipa_get_param_count (info);
for (i = 0; i < count; i++)
struct ipa_agg_replacement_value *aggvals,
vec<cgraph_edge *> callers)
{
- class ipa_node_params *new_info, *info = IPA_NODE_REF (node);
+ ipa_node_params *new_info, *info = ipa_node_params_sum->get (node);
vec<ipa_replace_map *, va_gc> *replace_trees = NULL;
vec<ipa_adjusted_param, va_gc> *new_params = NULL;
struct ipa_agg_replacement_value *av;
}
ipa_check_create_node_params ();
update_profiling_info (node, new_node);
- new_info = IPA_NODE_REF (new_node);
+ new_info = ipa_node_params_sum->get (new_node);
new_info->ipcp_orig_node = node;
new_node->ipcp_clone = true;
new_info->known_csts = known_csts;
&& jfunc->type == IPA_JF_PASS_THROUGH
&& (!simple || ipa_get_jf_pass_through_operation (jfunc) == NOP_EXPR)
&& ipa_get_jf_pass_through_formal_id (jfunc) == i
- && IPA_NODE_REF (cs->caller)
- && !IPA_NODE_REF (cs->caller)->ipcp_orig_node)
+ && ipa_node_params_sum->get (cs->caller)
+ && !ipa_node_params_sum->get (cs->caller)->ipcp_orig_node)
return true;
return false;
}
&& (!simple || jfunc->value.pass_through.operation == NOP_EXPR)
&& jfunc->value.pass_through.formal_id == i
&& useless_type_conversion_p (jfunc->value.load_agg.type, jfunc->type)
- && IPA_NODE_REF (cs->caller)
- && !IPA_NODE_REF (cs->caller)->ipcp_orig_node)
+ && ipa_node_params_sum->get (cs->caller)
+ && !ipa_node_params_sum->get (cs->caller)->ipcp_orig_node)
return true;
return false;
}
vec<tree> known_csts,
vec<cgraph_edge *> callers)
{
- class ipa_node_params *info = IPA_NODE_REF (node);
+ ipa_node_params *info = ipa_node_params_sum->get (node);
int i, count = ipa_get_param_count (info);
for (i = 0; i < count; i++)
struct ipa_jump_func *jump_func;
tree t;
- if (!IPA_EDGE_REF (cs)
- || i >= ipa_get_cs_argument_count (IPA_EDGE_REF (cs))
+ ipa_edge_args *args = ipa_edge_args_sum->get (cs);
+ if (!args
+ || i >= ipa_get_cs_argument_count (args)
|| (i == 0
&& call_passes_through_thunk (cs)))
{
newval = NULL_TREE;
break;
}
- jump_func = ipa_get_ith_jump_func (IPA_EDGE_REF (cs), i);
+ jump_func = ipa_get_ith_jump_func (args, i);
/* Besides simple pass-through jump function, arithmetic jump
function could also introduce argument-direct-pass-through for
type);
}
else
- t = ipa_value_from_jfunc (IPA_NODE_REF (cs->caller), jump_func,
- type);
+ t = ipa_value_from_jfunc (ipa_node_params_sum->get (cs->caller),
+ jump_func, type);
if (!t
|| (newval
&& !values_equal_for_ipcp_p (t, newval))
*known_contexts,
vec<cgraph_edge *> callers)
{
- ipa_node_params *info = IPA_NODE_REF (node);
+ ipa_node_params *info = ipa_node_params_sum->get (node);
int i, count = ipa_get_param_count (info);
for (i = 0; i < count; i++)
FOR_EACH_VEC_ELT (callers, j, cs)
{
- if (!IPA_EDGE_REF (cs)
- || i >= ipa_get_cs_argument_count (IPA_EDGE_REF (cs)))
+ ipa_edge_args *args = ipa_edge_args_sum->get (cs);
+ if (!args
+ || i >= ipa_get_cs_argument_count (args))
return;
- ipa_jump_func *jfunc = ipa_get_ith_jump_func (IPA_EDGE_REF (cs),
- i);
+ ipa_jump_func *jfunc = ipa_get_ith_jump_func (args, i);
ipa_polymorphic_call_context ctx;
- ctx = ipa_context_from_jfunc (IPA_NODE_REF (cs->caller), cs, i,
- jfunc);
+ ctx = ipa_context_from_jfunc (ipa_node_params_sum->get (cs->caller),
+ cs, i, jfunc);
if (first)
{
newval = ctx;
vec<ipa_agg_value> inter)
{
struct ipa_jump_func *jfunc;
- jfunc = ipa_get_ith_jump_func (IPA_EDGE_REF (cs), index);
+ jfunc = ipa_get_ith_jump_func (ipa_edge_args_sum->get (cs), index);
if (jfunc->type == IPA_JF_PASS_THROUGH
&& ipa_get_jf_pass_through_operation (jfunc) == NOP_EXPR)
{
- class ipa_node_params *caller_info = IPA_NODE_REF (cs->caller);
+ ipa_node_params *caller_info = ipa_node_params_sum->get (cs->caller);
int src_idx = ipa_get_jf_pass_through_formal_id (jfunc);
if (caller_info->ipcp_orig_node)
{
struct cgraph_node *orig_node = caller_info->ipcp_orig_node;
class ipcp_param_lattices *orig_plats;
- orig_plats = ipa_get_parm_lattices (IPA_NODE_REF (orig_node),
- src_idx);
+ ipa_node_params *orig_info = ipa_node_params_sum->get (orig_node);
+ orig_plats = ipa_get_parm_lattices (orig_info, src_idx);
if (agg_pass_through_permissible_p (orig_plats, jfunc))
{
if (!inter.exists ())
else if (jfunc->type == IPA_JF_ANCESTOR
&& ipa_get_jf_ancestor_agg_preserved (jfunc))
{
- class ipa_node_params *caller_info = IPA_NODE_REF (cs->caller);
+ ipa_node_params *caller_info = ipa_node_params_sum->get (cs->caller);
int src_idx = ipa_get_jf_ancestor_formal_id (jfunc);
class ipcp_param_lattices *src_plats;
HOST_WIDE_INT delta = ipa_get_jf_ancestor_offset (jfunc);
if (jfunc->agg.items)
{
- class ipa_node_params *caller_info = IPA_NODE_REF (cs->caller);
+ ipa_node_params *caller_info = ipa_node_params_sum->get (cs->caller);
struct ipa_agg_value *item;
int k;
find_aggregate_values_for_callers_subset (struct cgraph_node *node,
vec<cgraph_edge *> callers)
{
- class ipa_node_params *dest_info = IPA_NODE_REF (node);
+ ipa_node_params *dest_info = ipa_node_params_sum->get (node);
struct ipa_agg_replacement_value *res;
struct ipa_agg_replacement_value **tail = &res;
struct cgraph_edge *cs;
FOR_EACH_VEC_ELT (callers, j, cs)
{
- if (!IPA_EDGE_REF (cs))
+ ipa_edge_args *args = ipa_edge_args_sum->get (cs);
+ if (!args)
{
count = 0;
break;
}
- int c = ipa_get_cs_argument_count (IPA_EDGE_REF (cs));
+ int c = ipa_get_cs_argument_count (args);
if (c < count)
count = c;
}
FOR_EACH_VEC_ELT (callers, j, cs)
{
struct ipa_jump_func *jfunc
- = ipa_get_ith_jump_func (IPA_EDGE_REF (cs), i);
+ = ipa_get_ith_jump_func (ipa_edge_args_sum->get (cs), i);
if (self_recursive_pass_through_p (cs, jfunc, i)
&& (!plats->aggs_by_ref
|| ipa_get_jf_pass_through_agg_preserved (jfunc)))
cgraph_edge_brings_all_scalars_for_node (struct cgraph_edge *cs,
struct cgraph_node *node)
{
- class ipa_node_params *dest_info = IPA_NODE_REF (node);
+ ipa_node_params *dest_info = ipa_node_params_sum->get (node);
int count = ipa_get_param_count (dest_info);
class ipa_node_params *caller_info;
class ipa_edge_args *args;
int i;
- caller_info = IPA_NODE_REF (cs->caller);
- args = IPA_EDGE_REF (cs);
+ caller_info = ipa_node_params_sum->get (cs->caller);
+ args = ipa_edge_args_sum->get (cs);
for (i = 0; i < count; i++)
{
struct ipa_jump_func *jump_func;
cgraph_edge_brings_all_agg_vals_for_node (struct cgraph_edge *cs,
struct cgraph_node *node)
{
- class ipa_node_params *orig_node_info;
struct ipa_agg_replacement_value *aggval;
int i, ec, count;
if (!aggval)
return true;
- count = ipa_get_param_count (IPA_NODE_REF (node));
- ec = ipa_get_cs_argument_count (IPA_EDGE_REF (cs));
+ ipa_node_params *clone_node_info = ipa_node_params_sum->get (node);
+ count = ipa_get_param_count (clone_node_info);
+ ec = ipa_get_cs_argument_count (ipa_edge_args_sum->get (cs));
if (ec < count)
for (struct ipa_agg_replacement_value *av = aggval; av; av = av->next)
if (aggval->index >= ec)
return false;
- orig_node_info = IPA_NODE_REF (IPA_NODE_REF (node)->ipcp_orig_node);
+ ipa_node_params *orig_node_info
+ = ipa_node_params_sum->get (clone_node_info->ipcp_orig_node);
for (i = 0; i < count; i++)
{
fprintf (dump_file, " - considering value ");
print_ipcp_constant_value (dump_file, val->value);
fprintf (dump_file, " for ");
- ipa_dump_param (dump_file, IPA_NODE_REF (node), index);
+ ipa_dump_param (dump_file, ipa_node_params_sum->get (node), index);
if (offset != -1)
fprintf (dump_file, ", offset: " HOST_WIDE_INT_PRINT_DEC, offset);
fprintf (dump_file, " (caller_count: %i)\n", caller_count);
static bool
decide_whether_version_node (struct cgraph_node *node)
{
- class ipa_node_params *info = IPA_NODE_REF (node);
+ ipa_node_params *info = ipa_node_params_sum->get (node);
int i, count = ipa_get_param_count (info);
bool ret = false;
for (val = ctxlat->values; val; val = val->next)
ret |= decide_about_value (node, i, -1, val, &avals);
}
-
- info = IPA_NODE_REF (node);
}
if (info->do_clone_for_all_contexts)
for (int i = callers.length () - 1; i >= 0; i--)
{
cgraph_edge *cs = callers[i];
- class ipa_node_params *caller_info = IPA_NODE_REF (cs->caller);
+ ipa_node_params *caller_info = ipa_node_params_sum->get (cs->caller);
if (caller_info && caller_info->node_dead)
callers.unordered_remove (i);
}
clone = create_specialized_node (node, known_csts, known_contexts,
aggvals, callers);
- info = IPA_NODE_REF (node);
info->do_clone_for_all_contexts = false;
- IPA_NODE_REF (clone)->is_all_contexts_clone = true;
+ ipa_node_params_sum->get (clone)->is_all_contexts_clone = true;
ret = true;
}
class ipa_node_params *info;
callee = cs->callee->function_symbol (NULL);
- info = IPA_NODE_REF (callee);
+ info = ipa_node_params_sum->get (callee);
if (info && info->node_dead)
{
&& cs->caller->call_for_symbol_thunks_and_aliases
(has_undead_caller_from_outside_scc_p, NULL, true))
return true;
- else if (!ipa_edge_within_scc (cs)
- && (!IPA_NODE_REF (cs->caller) /* Unoptimized caller. */
- || !IPA_NODE_REF (cs->caller)->node_dead))
+ else if (!ipa_edge_within_scc (cs))
+ {
+ ipa_node_params *caller_info = ipa_node_params_sum->get (cs->caller);
+ if (!caller_info /* Unoptimized caller are like dead ones. */
+ || !caller_info->node_dead)
return true;
+ }
return false;
}
{
struct cgraph_node *v;
for (v = node; v; v = ((struct ipa_dfs_info *) v->aux)->next_cycle)
- if (v->local
- && IPA_NODE_REF (v)
- && !v->call_for_symbol_thunks_and_aliases
- (has_undead_caller_from_outside_scc_p, NULL, true))
- IPA_NODE_REF (v)->node_dead = 1;
+ if (v->local)
+ {
+ ipa_node_params *info = ipa_node_params_sum->get (v);
+ if (info
+ && !v->call_for_symbol_thunks_and_aliases
+ (has_undead_caller_from_outside_scc_p, NULL, true))
+ info->node_dead = 1;
+ }
for (v = node; v; v = ((struct ipa_dfs_info *) v->aux)->next_cycle)
- if (IPA_NODE_REF (v) && !IPA_NODE_REF (v)->node_dead)
- spread_undeadness (v);
+ {
+ ipa_node_params *info = ipa_node_params_sum->get (v);
+ if (info && !info->node_dead)
+ spread_undeadness (v);
+ }
if (dump_file && (dump_flags & TDF_DETAILS))
{
for (v = node; v; v = ((struct ipa_dfs_info *) v->aux)->next_cycle)
- if (IPA_NODE_REF (v) && IPA_NODE_REF (v)->node_dead)
- fprintf (dump_file, " Marking node as dead: %s.\n", v->dump_name ());
+ if (ipa_node_params_sum->get (v)
+ && ipa_node_params_sum->get (v)->node_dead)
+ fprintf (dump_file, " Marking node as dead: %s.\n",
+ v->dump_name ());
}
}
FOR_EACH_FUNCTION_WITH_GIMPLE_BODY (node)
{
- ipa_node_params *info = IPA_NODE_REF (node);
+ ipa_node_params *info = ipa_node_params_sum->get (node);
bool dumped_sth = false;
bool found_useful_result = false;
}
if (info->ipcp_orig_node)
- info = IPA_NODE_REF (info->ipcp_orig_node);
+ info = ipa_node_params_sum->get (info->ipcp_orig_node);
if (!info->lattices)
/* Newly expanded artificial thunks do not have lattices. */
continue;
FOR_EACH_FUNCTION_WITH_GIMPLE_BODY (node)
{
- ipa_node_params *info = IPA_NODE_REF (node);
+ ipa_node_params *info = ipa_node_params_sum->get (node);
bool found_useful_result = false;
if (!info || !opt_for_fn (node->decl, flag_ipa_vrp))
}
if (info->ipcp_orig_node)
- info = IPA_NODE_REF (info->ipcp_orig_node);
+ info = ipa_node_params_sum->get (info->ipcp_orig_node);
if (!info->lattices)
/* Newly expanded artificial thunks do not have lattices. */
continue;
static bool
ipa_alloc_node_params (struct cgraph_node *node, int param_count)
{
- class ipa_node_params *info = IPA_NODE_REF_GET_CREATE (node);
+ ipa_node_params *info = ipa_node_params_sum->get_create (node);
if (!info->descriptors && param_count)
{
void
ipa_initialize_node_params (struct cgraph_node *node)
{
- class ipa_node_params *info = IPA_NODE_REF_GET_CREATE (node);
+ ipa_node_params *info = ipa_node_params_sum->get_create (node);
if (!info->descriptors
&& ipa_alloc_node_params (node, count_formal_params (node->decl)))
static void
ipa_print_node_jump_functions_for_edge (FILE *f, struct cgraph_edge *cs)
{
- int i, count;
+ ipa_edge_args *args = ipa_edge_args_sum->get (cs);
+ int count = ipa_get_cs_argument_count (args);
- count = ipa_get_cs_argument_count (IPA_EDGE_REF (cs));
- for (i = 0; i < count; i++)
+ for (int i = 0; i < count; i++)
{
struct ipa_jump_func *jump_func;
enum jump_func_type type;
- jump_func = ipa_get_ith_jump_func (IPA_EDGE_REF (cs), i);
+ jump_func = ipa_get_ith_jump_func (args, i);
type = jump_func->type;
fprintf (f, " param %d: ", i);
}
class ipa_polymorphic_call_context *ctx
- = ipa_get_ith_polymorhic_call_context (IPA_EDGE_REF (cs), i);
+ = ipa_get_ith_polymorhic_call_context (args, i);
if (ctx && !ctx->useless_p ())
{
fprintf (f, " Context: ");
ipa_compute_jump_functions_for_edge (struct ipa_func_body_info *fbi,
struct cgraph_edge *cs)
{
- class ipa_node_params *info = IPA_NODE_REF (cs->caller);
- class ipa_edge_args *args = IPA_EDGE_REF_GET_CREATE (cs);
+ ipa_node_params *info = ipa_node_params_sum->get (cs->caller);
+ ipa_edge_args *args = ipa_edge_args_sum->get_create (cs);
gcall *call = cs->call_stmt;
int n, arg_num = gimple_call_num_args (call);
bool useful_context = false;
cs->indirect_info->agg_contents = 0;
cs->indirect_info->member_ptr = 0;
cs->indirect_info->guaranteed_unmodified = 0;
- ipa_set_param_used_by_indirect_call (IPA_NODE_REF (node),
- param_index, true);
+ ipa_node_params *info = ipa_node_params_sum->get (node);
+ ipa_set_param_used_by_indirect_call (info, param_index, true);
if (cs->indirect_info->polymorphic || polymorphic)
- ipa_set_param_used_by_polymorphic_call
- (IPA_NODE_REF (node), param_index, true);
+ ipa_set_param_used_by_polymorphic_call (info, param_index, true);
return cs;
}
static void
ipa_analyze_controlled_uses (struct cgraph_node *node)
{
- class ipa_node_params *info = IPA_NODE_REF (node);
+ ipa_node_params *info = ipa_node_params_sum->get (node);
for (int i = 0; i < ipa_get_param_count (info); i++)
{
ipa_check_create_node_params ();
ipa_check_create_edge_args ();
- info = IPA_NODE_REF_GET_CREATE (node);
+ info = ipa_node_params_sum->get_create (node);
if (info->analysis_done)
return;
ipa_analyze_controlled_uses (node);
fbi.node = node;
- fbi.info = IPA_NODE_REF (node);
+ fbi.info = info;
fbi.bb_infos = vNULL;
fbi.bb_infos.safe_grow_cleared (last_basic_block_for_fn (cfun), true);
fbi.param_count = ipa_get_param_count (info);
update_jump_functions_after_inlining (struct cgraph_edge *cs,
struct cgraph_edge *e)
{
- class ipa_edge_args *top = IPA_EDGE_REF (cs);
- class ipa_edge_args *args = IPA_EDGE_REF (e);
+ ipa_edge_args *top = ipa_edge_args_sum->get (cs);
+ ipa_edge_args *args = ipa_edge_args_sum->get (e);
if (!args)
return;
int count = ipa_get_cs_argument_count (args);
bool res = false;
ipa_check_create_edge_args ();
- top = IPA_EDGE_REF (cs);
+ top = ipa_edge_args_sum->get (cs);
new_root = cs->caller->inlined_to
? cs->caller->inlined_to : cs->caller;
- new_root_info = IPA_NODE_REF (new_root);
- inlined_node_info = IPA_NODE_REF (cs->callee->function_symbol ());
+ new_root_info = ipa_node_params_sum->get (new_root);
+ inlined_node_info = ipa_node_params_sum->get (cs->callee->function_symbol ());
for (ie = node->indirect_calls; ie; ie = next_ie)
{
&& spec_targets.contains (new_direct_edge->callee))
{
new_direct_edge->indirect_inlining_edge = 1;
- top = IPA_EDGE_REF (cs);
res = true;
if (!new_direct_edge->speculative)
continue;
new_edges->safe_push (new_direct_edge);
res = true;
}
- top = IPA_EDGE_REF (cs);
/* If speculative edge was introduced we still need to update
call info of the indirect edge. */
if (!new_direct_edge->speculative)
static void
propagate_controlled_uses (struct cgraph_edge *cs)
{
- class ipa_edge_args *args = IPA_EDGE_REF (cs);
+ ipa_edge_args *args = ipa_edge_args_sum->get (cs);
if (!args)
return;
struct cgraph_node *new_root = cs->caller->inlined_to
? cs->caller->inlined_to : cs->caller;
- class ipa_node_params *new_root_info = IPA_NODE_REF (new_root);
- class ipa_node_params *old_root_info = IPA_NODE_REF (cs->callee);
+ ipa_node_params *new_root_info = ipa_node_params_sum->get (new_root);
+ ipa_node_params *old_root_info = ipa_node_params_sum->get (cs->callee);
int count, i;
if (!old_root_info)
changed = propagate_info_to_inlined_callees (cs, cs->callee, new_edges);
ipa_node_params_sum->remove (cs->callee);
- class ipa_edge_args *args = IPA_EDGE_REF (cs);
+ ipa_edge_args *args = ipa_edge_args_sum->get (cs);
if (args)
{
bool ok = true;
{
struct cgraph_node *inline_root = dst->caller->inlined_to
? dst->caller->inlined_to : dst->caller;
- class ipa_node_params *root_info = IPA_NODE_REF (inline_root);
+ ipa_node_params *root_info = ipa_node_params_sum->get (inline_root);
int idx = ipa_get_jf_pass_through_formal_id (dst_jf);
int c = ipa_get_controlled_uses (root_info, idx);
if (!node->definition)
return;
- info = IPA_NODE_REF (node);
+ info = ipa_node_params_sum->get (node);
fprintf (f, " function %s parameter descriptors:\n", node->dump_name ());
if (!info)
{
{
int node_ref;
lto_symtab_encoder_t encoder;
- class ipa_node_params *info = IPA_NODE_REF (node);
+ ipa_node_params *info = ipa_node_params_sum->get (node);
int j;
struct cgraph_edge *e;
struct bitpack_d bp;
}
for (e = node->callees; e; e = e->next_callee)
{
- class ipa_edge_args *args = IPA_EDGE_REF (e);
+ ipa_edge_args *args = ipa_edge_args_sum->get (e);
if (!args)
{
}
for (e = node->indirect_calls; e; e = e->next_callee)
{
- class ipa_edge_args *args = IPA_EDGE_REF (e);
+ ipa_edge_args *args = ipa_edge_args_sum->get (e);
if (!args)
streamer_write_uhwi (ob, 0);
else
will get fnspecs. */
|| fndecl_built_in_p (e->callee->decl, BUILT_IN_NORMAL)))
{
- class ipa_edge_args *args = IPA_EDGE_REF_GET_CREATE (e);
+ ipa_edge_args *args = ipa_edge_args_sum->get_create (e);
vec_safe_grow_cleared (args->jump_functions, count, true);
if (contexts_computed)
vec_safe_grow_cleared (args->polymorphic_call_contexts, count, true);
struct cgraph_edge *e;
struct bitpack_d bp;
bool prevails = node->prevailing_p ();
- class ipa_node_params *info = prevails
- ? IPA_NODE_REF_GET_CREATE (node) : NULL;
+ ipa_node_params *info
+ = prevails ? ipa_node_params_sum->get_create (node) : NULL;
int param_count = streamer_read_uhwi (ib);
if (prevails)
void
ipa_prop_write_jump_functions (void)
{
- struct cgraph_node *node;
struct output_block *ob;
unsigned int count = 0;
lto_symtab_encoder_iterator lsei;
for (lsei = lsei_start_function_in_partition (encoder); !lsei_end_p (lsei);
lsei_next_function_in_partition (&lsei))
{
- node = lsei_cgraph_node (lsei);
+ cgraph_node *node = lsei_cgraph_node (lsei);
if (node->has_gimple_body_p ()
- && IPA_NODE_REF (node) != NULL)
+ && ipa_node_params_sum->get (node) != NULL)
count++;
}
for (lsei = lsei_start_function_in_partition (encoder); !lsei_end_p (lsei);
lsei_next_function_in_partition (&lsei))
{
- node = lsei_cgraph_node (lsei);
+ cgraph_node *node = lsei_cgraph_node (lsei);
if (node->has_gimple_body_p ()
- && IPA_NODE_REF (node) != NULL)
+ && ipa_node_params_sum->get (node) != NULL)
ipa_write_node_info (ob, node);
}
streamer_write_char_stream (ob->main_stream, 0);