Message ID | ri68s4mwosu.fsf@suse.cz |
---|---|
State | New |
Headers | show |
Series | ipa: Get rid of IPA_NODE_REF and IPA_EDGE_REF | expand |
> Hi, > > the node and edge summaries defined in ipa-prop.h are probably the > oldest in GCC and so it happened that they are the only ones using > macros to look them up and create them. With Honza and Martin we > agreed it is ugly and the macros should be removed and the ipa-prop > summaries should be accessed like all the other ones but somehow I > never got to it until now. > > The patch is mostly mechanical. Because the lookup machinery was much > simpler in the old times (something like the fast summaries we have > today), a lot of code queried for the summary multiple times for no > good reasons and I fixed that in places where it was easy. > > Also, before we switched to hash based summaries, new summary pointers > had to be obtained whenever the underlying array could be reallocated > because of new cgraph nodes/edges. This is no longer necessary and so > I removed the instances which I found. > > Both kinds of these non-mechanical changes should be specifically called > out in the ChangeLog. > > I also removed the IS_VALID_JUMP_FUNC_INDEX macro because it not used > anywhere. > > Bootstrapped and tested on x86_64-linux. OK for trunk? OK, thanks! honza > > Thanks, > > Martin > > > gcc/ChangeLog: > > 2021-05-07 Martin Jambor <mjambor@suse.cz> > > * ipa-prop.h (IPA_NODE_REF): Removed. > (IPA_NODE_REF_GET_CREATE): Likewise. > (IPA_EDGE_REF): Likewise. > (IPA_EDGE_REF_GET_CREATE): Likewise. > (IS_VALID_JUMP_FUNC_INDEX): Likewise. > * ipa-cp.c (print_all_lattices): Replaced IPA_NODE_REF with a direct > use of ipa_node_params_sum. > (ipcp_versionable_function_p): Likewise. > (push_node_to_stack): Likewise. > (pop_node_from_stack): Likewise. > (set_single_call_flag): Replaced two IPA_NODE_REF with one single > direct use of ipa_node_params_sum. > (initialize_node_lattices): Replaced IPA_NODE_REF with a direct use of > ipa_node_params_sum. > (ipa_context_from_jfunc): Replaced IPA_EDGE_REF with a direct use of > ipa_edge_args_sum. > (ipcp_verify_propagated_values): Replaced IPA_NODE_REF with a direct > use of ipa_node_params_sum. > (self_recursively_generated_p): Likewise. > (propagate_scalar_across_jump_function): Likewise. > (propagate_context_across_jump_function): Replaced IPA_EDGE_REF with a > direct use of ipa_edge_args_sum, moved the lookup after the early > exit. Replaced IPA_NODE_REF with a direct use of ipa_node_params_sum. > (propagate_bits_across_jump_function): Replaced IPA_NODE_REF with > direct uses of ipa_node_params_sum. > (propagate_vr_across_jump_function): Likewise. > (propagate_aggregate_lattice): Likewise. > (propagate_aggs_across_jump_function): Likewise. > (propagate_constants_across_call): Likewise, also replaced > IPA_EDGE_REF with a direct use of ipa_edge_args_sum. > (good_cloning_opportunity_p): Replaced IPA_NODE_REF with a direct use > of ipa_node_params_sum. > (estimate_local_effects): Likewise. > (add_all_node_vals_to_toposort): Likewise. > (propagate_constants_topo): Likewise. > (ipcp_propagate_stage): Likewise. > (ipcp_discover_new_direct_edges): Likewise. > (calls_same_node_or_its_all_contexts_clone_p): Likewise. > (cgraph_edge_brings_value_p): Likewise (in both overloaded functions). > (get_info_about_necessary_edges): Likewise. > (want_remove_some_param_p): Likewise. > (create_specialized_node): Likewise. > (self_recursive_pass_through_p): Likewise. > (self_recursive_agg_pass_through_p): Likewise. > (find_more_scalar_values_for_callers_subset): Likewise and also > replaced IPA_EDGE_REF with direct uses of ipa_edge_args_sum, in one > case replacing two of those with a single query. > (find_more_contexts_for_caller_subset): Likewise for the > ipa_polymorphic_call_context overload. > (intersect_aggregates_with_edge): Replaced IPA_EDGE_REF with a direct > use of ipa_edge_args_sum. Replaced IPA_NODE_REF with direct uses of > ipa_node_params_sum. > (find_aggregate_values_for_callers_subset): Likewise, also reusing > results of ipa_edge_args_sum->get. > (cgraph_edge_brings_all_scalars_for_node): Replaced IPA_NODE_REF with > direct uses of ipa_node_params_sum, replaced IPA_EDGE_REF with a > direct use of ipa_edge_args_sum. > (cgraph_edge_brings_all_agg_vals_for_node): Likewise, moved node > summary query after the early exit and reused the result later. > (decide_about_value): Replaced IPA_NODE_REF with a direct use of > ipa_node_params_sum. > (decide_whether_version_node): Likewise. Removed re-querying for > summaries after cloning. > (spread_undeadness): Replaced IPA_NODE_REF with a direct use of > ipa_node_params_sum. > (has_undead_caller_from_outside_scc_p): Likewise, reusing results of > some queries. > (identify_dead_nodes): Likewise. > (ipcp_store_bits_results): Replaced IPA_NODE_REF with direct uses of > ipa_node_params_sum. > (ipcp_store_vr_results): Likewise. > * ipa-fnsummary.c (evaluate_properties_for_edge): Likewise. > (ipa_fn_summary_t::duplicate): Likewise. > (analyze_function_body): Likewise. > (estimate_calls_size_and_time): Likewise. > (ipa_cached_call_context::duplicate_from): Likewise. > (ipa_call_context::equal_to): Likewise. > (remap_edge_params): Likewise. > (ipa_merge_fn_summary_after_inlining): Likewise. > (inline_read_section): Likewise. > * ipa-icf.c (sem_function::param_used_p): Likewise. > * ipa-modref.c (compute_parm_map): Likewise. > (compute_parm_map): Replaced IPA_EDGE_REF with a direct use of > ipa_edge_args_sum. > (get_access_for_fnspec): Replaced IPA_NODE_REF with a direct use of > ipa_node_params_sum and replaced IPA_EDGE_REF with a direct use of > ipa_edge_args_sum. > * ipa-profile.c (check_argument_count): Likewise. > * ipa-prop.c (ipa_alloc_node_params): Replaced IPA_NODE_REF_GET_CREATE > with a direct use of ipa_node_params_sum. > (ipa_initialize_node_params): Likewise. > (ipa_print_node_jump_functions_for_edge): Replaced IPA_EDGE_REF with a > direct use of ipa_edge_args_sum and reused the query result. > (ipa_compute_jump_functions_for_edge): Replaced IPA_NODE_REF with a > direct use of ipa_node_params_sum and replaced IPA_EDGE_REF with a > direct use of ipa_edge_args_sum. > (ipa_note_param_call): Replaced IPA_NODE_REF with a direct use of > ipa_node_params_sum and reused the result of the query. > (ipa_analyze_node): Likewise. > (ipa_analyze_controlled_uses): Replaced IPA_NODE_REF with a direct use > of ipa_node_params_sum. > (update_jump_functions_after_inlining): Replaced IPA_EDGE_REF with > direct uses of ipa_edge_args_sum. > (update_indirect_edges_after_inlining): Replaced IPA_NODE_REF with > direct uses of ipa_node_params_sum and replaced IPA_EDGE_REF with a > direct use of ipa_edge_args_sum. Removed superficial re-querying the > top edge summary. > (propagate_controlled_uses): Replaced IPA_NODE_REF with direct uses of > ipa_node_params_sum and replaced IPA_EDGE_REF with a direct use of > ipa_edge_args_sum. > (ipa_propagate_indirect_call_infos): Replaced IPA_EDGE_REF with a > direct use of ipa_edge_args_sum. > (ipa_edge_args_sum_t::duplicate): Replaced IPA_NODE_REF with a direct > use of ipa_node_params_sum. > (ipa_print_node_params): Likewise. > (ipa_write_node_info): Likewise and also replaced IPA_EDGE_REF with > direct uses of ipa_edge_args_sum. > (ipa_read_edge_info): Replaced IPA_EDGE_REF with a direct use of > ipa_edge_args_sum. > (ipa_read_node_info): Replaced IPA_NODE_REF with a direct use of > ipa_node_params_sum. > (ipa_prop_write_jump_functions): Likewise. Move variable node to the > scopes where it is used. > --- > gcc/ipa-cp.c | 203 +++++++++++++++++++++++--------------------- > gcc/ipa-fnsummary.c | 30 ++++--- > gcc/ipa-icf.c | 4 +- > gcc/ipa-modref.c | 15 ++-- > gcc/ipa-profile.c | 4 +- > gcc/ipa-prop.c | 76 ++++++++--------- > gcc/ipa-prop.h | 10 --- > 7 files changed, 172 insertions(+), 170 deletions(-) > > diff --git a/gcc/ipa-cp.c b/gcc/ipa-cp.c > index 6041f75d824..2cae69e5a1b 100644 > --- a/gcc/ipa-cp.c > +++ b/gcc/ipa-cp.c > @@ -550,7 +550,7 @@ print_all_lattices (FILE * f, bool dump_sources, bool dump_benefits) > { > 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) > @@ -666,7 +666,8 @@ determine_versionability (struct cgraph_node *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. */ > @@ -861,7 +862,7 @@ free_toporder_info (class ipa_topo_info *topo) > 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; > @@ -879,7 +880,7 @@ pop_node_from_stack (class ipa_topo_info *topo) > 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 > @@ -1178,11 +1179,12 @@ set_single_call_flag (cgraph_node *node, void *) > /* 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; > } > > @@ -1191,7 +1193,7 @@ set_single_call_flag (cgraph_node *node, void *) > 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; > @@ -1482,7 +1484,7 @@ ipa_polymorphic_call_context > 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; > @@ -1769,7 +1771,7 @@ ipcp_verify_propagated_values (void) > > 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; > @@ -1957,7 +1959,7 @@ self_recursively_generated_p (ipcp_value<tree> *val) > 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); > @@ -2196,7 +2198,7 @@ propagate_scalar_across_jump_function (struct cgraph_edge *cs, > 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; > @@ -2243,9 +2245,9 @@ propagate_context_across_jump_function (cgraph_edge *cs, > 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; > @@ -2259,7 +2261,7 @@ propagate_context_across_jump_function (cgraph_edge *cs, > 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; > > @@ -2334,7 +2336,7 @@ propagate_bits_across_jump_function (cgraph_edge *cs, int idx, > > 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 > @@ -2357,7 +2359,7 @@ propagate_bits_across_jump_function (cgraph_edge *cs, int idx, > 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; > @@ -2430,7 +2432,7 @@ propagate_vr_across_jump_function (cgraph_edge *cs, ipa_jump_func *jfunc, > 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); > @@ -2702,7 +2704,7 @@ propagate_aggregate_lattice (struct cgraph_edge *cs, > 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); > > @@ -2768,7 +2770,7 @@ propagate_aggs_across_jump_function (struct cgraph_edge *cs, > 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; > > @@ -2786,7 +2788,7 @@ propagate_aggs_across_jump_function (struct cgraph_edge *cs, > 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; > > @@ -2873,11 +2875,11 @@ propagate_constants_across_call (struct cgraph_edge *cs) > 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; > @@ -3296,7 +3298,7 @@ good_cloning_opportunity_p (struct cgraph_node *node, sreal time_benefit, > > 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 ()) > { > @@ -3501,7 +3503,7 @@ get_max_overall_size (cgraph_node *node) > 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; > @@ -3746,7 +3748,7 @@ value_topo_info<valtype>::add_val (ipcp_value<valtype> *cur_val) > 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++) > @@ -3830,7 +3832,7 @@ propagate_constants_topo (class ipa_topo_info *topo) > > if (!info) > { > - info = IPA_NODE_REF (v); > + info = ipa_node_params_sum->get (v); > info->node_within_scc = true; > } > > @@ -3940,7 +3942,7 @@ ipcp_propagate_stage (class ipa_topo_info *topo) > && 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); > @@ -4004,7 +4006,7 @@ ipcp_discover_new_direct_edges (struct cgraph_node *node, > > 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) > { > @@ -4103,7 +4105,7 @@ calls_same_node_or_its_all_contexts_clone_p (cgraph_edge *cs, cgraph_node *dest, > 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; > } > > @@ -4114,7 +4116,7 @@ static bool > 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) > @@ -4168,7 +4170,7 @@ cgraph_edge_brings_value_p (cgraph_edge *cs, > 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) > @@ -4243,7 +4245,7 @@ get_info_about_necessary_edges (ipcp_value<valtype> *val, cgraph_node *dest, > *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; > > @@ -4494,7 +4496,7 @@ want_remove_some_param_p (cgraph_node *node, vec<tree> known_csts) > { > 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++) > @@ -4527,7 +4529,7 @@ create_specialized_node (struct cgraph_node *node, > 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; > @@ -4662,7 +4664,7 @@ create_specialized_node (struct cgraph_node *node, > } > 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; > @@ -4689,8 +4691,8 @@ self_recursive_pass_through_p (cgraph_edge *cs, ipa_jump_func *jfunc, int i, > && 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; > } > @@ -4713,8 +4715,8 @@ self_recursive_agg_pass_through_p (cgraph_edge *cs, ipa_agg_jf_item *jfunc, > && (!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; > } > @@ -4727,7 +4729,7 @@ find_more_scalar_values_for_callers_subset (struct cgraph_node *node, > 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++) > @@ -4746,15 +4748,16 @@ find_more_scalar_values_for_callers_subset (struct cgraph_node *node, > 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 > @@ -4777,8 +4780,8 @@ find_more_scalar_values_for_callers_subset (struct cgraph_node *node, > 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)) > @@ -4818,7 +4821,7 @@ find_more_contexts_for_caller_subset (cgraph_node *node, > *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++) > @@ -4836,14 +4839,14 @@ find_more_contexts_for_caller_subset (cgraph_node *node, > > 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; > @@ -5020,19 +5023,19 @@ intersect_aggregates_with_edge (struct cgraph_edge *cs, int index, > 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 ()) > @@ -5063,7 +5066,7 @@ intersect_aggregates_with_edge (struct cgraph_edge *cs, int index, > 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); > @@ -5092,7 +5095,7 @@ intersect_aggregates_with_edge (struct cgraph_edge *cs, int index, > > 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; > > @@ -5179,7 +5182,7 @@ static struct ipa_agg_replacement_value * > 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; > @@ -5187,12 +5190,13 @@ find_aggregate_values_for_callers_subset (struct cgraph_node *node, > > 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; > } > @@ -5213,7 +5217,7 @@ find_aggregate_values_for_callers_subset (struct cgraph_node *node, > 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))) > @@ -5255,14 +5259,14 @@ static bool > 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; > @@ -5289,7 +5293,6 @@ static bool > 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; > > @@ -5297,14 +5300,16 @@ cgraph_edge_brings_all_agg_vals_for_node (struct cgraph_edge *cs, > 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++) > { > @@ -5522,7 +5527,7 @@ decide_about_value (struct cgraph_node *node, int index, HOST_WIDE_INT offset, > 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); > @@ -5573,7 +5578,7 @@ decide_about_value (struct cgraph_node *node, int index, HOST_WIDE_INT offset, > 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; > > @@ -5622,8 +5627,6 @@ decide_whether_version_node (struct cgraph_node *node) > 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) > @@ -5640,7 +5643,7 @@ decide_whether_version_node (struct cgraph_node *node) > 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); > @@ -5675,9 +5678,8 @@ decide_whether_version_node (struct cgraph_node *node) > } > 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; > } > > @@ -5698,7 +5700,7 @@ spread_undeadness (struct cgraph_node *node) > 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) > { > @@ -5722,10 +5724,13 @@ has_undead_caller_from_outside_scc_p (struct cgraph_node *node, > && 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; > } > > @@ -5738,21 +5743,29 @@ identify_dead_nodes (struct cgraph_node *node) > { > 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 ()); > } > } > > @@ -5798,7 +5811,7 @@ ipcp_store_bits_results (void) > > 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; > > @@ -5812,7 +5825,7 @@ ipcp_store_bits_results (void) > } > > 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; > @@ -5879,7 +5892,7 @@ ipcp_store_vr_results (void) > > 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)) > @@ -5892,7 +5905,7 @@ ipcp_store_vr_results (void) > } > > 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; > diff --git a/gcc/ipa-fnsummary.c b/gcc/ipa-fnsummary.c > index 18bbae145b9..4e5be812734 100644 > --- a/gcc/ipa-fnsummary.c > +++ b/gcc/ipa-fnsummary.c > @@ -590,7 +590,7 @@ evaluate_properties_for_edge (struct cgraph_edge *e, bool inline_p, > if (ipa_node_params_sum > && !e->call_stmt_cannot_inline_p > && (info->conds || compute_contexts) > - && (args = IPA_EDGE_REF (e)) != NULL) > + && (args = ipa_edge_args_sum->get (e)) != NULL) > { > struct cgraph_node *caller; > class ipa_node_params *caller_parms_info, *callee_pi = NULL; > @@ -603,8 +603,8 @@ evaluate_properties_for_edge (struct cgraph_edge *e, bool inline_p, > caller = e->caller->inlined_to; > else > caller = e->caller; > - caller_parms_info = IPA_NODE_REF (caller); > - callee_pi = IPA_NODE_REF (callee); > + caller_parms_info = ipa_node_params_sum->get (caller); > + callee_pi = ipa_node_params_sum->get (callee); > > /* Watch for thunks. */ > if (callee_pi) > @@ -816,7 +816,7 @@ ipa_fn_summary_t::duplicate (cgraph_node *src, > if (ipa_node_params_sum && cinfo && cinfo->tree_map) > { > /* Use SRC parm info since it may not be copied yet. */ > - class ipa_node_params *parms_info = IPA_NODE_REF (src); > + ipa_node_params *parms_info = ipa_node_params_sum->get (src); > ipa_auto_call_arg_values avals; > int count = ipa_get_param_count (parms_info); > int i, j; > @@ -2584,7 +2584,8 @@ analyze_function_body (struct cgraph_node *node, bool early) > struct function *my_function = DECL_STRUCT_FUNCTION (node->decl); > sreal freq; > class ipa_fn_summary *info = ipa_fn_summaries->get_create (node); > - class ipa_node_params *params_summary = early ? NULL : IPA_NODE_REF (node); > + ipa_node_params *params_summary > + = early ? NULL : ipa_node_params_sum->get (node); > predicate bb_predicate; > struct ipa_func_body_info fbi; > vec<predicate> nonconstant_names = vNULL; > @@ -2622,7 +2623,7 @@ analyze_function_body (struct cgraph_node *node, bool early) > if (ipa_node_params_sum) > { > fbi.node = node; > - fbi.info = IPA_NODE_REF (node); > + fbi.info = ipa_node_params_sum->get (node); > fbi.bb_infos = vNULL; > fbi.bb_infos.safe_grow_cleared (last_basic_block_for_fn (cfun), true); > fbi.param_count = count_formal_params (node->decl); > @@ -3368,7 +3369,7 @@ estimate_calls_size_and_time (struct cgraph_node *node, int *size, > || avals->m_known_contexts.length () > || avals->m_known_aggs.length ())) > { > - class ipa_node_params *params_summary = IPA_NODE_REF (node); > + ipa_node_params *params_summary = ipa_node_params_sum->get (node); > unsigned int nargs = params_summary > ? ipa_get_param_count (params_summary) : 0; > > @@ -3463,7 +3464,7 @@ ipa_cached_call_context::duplicate_from (const ipa_call_context &ctx) > m_node = ctx.m_node; > m_possible_truths = ctx.m_possible_truths; > m_nonspec_possible_truths = ctx.m_nonspec_possible_truths; > - class ipa_node_params *params_summary = IPA_NODE_REF (m_node); > + ipa_node_params *params_summary = ipa_node_params_sum->get (m_node); > unsigned int nargs = params_summary > ? ipa_get_param_count (params_summary) : 0; > > @@ -3553,7 +3554,7 @@ ipa_call_context::equal_to (const ipa_call_context &ctx) > || m_nonspec_possible_truths != ctx.m_nonspec_possible_truths) > return false; > > - class ipa_node_params *params_summary = IPA_NODE_REF (m_node); > + ipa_node_params *params_summary = ipa_node_params_sum->get (m_node); > unsigned int nargs = params_summary > ? ipa_get_param_count (params_summary) : 0; > > @@ -3902,7 +3903,7 @@ remap_edge_params (struct cgraph_edge *inlined_edge, > if (ipa_node_params_sum) > { > int i; > - class ipa_edge_args *args = IPA_EDGE_REF (edge); > + ipa_edge_args *args = ipa_edge_args_sum->get (edge); > if (!args) > return; > class ipa_call_summary *es = ipa_call_summaries->get (edge); > @@ -4055,8 +4056,8 @@ ipa_merge_fn_summary_after_inlining (struct cgraph_edge *edge) > int i; > predicate toplev_predicate; > class ipa_call_summary *es = ipa_call_summaries->get (edge); > - class ipa_node_params *params_summary = (ipa_node_params_sum > - ? IPA_NODE_REF (to) : NULL); > + ipa_node_params *params_summary = (ipa_node_params_sum > + ? ipa_node_params_sum->get (to) : NULL); > > if (es->predicate) > toplev_predicate = *es->predicate; > @@ -4072,7 +4073,7 @@ ipa_merge_fn_summary_after_inlining (struct cgraph_edge *edge) > } > if (ipa_node_params_sum && callee_info->conds) > { > - class ipa_edge_args *args = IPA_EDGE_REF (edge); > + ipa_edge_args *args = ipa_edge_args_sum->get (edge); > int count = args ? ipa_get_cs_argument_count (args) : 0; > int i; > > @@ -4384,7 +4385,8 @@ inline_read_section (struct lto_file_decl_data *file_data, const char *data, > node = dyn_cast<cgraph_node *> (lto_symtab_encoder_deref (encoder, > index)); > info = node->prevailing_p () ? ipa_fn_summaries->get_create (node) : NULL; > - params_summary = node->prevailing_p () ? IPA_NODE_REF (node) : NULL; > + params_summary = node->prevailing_p () > + ? ipa_node_params_sum->get (node) : NULL; > size_info = node->prevailing_p () > ? ipa_size_summaries->get_create (node) : NULL; > > diff --git a/gcc/ipa-icf.c b/gcc/ipa-icf.c > index 5dd33a75c3a..4c1f25d0834 100644 > --- a/gcc/ipa-icf.c > +++ b/gcc/ipa-icf.c > @@ -496,12 +496,12 @@ sem_function::param_used_p (unsigned int i) > if (ipa_node_params_sum == NULL) > return true; > > - class ipa_node_params *parms_info = IPA_NODE_REF (get_node ()); > + ipa_node_params *parms_info = ipa_node_params_sum->get (get_node ()); > > if (!parms_info || vec_safe_length (parms_info->descriptors) <= i) > return true; > > - return ipa_is_param_used (IPA_NODE_REF (get_node ()), i); > + return ipa_is_param_used (parms_info, i); > } > > /* Perform additional check needed to match types function parameters that are > diff --git a/gcc/ipa-modref.c b/gcc/ipa-modref.c > index e7f79caf34d..d5a8332fb55 100644 > --- a/gcc/ipa-modref.c > +++ b/gcc/ipa-modref.c > @@ -2899,7 +2899,7 @@ compute_parm_map (cgraph_edge *callee_edge, vec<modref_parm_map> *parm_map) > class ipa_edge_args *args; > if (ipa_node_params_sum > && !callee_edge->call_stmt_cannot_inline_p > - && (args = IPA_EDGE_REF (callee_edge)) != NULL) > + && (args = ipa_edge_args_sum->get (callee_edge)) != NULL) > { > int i, count = ipa_get_cs_argument_count (args); > class ipa_node_params *caller_parms_info, *callee_pi; > @@ -2909,10 +2909,11 @@ compute_parm_map (cgraph_edge *callee_edge, vec<modref_parm_map> *parm_map) > = callee_edge->callee->function_or_virtual_thunk_symbol > (NULL, callee_edge->caller); > > - caller_parms_info = IPA_NODE_REF (callee_edge->caller->inlined_to > - ? callee_edge->caller->inlined_to > - : callee_edge->caller); > - callee_pi = IPA_NODE_REF (callee); > + caller_parms_info > + = ipa_node_params_sum->get (callee_edge->caller->inlined_to > + ? callee_edge->caller->inlined_to > + : callee_edge->caller); > + callee_pi = ipa_node_params_sum->get (callee); > > (*parm_map).safe_grow_cleared (count, true); > > @@ -3240,8 +3241,8 @@ get_access_for_fnspec (cgraph_edge *e, attr_fnspec &fnspec, > { > cgraph_node *node = e->caller->inlined_to > ? e->caller->inlined_to : e->caller; > - class ipa_node_params *caller_parms_info = IPA_NODE_REF (node); > - class ipa_edge_args *args = IPA_EDGE_REF (e); > + ipa_node_params *caller_parms_info = ipa_node_params_sum->get (node); > + ipa_edge_args *args = ipa_edge_args_sum->get (e); > struct ipa_jump_func *jf = ipa_get_ith_jump_func (args, size_arg); > > if (jf) > diff --git a/gcc/ipa-profile.c b/gcc/ipa-profile.c > index 5354ce03923..ce32b538976 100644 > --- a/gcc/ipa-profile.c > +++ b/gcc/ipa-profile.c > @@ -740,10 +740,10 @@ check_argument_count (struct cgraph_node *n, struct cgraph_edge *e) > { > if (!ipa_node_params_sum || !ipa_edge_args_sum) > return true; > - class ipa_node_params *info = IPA_NODE_REF (n->function_symbol ()); > + ipa_node_params *info = ipa_node_params_sum->get (n->function_symbol ()); > if (!info) > return true; > - ipa_edge_args *e_info = IPA_EDGE_REF (e); > + ipa_edge_args *e_info = ipa_edge_args_sum->get (e); > if (!e_info) > return true; > if (ipa_get_param_count (info) != ipa_get_cs_argument_count (e_info) > diff --git a/gcc/ipa-prop.c b/gcc/ipa-prop.c > index 02c483b10dd..0591ef1b569 100644 > --- a/gcc/ipa-prop.c > +++ b/gcc/ipa-prop.c > @@ -276,7 +276,7 @@ ipa_dump_param (FILE *file, class ipa_node_params *info, int i) > 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) > { > @@ -294,7 +294,7 @@ ipa_alloc_node_params (struct cgraph_node *node, int 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))) > @@ -306,15 +306,15 @@ ipa_initialize_node_params (struct cgraph_node *node) > 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); > @@ -410,7 +410,7 @@ ipa_print_node_jump_functions_for_edge (FILE *f, struct cgraph_edge *cs) > } > > 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: "); > @@ -2232,8 +2232,8 @@ static void > 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; > @@ -2509,11 +2509,10 @@ ipa_note_param_call (struct cgraph_node *node, int param_index, > 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; > } > > @@ -2884,7 +2883,7 @@ ipa_analyze_params_uses_in_bb (struct ipa_func_body_info *fbi, basic_block bb) > 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++) > { > @@ -2980,7 +2979,7 @@ ipa_analyze_node (struct cgraph_node *node) > > 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; > @@ -3003,7 +3002,7 @@ ipa_analyze_node (struct cgraph_node *node) > 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); > @@ -3036,8 +3035,8 @@ static void > 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); > @@ -3889,11 +3888,11 @@ update_indirect_edges_after_inlining (struct cgraph_edge *cs, > 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) > { > @@ -3947,7 +3946,6 @@ update_indirect_edges_after_inlining (struct cgraph_edge *cs, > && 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; > @@ -3960,7 +3958,6 @@ update_indirect_edges_after_inlining (struct cgraph_edge *cs, > 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) > @@ -4060,13 +4057,13 @@ combine_controlled_uses_counters (int c, int d) > 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) > @@ -4195,7 +4192,7 @@ ipa_propagate_indirect_call_infos (struct cgraph_edge *cs, > 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; > @@ -4403,7 +4400,7 @@ ipa_edge_args_sum_t::duplicate (cgraph_edge *src, cgraph_edge *dst, > { > 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); > @@ -4553,7 +4550,7 @@ ipa_print_node_params (FILE *f, struct cgraph_node *node) > > 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) > { > @@ -4956,7 +4953,7 @@ ipa_write_node_info (struct output_block *ob, struct cgraph_node *node) > { > 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; > @@ -4983,7 +4980,7 @@ ipa_write_node_info (struct output_block *ob, struct cgraph_node *node) > } > 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) > { > @@ -5003,7 +5000,7 @@ ipa_write_node_info (struct output_block *ob, struct cgraph_node *node) > } > 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 > @@ -5041,7 +5038,7 @@ ipa_read_edge_info (class lto_input_block *ib, > 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); > @@ -5080,8 +5077,8 @@ ipa_read_node_info (class lto_input_block *ib, struct cgraph_node *node, > 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) > @@ -5130,7 +5127,6 @@ ipa_read_node_info (class lto_input_block *ib, struct cgraph_node *node, > void > ipa_prop_write_jump_functions (void) > { > - struct cgraph_node *node; > struct output_block *ob; > unsigned int count = 0; > lto_symtab_encoder_iterator lsei; > @@ -5145,9 +5141,9 @@ ipa_prop_write_jump_functions (void) > 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++; > } > > @@ -5157,9 +5153,9 @@ ipa_prop_write_jump_functions (void) > 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); > diff --git a/gcc/ipa-prop.h b/gcc/ipa-prop.h > index 1f0e6c64873..3d28a6e8640 100644 > --- a/gcc/ipa-prop.h > +++ b/gcc/ipa-prop.h > @@ -1017,16 +1017,6 @@ public: > /* Function summary where the IPA CP transformations are actually stored. */ > extern GTY(()) function_summary <ipcp_transformation *> *ipcp_transformation_sum; > > -/* Return the associated parameter/argument info corresponding to the given > - node/edge. */ > -#define IPA_NODE_REF(NODE) (ipa_node_params_sum->get (NODE)) > -#define IPA_NODE_REF_GET_CREATE(NODE) (ipa_node_params_sum->get_create (NODE)) > -#define IPA_EDGE_REF(EDGE) (ipa_edge_args_sum->get (EDGE)) > -#define IPA_EDGE_REF_GET_CREATE(EDGE) (ipa_edge_args_sum->get_create (EDGE)) > -/* This macro checks validity of index returned by > - ipa_get_param_decl_index function. */ > -#define IS_VALID_JUMP_FUNC_INDEX(I) ((I) != -1) > - > /* Creating and freeing ipa_node_params and ipa_edge_args. */ > void ipa_create_all_node_params (void); > void ipa_create_all_edge_args (void); > -- > 2.31.1 >
diff --git a/gcc/ipa-cp.c b/gcc/ipa-cp.c index 6041f75d824..2cae69e5a1b 100644 --- a/gcc/ipa-cp.c +++ b/gcc/ipa-cp.c @@ -550,7 +550,7 @@ print_all_lattices (FILE * f, bool dump_sources, bool dump_benefits) { 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) @@ -666,7 +666,8 @@ determine_versionability (struct cgraph_node *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. */ @@ -861,7 +862,7 @@ free_toporder_info (class ipa_topo_info *topo) 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; @@ -879,7 +880,7 @@ pop_node_from_stack (class ipa_topo_info *topo) 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 @@ -1178,11 +1179,12 @@ set_single_call_flag (cgraph_node *node, void *) /* 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; } @@ -1191,7 +1193,7 @@ set_single_call_flag (cgraph_node *node, void *) 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; @@ -1482,7 +1484,7 @@ ipa_polymorphic_call_context 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; @@ -1769,7 +1771,7 @@ ipcp_verify_propagated_values (void) 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; @@ -1957,7 +1959,7 @@ self_recursively_generated_p (ipcp_value<tree> *val) 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); @@ -2196,7 +2198,7 @@ propagate_scalar_across_jump_function (struct cgraph_edge *cs, 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; @@ -2243,9 +2245,9 @@ propagate_context_across_jump_function (cgraph_edge *cs, 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; @@ -2259,7 +2261,7 @@ propagate_context_across_jump_function (cgraph_edge *cs, 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; @@ -2334,7 +2336,7 @@ propagate_bits_across_jump_function (cgraph_edge *cs, int idx, 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 @@ -2357,7 +2359,7 @@ propagate_bits_across_jump_function (cgraph_edge *cs, int idx, 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; @@ -2430,7 +2432,7 @@ propagate_vr_across_jump_function (cgraph_edge *cs, ipa_jump_func *jfunc, 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); @@ -2702,7 +2704,7 @@ propagate_aggregate_lattice (struct cgraph_edge *cs, 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); @@ -2768,7 +2770,7 @@ propagate_aggs_across_jump_function (struct cgraph_edge *cs, 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; @@ -2786,7 +2788,7 @@ propagate_aggs_across_jump_function (struct cgraph_edge *cs, 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; @@ -2873,11 +2875,11 @@ propagate_constants_across_call (struct cgraph_edge *cs) 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; @@ -3296,7 +3298,7 @@ good_cloning_opportunity_p (struct cgraph_node *node, sreal time_benefit, 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 ()) { @@ -3501,7 +3503,7 @@ get_max_overall_size (cgraph_node *node) 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; @@ -3746,7 +3748,7 @@ value_topo_info<valtype>::add_val (ipcp_value<valtype> *cur_val) 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++) @@ -3830,7 +3832,7 @@ propagate_constants_topo (class ipa_topo_info *topo) if (!info) { - info = IPA_NODE_REF (v); + info = ipa_node_params_sum->get (v); info->node_within_scc = true; } @@ -3940,7 +3942,7 @@ ipcp_propagate_stage (class ipa_topo_info *topo) && 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); @@ -4004,7 +4006,7 @@ ipcp_discover_new_direct_edges (struct cgraph_node *node, 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) { @@ -4103,7 +4105,7 @@ calls_same_node_or_its_all_contexts_clone_p (cgraph_edge *cs, cgraph_node *dest, 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; } @@ -4114,7 +4116,7 @@ static bool 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) @@ -4168,7 +4170,7 @@ cgraph_edge_brings_value_p (cgraph_edge *cs, 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) @@ -4243,7 +4245,7 @@ get_info_about_necessary_edges (ipcp_value<valtype> *val, cgraph_node *dest, *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; @@ -4494,7 +4496,7 @@ want_remove_some_param_p (cgraph_node *node, vec<tree> known_csts) { 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++) @@ -4527,7 +4529,7 @@ create_specialized_node (struct cgraph_node *node, 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; @@ -4662,7 +4664,7 @@ create_specialized_node (struct cgraph_node *node, } 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; @@ -4689,8 +4691,8 @@ self_recursive_pass_through_p (cgraph_edge *cs, ipa_jump_func *jfunc, int i, && 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; } @@ -4713,8 +4715,8 @@ self_recursive_agg_pass_through_p (cgraph_edge *cs, ipa_agg_jf_item *jfunc, && (!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; } @@ -4727,7 +4729,7 @@ find_more_scalar_values_for_callers_subset (struct cgraph_node *node, 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++) @@ -4746,15 +4748,16 @@ find_more_scalar_values_for_callers_subset (struct cgraph_node *node, 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 @@ -4777,8 +4780,8 @@ find_more_scalar_values_for_callers_subset (struct cgraph_node *node, 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)) @@ -4818,7 +4821,7 @@ find_more_contexts_for_caller_subset (cgraph_node *node, *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++) @@ -4836,14 +4839,14 @@ find_more_contexts_for_caller_subset (cgraph_node *node, 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; @@ -5020,19 +5023,19 @@ intersect_aggregates_with_edge (struct cgraph_edge *cs, int index, 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 ()) @@ -5063,7 +5066,7 @@ intersect_aggregates_with_edge (struct cgraph_edge *cs, int index, 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); @@ -5092,7 +5095,7 @@ intersect_aggregates_with_edge (struct cgraph_edge *cs, int index, 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; @@ -5179,7 +5182,7 @@ static struct ipa_agg_replacement_value * 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; @@ -5187,12 +5190,13 @@ find_aggregate_values_for_callers_subset (struct cgraph_node *node, 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; } @@ -5213,7 +5217,7 @@ find_aggregate_values_for_callers_subset (struct cgraph_node *node, 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))) @@ -5255,14 +5259,14 @@ static bool 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; @@ -5289,7 +5293,6 @@ static bool 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; @@ -5297,14 +5300,16 @@ cgraph_edge_brings_all_agg_vals_for_node (struct cgraph_edge *cs, 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++) { @@ -5522,7 +5527,7 @@ decide_about_value (struct cgraph_node *node, int index, HOST_WIDE_INT offset, 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); @@ -5573,7 +5578,7 @@ decide_about_value (struct cgraph_node *node, int index, HOST_WIDE_INT offset, 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; @@ -5622,8 +5627,6 @@ decide_whether_version_node (struct cgraph_node *node) 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) @@ -5640,7 +5643,7 @@ decide_whether_version_node (struct cgraph_node *node) 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); @@ -5675,9 +5678,8 @@ decide_whether_version_node (struct cgraph_node *node) } 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; } @@ -5698,7 +5700,7 @@ spread_undeadness (struct cgraph_node *node) 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) { @@ -5722,10 +5724,13 @@ has_undead_caller_from_outside_scc_p (struct cgraph_node *node, && 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; } @@ -5738,21 +5743,29 @@ identify_dead_nodes (struct cgraph_node *node) { 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 ()); } } @@ -5798,7 +5811,7 @@ ipcp_store_bits_results (void) 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; @@ -5812,7 +5825,7 @@ ipcp_store_bits_results (void) } 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; @@ -5879,7 +5892,7 @@ ipcp_store_vr_results (void) 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)) @@ -5892,7 +5905,7 @@ ipcp_store_vr_results (void) } 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; diff --git a/gcc/ipa-fnsummary.c b/gcc/ipa-fnsummary.c index 18bbae145b9..4e5be812734 100644 --- a/gcc/ipa-fnsummary.c +++ b/gcc/ipa-fnsummary.c @@ -590,7 +590,7 @@ evaluate_properties_for_edge (struct cgraph_edge *e, bool inline_p, if (ipa_node_params_sum && !e->call_stmt_cannot_inline_p && (info->conds || compute_contexts) - && (args = IPA_EDGE_REF (e)) != NULL) + && (args = ipa_edge_args_sum->get (e)) != NULL) { struct cgraph_node *caller; class ipa_node_params *caller_parms_info, *callee_pi = NULL; @@ -603,8 +603,8 @@ evaluate_properties_for_edge (struct cgraph_edge *e, bool inline_p, caller = e->caller->inlined_to; else caller = e->caller; - caller_parms_info = IPA_NODE_REF (caller); - callee_pi = IPA_NODE_REF (callee); + caller_parms_info = ipa_node_params_sum->get (caller); + callee_pi = ipa_node_params_sum->get (callee); /* Watch for thunks. */ if (callee_pi) @@ -816,7 +816,7 @@ ipa_fn_summary_t::duplicate (cgraph_node *src, if (ipa_node_params_sum && cinfo && cinfo->tree_map) { /* Use SRC parm info since it may not be copied yet. */ - class ipa_node_params *parms_info = IPA_NODE_REF (src); + ipa_node_params *parms_info = ipa_node_params_sum->get (src); ipa_auto_call_arg_values avals; int count = ipa_get_param_count (parms_info); int i, j; @@ -2584,7 +2584,8 @@ analyze_function_body (struct cgraph_node *node, bool early) struct function *my_function = DECL_STRUCT_FUNCTION (node->decl); sreal freq; class ipa_fn_summary *info = ipa_fn_summaries->get_create (node); - class ipa_node_params *params_summary = early ? NULL : IPA_NODE_REF (node); + ipa_node_params *params_summary + = early ? NULL : ipa_node_params_sum->get (node); predicate bb_predicate; struct ipa_func_body_info fbi; vec<predicate> nonconstant_names = vNULL; @@ -2622,7 +2623,7 @@ analyze_function_body (struct cgraph_node *node, bool early) if (ipa_node_params_sum) { fbi.node = node; - fbi.info = IPA_NODE_REF (node); + fbi.info = ipa_node_params_sum->get (node); fbi.bb_infos = vNULL; fbi.bb_infos.safe_grow_cleared (last_basic_block_for_fn (cfun), true); fbi.param_count = count_formal_params (node->decl); @@ -3368,7 +3369,7 @@ estimate_calls_size_and_time (struct cgraph_node *node, int *size, || avals->m_known_contexts.length () || avals->m_known_aggs.length ())) { - class ipa_node_params *params_summary = IPA_NODE_REF (node); + ipa_node_params *params_summary = ipa_node_params_sum->get (node); unsigned int nargs = params_summary ? ipa_get_param_count (params_summary) : 0; @@ -3463,7 +3464,7 @@ ipa_cached_call_context::duplicate_from (const ipa_call_context &ctx) m_node = ctx.m_node; m_possible_truths = ctx.m_possible_truths; m_nonspec_possible_truths = ctx.m_nonspec_possible_truths; - class ipa_node_params *params_summary = IPA_NODE_REF (m_node); + ipa_node_params *params_summary = ipa_node_params_sum->get (m_node); unsigned int nargs = params_summary ? ipa_get_param_count (params_summary) : 0; @@ -3553,7 +3554,7 @@ ipa_call_context::equal_to (const ipa_call_context &ctx) || m_nonspec_possible_truths != ctx.m_nonspec_possible_truths) return false; - class ipa_node_params *params_summary = IPA_NODE_REF (m_node); + ipa_node_params *params_summary = ipa_node_params_sum->get (m_node); unsigned int nargs = params_summary ? ipa_get_param_count (params_summary) : 0; @@ -3902,7 +3903,7 @@ remap_edge_params (struct cgraph_edge *inlined_edge, if (ipa_node_params_sum) { int i; - class ipa_edge_args *args = IPA_EDGE_REF (edge); + ipa_edge_args *args = ipa_edge_args_sum->get (edge); if (!args) return; class ipa_call_summary *es = ipa_call_summaries->get (edge); @@ -4055,8 +4056,8 @@ ipa_merge_fn_summary_after_inlining (struct cgraph_edge *edge) int i; predicate toplev_predicate; class ipa_call_summary *es = ipa_call_summaries->get (edge); - class ipa_node_params *params_summary = (ipa_node_params_sum - ? IPA_NODE_REF (to) : NULL); + ipa_node_params *params_summary = (ipa_node_params_sum + ? ipa_node_params_sum->get (to) : NULL); if (es->predicate) toplev_predicate = *es->predicate; @@ -4072,7 +4073,7 @@ ipa_merge_fn_summary_after_inlining (struct cgraph_edge *edge) } if (ipa_node_params_sum && callee_info->conds) { - class ipa_edge_args *args = IPA_EDGE_REF (edge); + ipa_edge_args *args = ipa_edge_args_sum->get (edge); int count = args ? ipa_get_cs_argument_count (args) : 0; int i; @@ -4384,7 +4385,8 @@ inline_read_section (struct lto_file_decl_data *file_data, const char *data, node = dyn_cast<cgraph_node *> (lto_symtab_encoder_deref (encoder, index)); info = node->prevailing_p () ? ipa_fn_summaries->get_create (node) : NULL; - params_summary = node->prevailing_p () ? IPA_NODE_REF (node) : NULL; + params_summary = node->prevailing_p () + ? ipa_node_params_sum->get (node) : NULL; size_info = node->prevailing_p () ? ipa_size_summaries->get_create (node) : NULL; diff --git a/gcc/ipa-icf.c b/gcc/ipa-icf.c index 5dd33a75c3a..4c1f25d0834 100644 --- a/gcc/ipa-icf.c +++ b/gcc/ipa-icf.c @@ -496,12 +496,12 @@ sem_function::param_used_p (unsigned int i) if (ipa_node_params_sum == NULL) return true; - class ipa_node_params *parms_info = IPA_NODE_REF (get_node ()); + ipa_node_params *parms_info = ipa_node_params_sum->get (get_node ()); if (!parms_info || vec_safe_length (parms_info->descriptors) <= i) return true; - return ipa_is_param_used (IPA_NODE_REF (get_node ()), i); + return ipa_is_param_used (parms_info, i); } /* Perform additional check needed to match types function parameters that are diff --git a/gcc/ipa-modref.c b/gcc/ipa-modref.c index e7f79caf34d..d5a8332fb55 100644 --- a/gcc/ipa-modref.c +++ b/gcc/ipa-modref.c @@ -2899,7 +2899,7 @@ compute_parm_map (cgraph_edge *callee_edge, vec<modref_parm_map> *parm_map) class ipa_edge_args *args; if (ipa_node_params_sum && !callee_edge->call_stmt_cannot_inline_p - && (args = IPA_EDGE_REF (callee_edge)) != NULL) + && (args = ipa_edge_args_sum->get (callee_edge)) != NULL) { int i, count = ipa_get_cs_argument_count (args); class ipa_node_params *caller_parms_info, *callee_pi; @@ -2909,10 +2909,11 @@ compute_parm_map (cgraph_edge *callee_edge, vec<modref_parm_map> *parm_map) = callee_edge->callee->function_or_virtual_thunk_symbol (NULL, callee_edge->caller); - caller_parms_info = IPA_NODE_REF (callee_edge->caller->inlined_to - ? callee_edge->caller->inlined_to - : callee_edge->caller); - callee_pi = IPA_NODE_REF (callee); + caller_parms_info + = ipa_node_params_sum->get (callee_edge->caller->inlined_to + ? callee_edge->caller->inlined_to + : callee_edge->caller); + callee_pi = ipa_node_params_sum->get (callee); (*parm_map).safe_grow_cleared (count, true); @@ -3240,8 +3241,8 @@ get_access_for_fnspec (cgraph_edge *e, attr_fnspec &fnspec, { cgraph_node *node = e->caller->inlined_to ? e->caller->inlined_to : e->caller; - class ipa_node_params *caller_parms_info = IPA_NODE_REF (node); - class ipa_edge_args *args = IPA_EDGE_REF (e); + ipa_node_params *caller_parms_info = ipa_node_params_sum->get (node); + ipa_edge_args *args = ipa_edge_args_sum->get (e); struct ipa_jump_func *jf = ipa_get_ith_jump_func (args, size_arg); if (jf) diff --git a/gcc/ipa-profile.c b/gcc/ipa-profile.c index 5354ce03923..ce32b538976 100644 --- a/gcc/ipa-profile.c +++ b/gcc/ipa-profile.c @@ -740,10 +740,10 @@ check_argument_count (struct cgraph_node *n, struct cgraph_edge *e) { if (!ipa_node_params_sum || !ipa_edge_args_sum) return true; - class ipa_node_params *info = IPA_NODE_REF (n->function_symbol ()); + ipa_node_params *info = ipa_node_params_sum->get (n->function_symbol ()); if (!info) return true; - ipa_edge_args *e_info = IPA_EDGE_REF (e); + ipa_edge_args *e_info = ipa_edge_args_sum->get (e); if (!e_info) return true; if (ipa_get_param_count (info) != ipa_get_cs_argument_count (e_info) diff --git a/gcc/ipa-prop.c b/gcc/ipa-prop.c index 02c483b10dd..0591ef1b569 100644 --- a/gcc/ipa-prop.c +++ b/gcc/ipa-prop.c @@ -276,7 +276,7 @@ ipa_dump_param (FILE *file, class ipa_node_params *info, int i) 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) { @@ -294,7 +294,7 @@ ipa_alloc_node_params (struct cgraph_node *node, int 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))) @@ -306,15 +306,15 @@ ipa_initialize_node_params (struct cgraph_node *node) 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); @@ -410,7 +410,7 @@ ipa_print_node_jump_functions_for_edge (FILE *f, struct cgraph_edge *cs) } 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: "); @@ -2232,8 +2232,8 @@ static void 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; @@ -2509,11 +2509,10 @@ ipa_note_param_call (struct cgraph_node *node, int param_index, 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; } @@ -2884,7 +2883,7 @@ ipa_analyze_params_uses_in_bb (struct ipa_func_body_info *fbi, basic_block bb) 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++) { @@ -2980,7 +2979,7 @@ ipa_analyze_node (struct cgraph_node *node) 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; @@ -3003,7 +3002,7 @@ ipa_analyze_node (struct cgraph_node *node) 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); @@ -3036,8 +3035,8 @@ static void 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); @@ -3889,11 +3888,11 @@ update_indirect_edges_after_inlining (struct cgraph_edge *cs, 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) { @@ -3947,7 +3946,6 @@ update_indirect_edges_after_inlining (struct cgraph_edge *cs, && 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; @@ -3960,7 +3958,6 @@ update_indirect_edges_after_inlining (struct cgraph_edge *cs, 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) @@ -4060,13 +4057,13 @@ combine_controlled_uses_counters (int c, int d) 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) @@ -4195,7 +4192,7 @@ ipa_propagate_indirect_call_infos (struct cgraph_edge *cs, 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; @@ -4403,7 +4400,7 @@ ipa_edge_args_sum_t::duplicate (cgraph_edge *src, cgraph_edge *dst, { 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); @@ -4553,7 +4550,7 @@ ipa_print_node_params (FILE *f, struct cgraph_node *node) 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) { @@ -4956,7 +4953,7 @@ ipa_write_node_info (struct output_block *ob, struct cgraph_node *node) { 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; @@ -4983,7 +4980,7 @@ ipa_write_node_info (struct output_block *ob, struct cgraph_node *node) } 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) { @@ -5003,7 +5000,7 @@ ipa_write_node_info (struct output_block *ob, struct cgraph_node *node) } 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 @@ -5041,7 +5038,7 @@ ipa_read_edge_info (class lto_input_block *ib, 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); @@ -5080,8 +5077,8 @@ ipa_read_node_info (class lto_input_block *ib, struct cgraph_node *node, 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) @@ -5130,7 +5127,6 @@ ipa_read_node_info (class lto_input_block *ib, struct cgraph_node *node, void ipa_prop_write_jump_functions (void) { - struct cgraph_node *node; struct output_block *ob; unsigned int count = 0; lto_symtab_encoder_iterator lsei; @@ -5145,9 +5141,9 @@ ipa_prop_write_jump_functions (void) 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++; } @@ -5157,9 +5153,9 @@ ipa_prop_write_jump_functions (void) 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); diff --git a/gcc/ipa-prop.h b/gcc/ipa-prop.h index 1f0e6c64873..3d28a6e8640 100644 --- a/gcc/ipa-prop.h +++ b/gcc/ipa-prop.h @@ -1017,16 +1017,6 @@ public: /* Function summary where the IPA CP transformations are actually stored. */ extern GTY(()) function_summary <ipcp_transformation *> *ipcp_transformation_sum; -/* Return the associated parameter/argument info corresponding to the given - node/edge. */ -#define IPA_NODE_REF(NODE) (ipa_node_params_sum->get (NODE)) -#define IPA_NODE_REF_GET_CREATE(NODE) (ipa_node_params_sum->get_create (NODE)) -#define IPA_EDGE_REF(EDGE) (ipa_edge_args_sum->get (EDGE)) -#define IPA_EDGE_REF_GET_CREATE(EDGE) (ipa_edge_args_sum->get_create (EDGE)) -/* This macro checks validity of index returned by - ipa_get_param_decl_index function. */ -#define IS_VALID_JUMP_FUNC_INDEX(I) ((I) != -1) - /* Creating and freeing ipa_node_params and ipa_edge_args. */ void ipa_create_all_node_params (void); void ipa_create_all_edge_args (void);