From: Martin Liska Date: Wed, 30 Oct 2019 07:56:22 +0000 (+0100) Subject: Remove cgraph_local_info structure. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=87f94429feeb72587549fdafd3106f1d799607ff;p=gcc.git Remove cgraph_local_info structure. 2019-10-30 Martin Liska * cgraph.c (cgraph_node::local_info): Transform to ... (cgraph_node::local_info_node): ... this. (cgraph_node::dump): Remove cgraph_local_info and put its fields directly into cgraph_node. (cgraph_node::get_availability): Likewise. (cgraph_node::make_local): Likewise. (cgraph_node::verify_node): Likewise. * cgraph.h (struct GTY): Likewise. * cgraphclones.c (set_new_clone_decl_and_node_flags): Likewise. (duplicate_thunk_for_node): Likewise. (cgraph_node::create_clone): Likewise. (cgraph_node::create_virtual_clone): Likewise. (cgraph_node::create_version_clone): Likewise. * cgraphunit.c (cgraph_node::reset): Likewise. (cgraph_node::finalize_function): Likewise. (cgraph_node::add_new_function): Likewise. (analyze_functions): Likewise. * combine.c (setup_incoming_promotions): Likewise. * config/i386/i386.c (ix86_function_regparm): Likewise. (ix86_function_sseregparm): Likewise. (init_cumulative_args): Likewise. * ipa-cp.c (determine_versionability): Likewise. (count_callers): Likewise. (set_single_call_flag): Likewise. (initialize_node_lattices): Likewise. (estimate_local_effects): Likewise. (create_specialized_node): Likewise. (identify_dead_nodes): Likewise. * ipa-fnsummary.c (compute_fn_summary): Likewise. (ipa_fn_summary_generate): Likewise. * ipa-hsa.c (check_warn_node_versionable): Likewise. (process_hsa_functions): Likewise. * ipa-icf.c (set_local): Likewise. * ipa-inline-analysis.c (initialize_inline_failed): Likewise. * ipa-inline.c (speculation_useful_p): Likewise. * ipa-profile.c (ipa_propagate_frequency): Likewise. (ipa_profile): Likewise. * ipa-split.c (split_function): Likewise. (execute_split_functions): Likewise. * ipa-sra.c (ipa_sra_preliminary_function_checks): Likewise. (ipa_sra_ipa_function_checks): Likewise. * ipa-visibility.c (function_and_variable_visibility): Likewise. * ipa.c (symbol_table::remove_unreachable_nodes): Likewise. * lto-cgraph.c (lto_output_node): Likewise. (input_overwrite_node): Likewise. * multiple_target.c (expand_target_clones): Likewise. * omp-simd-clone.c (simd_clone_create): Likewise. * trans-mem.c (expand_call_tm): Likewise. (ipa_tm_mayenterirr_function): Likewise. (ipa_tm_diagnose_tm_safe): Likewise. (ipa_tm_diagnose_transaction): Likewise. (ipa_tm_create_version): Likewise. (ipa_tm_transform_calls_redirect): Likewise. (ipa_tm_execute): Likewise. * tree-inline.c (expand_call_inline): Likewise. From-SVN: r277601 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index b482bd32950..72d6ec76e9e 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,61 @@ +2019-10-30 Martin Liska + + * cgraph.c (cgraph_node::local_info): Transform to ... + (cgraph_node::local_info_node): ... this. + (cgraph_node::dump): Remove cgraph_local_info and + put its fields directly into cgraph_node. + (cgraph_node::get_availability): Likewise. + (cgraph_node::make_local): Likewise. + (cgraph_node::verify_node): Likewise. + * cgraph.h (struct GTY): Likewise. + * cgraphclones.c (set_new_clone_decl_and_node_flags): Likewise. + (duplicate_thunk_for_node): Likewise. + (cgraph_node::create_clone): Likewise. + (cgraph_node::create_virtual_clone): Likewise. + (cgraph_node::create_version_clone): Likewise. + * cgraphunit.c (cgraph_node::reset): Likewise. + (cgraph_node::finalize_function): Likewise. + (cgraph_node::add_new_function): Likewise. + (analyze_functions): Likewise. + * combine.c (setup_incoming_promotions): Likewise. + * config/i386/i386.c (ix86_function_regparm): Likewise. + (ix86_function_sseregparm): Likewise. + (init_cumulative_args): Likewise. + * ipa-cp.c (determine_versionability): Likewise. + (count_callers): Likewise. + (set_single_call_flag): Likewise. + (initialize_node_lattices): Likewise. + (estimate_local_effects): Likewise. + (create_specialized_node): Likewise. + (identify_dead_nodes): Likewise. + * ipa-fnsummary.c (compute_fn_summary): Likewise. + (ipa_fn_summary_generate): Likewise. + * ipa-hsa.c (check_warn_node_versionable): Likewise. + (process_hsa_functions): Likewise. + * ipa-icf.c (set_local): Likewise. + * ipa-inline-analysis.c (initialize_inline_failed): Likewise. + * ipa-inline.c (speculation_useful_p): Likewise. + * ipa-profile.c (ipa_propagate_frequency): Likewise. + (ipa_profile): Likewise. + * ipa-split.c (split_function): Likewise. + (execute_split_functions): Likewise. + * ipa-sra.c (ipa_sra_preliminary_function_checks): Likewise. + (ipa_sra_ipa_function_checks): Likewise. + * ipa-visibility.c (function_and_variable_visibility): Likewise. + * ipa.c (symbol_table::remove_unreachable_nodes): Likewise. + * lto-cgraph.c (lto_output_node): Likewise. + (input_overwrite_node): Likewise. + * multiple_target.c (expand_target_clones): Likewise. + * omp-simd-clone.c (simd_clone_create): Likewise. + * trans-mem.c (expand_call_tm): Likewise. + (ipa_tm_mayenterirr_function): Likewise. + (ipa_tm_diagnose_tm_safe): Likewise. + (ipa_tm_diagnose_transaction): Likewise. + (ipa_tm_create_version): Likewise. + (ipa_tm_transform_calls_redirect): Likewise. + (ipa_tm_execute): Likewise. + * tree-inline.c (expand_call_inline): Likewise. + 2019-10-29 Martin Liska * symbol-summary.h (function_summary): Pass memory location diff --git a/gcc/cgraph.c b/gcc/cgraph.c index 2dc91a3a99b..33fba5a8f1c 100644 --- a/gcc/cgraph.c +++ b/gcc/cgraph.c @@ -1834,16 +1834,16 @@ cgraph_node::mark_address_taken (void) node->address_taken = 1; } -/* Return local info for the compiled function. */ +/* Return local info node for the compiled function. */ -cgraph_local_info * -cgraph_node::local_info (tree decl) +cgraph_node * +cgraph_node::local_info_node (tree decl) { gcc_assert (TREE_CODE (decl) == FUNCTION_DECL); cgraph_node *node = get (decl); if (!node) return NULL; - return &node->ultimate_alias_target ()->local; + return node->ultimate_alias_target (); } /* Return RTL info for the compiled function. */ @@ -1991,9 +1991,9 @@ cgraph_node::dump (FILE *f) fprintf (f, " body"); if (process) fprintf (f, " process"); - if (local.local) + if (local) fprintf (f, " local"); - if (local.redefined_extern_inline) + if (redefined_extern_inline) fprintf (f, " redefined_extern_inline"); if (only_called_at_startup) fprintf (f, " only_called_at_startup"); @@ -2217,7 +2217,7 @@ cgraph_node::get_availability (symtab_node *ref) enum availability avail; if (!analyzed) avail = AVAIL_NOT_AVAILABLE; - else if (local.local) + else if (local) avail = AVAIL_LOCAL; else if (inlined_to) avail = AVAIL_AVAILABLE; @@ -2340,7 +2340,7 @@ cgraph_node::make_local (cgraph_node *node, void *) node->set_comdat_group (NULL); node->externally_visible = false; node->forced_by_abi = false; - node->local.local = true; + node->local = true; node->set_section (NULL); node->unique_name = ((node->resolution == LDPR_PREVAILING_DEF_IRONLY || node->resolution == LDPR_PREVAILING_DEF_IRONLY_EXP) @@ -3090,7 +3090,7 @@ cgraph_node::verify_node (void) error ("inline clone in same comdat group list"); error_found = true; } - if (!definition && !in_other_partition && local.local) + if (!definition && !in_other_partition && local) { error ("local symbols must be defined"); error_found = true; diff --git a/gcc/cgraph.h b/gcc/cgraph.h index 826d391db32..0c5a6960d10 100644 --- a/gcc/cgraph.h +++ b/gcc/cgraph.h @@ -707,29 +707,6 @@ struct GTY(()) cgraph_thunk_info { bool thunk_p; }; -/* Information about the function collected locally. - Available after function is analyzed. */ - -struct GTY(()) cgraph_local_info { - /* Set when function is visible in current compilation unit only and - its address is never taken. */ - unsigned local : 1; - - /* False when there is something makes versioning impossible. */ - unsigned versionable : 1; - - /* False when function calling convention and signature cannot be changed. - This is the case when __builtin_apply_args is used. */ - unsigned can_change_signature : 1; - - /* True when the function has been originally extern inline, but it is - redefined now. */ - unsigned redefined_extern_inline : 1; - - /* True if the function may enter serial irrevocable mode. */ - unsigned tm_may_enter_irr : 1; -}; - /* Represent which DECL tree (or reference to such tree) will be replaced by another tree while versioning. */ struct GTY(()) ipa_replace_map @@ -1370,7 +1347,7 @@ struct GTY((tag ("SYMTAB_FUNCTION"))) cgraph_node : public symtab_node static cgraph_node * get_create (tree); /* Return local info for the compiled function. */ - static cgraph_local_info *local_info (tree decl); + static cgraph_node *local_info_node (tree decl); /* Return RTL info for the compiled function. */ static struct cgraph_rtl_info *rtl_info (const_tree); @@ -1436,8 +1413,6 @@ struct GTY((tag ("SYMTAB_FUNCTION"))) cgraph_node : public symtab_node per-function in order to allow IPA passes to introduce new functions. */ vec GTY((skip)) ipa_transforms_to_apply; - cgraph_local_info local; - /* For inline clones this points to the function they will be inlined into. */ cgraph_node *inlined_to; @@ -1495,6 +1470,19 @@ struct GTY((tag ("SYMTAB_FUNCTION"))) cgraph_node : public symtab_node unsigned split_part : 1; /* True if the function appears as possible target of indirect call. */ unsigned indirect_call_target : 1; + /* Set when function is visible in current compilation unit only and + its address is never taken. */ + unsigned local : 1; + /* False when there is something makes versioning impossible. */ + unsigned versionable : 1; + /* False when function calling convention and signature cannot be changed. + This is the case when __builtin_apply_args is used. */ + unsigned can_change_signature : 1; + /* True when the function has been originally extern inline, but it is + redefined now. */ + unsigned redefined_extern_inline : 1; + /* True if the function may enter serial irrevocable mode. */ + unsigned tm_may_enter_irr : 1; private: /* Unique id of the node. */ diff --git a/gcc/cgraphclones.c b/gcc/cgraphclones.c index fcf9cd5c992..84d6e71a20b 100644 --- a/gcc/cgraphclones.c +++ b/gcc/cgraphclones.c @@ -159,7 +159,7 @@ set_new_clone_decl_and_node_flags (cgraph_node *new_node) DECL_SET_IS_OPERATOR_DELETE (new_node->decl, 0); new_node->externally_visible = 0; - new_node->local.local = 1; + new_node->local = 1; new_node->lowered = true; } @@ -223,7 +223,7 @@ duplicate_thunk_for_node (cgraph_node *thunk, cgraph_node *node) new_thunk = cgraph_node::create (new_decl); set_new_clone_decl_and_node_flags (new_thunk); new_thunk->definition = true; - new_thunk->local.can_change_signature = node->local.can_change_signature; + new_thunk->can_change_signature = node->can_change_signature; new_thunk->thunk = thunk->thunk; new_thunk->unique_name = in_lto_p; new_thunk->former_clone_of = thunk->decl; @@ -353,10 +353,13 @@ cgraph_node::create_clone (tree new_decl, profile_count prof_count, } new_node->analyzed = analyzed; new_node->definition = definition; - new_node->local = local; + new_node->versionable = versionable; + new_node->can_change_signature = can_change_signature; + new_node->redefined_extern_inline = redefined_extern_inline; + new_node->tm_may_enter_irr = tm_may_enter_irr; new_node->externally_visible = false; new_node->no_reorder = no_reorder; - new_node->local.local = true; + new_node->local = true; new_node->inlined_to = new_inlined_to; new_node->rtl = rtl; new_node->frequency = frequency; @@ -524,11 +527,11 @@ cgraph_node::create_virtual_clone (vec redirect_callers, ipa_replace_map *map; char *name; - gcc_checking_assert (local.versionable); + gcc_checking_assert (versionable); /* TODO: It would be nice if we could recognize that param_adjustments do not actually perform any changes, but at the moment let's require it simply does not exist. */ - gcc_assert (local.can_change_signature || !param_adjustments); + gcc_assert (can_change_signature || !param_adjustments); /* Make a new FUNCTION_DECL tree node */ if (!param_adjustments) @@ -860,7 +863,7 @@ cgraph_node::create_version_clone (tree new_decl, new_version->local = local; new_version->externally_visible = false; new_version->no_reorder = no_reorder; - new_version->local.local = new_version->definition; + new_version->local = new_version->definition; new_version->inlined_to = inlined_to; new_version->rtl = rtl; new_version->count = count; @@ -931,7 +934,7 @@ cgraph_node::create_version_clone_with_body return NULL; /* TODO: Restore an assert that we do not change signature if - local.can_change_signature is false. We cannot just check that + can_change_signature is false. We cannot just check that param_adjustments is NULL because unfortunately ipa-split removes return values from such functions. */ @@ -987,7 +990,7 @@ cgraph_node::create_version_clone_with_body new_version_node->make_decl_local (); DECL_VIRTUAL_P (new_version_node->decl) = 0; new_version_node->externally_visible = 0; - new_version_node->local.local = 1; + new_version_node->local = 1; new_version_node->lowered = true; if (!implicit_section) new_version_node->set_section (get_section ()); diff --git a/gcc/cgraphunit.c b/gcc/cgraphunit.c index ef96393a009..5bb4ec8e8ce 100644 --- a/gcc/cgraphunit.c +++ b/gcc/cgraphunit.c @@ -391,7 +391,6 @@ cgraph_node::reset (void) gcc_assert (!process); /* Reset our data structures so we can analyze the function again. */ - memset (&local, 0, sizeof (local)); inlined_to = NULL; memset (&rtl, 0, sizeof (rtl)); analyzed = false; @@ -445,7 +444,7 @@ cgraph_node::finalize_function (tree decl, bool no_collect) gcc_assert (!DECL_CONTEXT (decl) || TREE_CODE (DECL_CONTEXT (decl)) != FUNCTION_DECL); node->reset (); - node->local.redefined_extern_inline = true; + node->redefined_extern_inline = true; } /* Set definition first before calling notice_global_symbol so that @@ -553,7 +552,7 @@ cgraph_node::add_new_function (tree fndecl, bool lowered) /* Bring the function into finalized state and enqueue for later analyzing and compilation. */ node = cgraph_node::get_create (fndecl); - node->local.local = false; + node->local = false; node->definition = true; node->force_output = true; if (TREE_PUBLIC (fndecl)) @@ -1121,7 +1120,7 @@ analyze_functions (bool first_time) && !cnode->dispatcher_function) { cnode->reset (); - cnode->local.redefined_extern_inline = true; + cnode->redefined_extern_inline = true; continue; } diff --git a/gcc/combine.c b/gcc/combine.c index 92e4e5e6898..857ea30dafd 100644 --- a/gcc/combine.c +++ b/gcc/combine.c @@ -1600,7 +1600,8 @@ setup_incoming_promotions (rtx_insn *first) function lie within the current compilation unit. (This does take into account the exporting of a function via taking its address, and so forth.) */ - strictly_local = cgraph_node::local_info (current_function_decl)->local; + strictly_local + = cgraph_node::local_info_node (current_function_decl)->local; /* The mode and signedness of the argument before any promotions happen (equal to the mode of the pseudo holding it at that stage). */ diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 5354cdba9dc..b9122a4ded9 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -1119,8 +1119,7 @@ ix86_function_regparm (const_tree type, const_tree decl) if (target && opt_for_fn (target->decl, optimize) && !(profile_flag && !flag_fentry)) { - cgraph_local_info *i = &target->local; - if (i && i->local && i->can_change_signature) + if (target->local && target->can_change_signature) { int local_regparm, globals = 0, regno; @@ -1216,8 +1215,7 @@ ix86_function_sseregparm (const_tree type, const_tree decl, bool warn) && opt_for_fn (target->decl, optimize) && !(profile_flag && !flag_fentry)) { - cgraph_local_info *i = &target->local; - if (i && i->local && i->can_change_signature) + if (target->local && target->can_change_signature) { /* Refuse to produce wrong code when local function with SSE enabled is called from SSE disabled function. @@ -1698,7 +1696,7 @@ init_cumulative_args (CUMULATIVE_ARGS *cum, /* Argument info to initialize */ tree fndecl, int caller) { - struct cgraph_local_info *i = NULL; + struct cgraph_node *local_info_node = NULL; struct cgraph_node *target = NULL; memset (cum, 0, sizeof (*cum)); @@ -1709,7 +1707,7 @@ init_cumulative_args (CUMULATIVE_ARGS *cum, /* Argument info to initialize */ if (target) { target = target->function_symbol (); - i = cgraph_node::local_info (target->decl); + local_info_node = cgraph_node::local_info_node (target->decl); cum->call_abi = ix86_function_abi (target->decl); } else @@ -1751,7 +1749,8 @@ init_cumulative_args (CUMULATIVE_ARGS *cum, /* Argument info to initialize */ va_start so for local functions maybe_vaarg can be made aggressive helping K&R code. FIXME: once typesytem is fixed, we won't need this code anymore. */ - if (i && i->local && i->can_change_signature) + if (local_info_node && local_info_node->local + && local_info_node->can_change_signature) fntype = TREE_TYPE (target->decl); cum->stdarg = stdarg_p (fntype); cum->maybe_vaarg = (fntype diff --git a/gcc/ipa-cp.c b/gcc/ipa-cp.c index 23028e28a16..8a5f8d362f6 100644 --- a/gcc/ipa-cp.c +++ b/gcc/ipa-cp.c @@ -594,7 +594,7 @@ determine_versionability (struct cgraph_node *node, present. */ if (node->alias || node->thunk.thunk_p) reason = "alias or thunk"; - else if (!node->local.versionable) + else if (!node->versionable) reason = "not a tree_versionable_function"; else if (node->get_availability () <= AVAIL_INTERPOSABLE) reason = "insufficient body availability"; @@ -1150,7 +1150,7 @@ count_callers (cgraph_node *node, void *data) for (cgraph_edge *cs = node->callers; cs; cs = cs->next_caller) /* Local thunks can be handled transparently, but if the thunk cannot be optimized out, count it as a real use. */ - if (!cs->caller->thunk.thunk_p || !cs->caller->local.local) + if (!cs->caller->thunk.thunk_p || !cs->caller->local) ++*caller_count; return false; } @@ -1163,7 +1163,7 @@ set_single_call_flag (cgraph_node *node, void *) { cgraph_edge *cs = node->callers; /* Local thunks can be handled transparently, skip them. */ - while (cs && cs->caller->thunk.thunk_p && cs->caller->local.local) + while (cs && cs->caller->thunk.thunk_p && cs->caller->local) cs = cs->next_caller; if (cs) { @@ -1187,7 +1187,7 @@ initialize_node_lattices (struct cgraph_node *node) if (!ipa_get_param_count (info)) disable = true; - else if (node->local.local) + else if (node->local) { int caller_count = 0; node->call_for_symbol_thunks_and_aliases (count_callers, &caller_count, @@ -2935,7 +2935,7 @@ estimate_local_effects (struct cgraph_node *node) int devirt_bonus = devirtualization_time_bonus (node, known_csts, known_contexts, known_aggs_ptrs); if (always_const || devirt_bonus - || (removable_params_cost && node->local.can_change_signature)) + || (removable_params_cost && node->can_change_signature)) { struct caller_statistics stats; ipa_hints hints; @@ -2957,7 +2957,7 @@ estimate_local_effects (struct cgraph_node *node) fprintf (dump_file, " - context independent values, size: %i, " "time_benefit: %f\n", size, (base_time - time).to_double ()); - if (size <= 0 || node->local.local) + if (size <= 0 || node->local) { info->do_clone_for_all_contexts = true; @@ -3892,7 +3892,7 @@ create_specialized_node (struct cgraph_node *node, ipa_param_adjustments *old_adjustments = node->clone.param_adjustments; ipa_param_adjustments *new_adjustments; gcc_assert (!info->ipcp_orig_node); - gcc_assert (node->local.can_change_signature + gcc_assert (node->can_change_signature || !old_adjustments); if (old_adjustments) @@ -3907,7 +3907,7 @@ create_specialized_node (struct cgraph_node *node, for (i = 0; i < old_adj_count; i++) { ipa_adjusted_param *old_adj = &(*old_adjustments->m_adj_params)[i]; - if (!node->local.can_change_signature + if (!node->can_change_signature || old_adj->op != IPA_PARAM_OP_COPY || (!known_csts[old_adj->base_index] && ipa_is_param_used (info, old_adj->base_index))) @@ -3924,7 +3924,7 @@ create_specialized_node (struct cgraph_node *node, ipa_param_adjustments (new_params, count, skip_return)); } - else if (node->local.can_change_signature + else if (node->can_change_signature && want_remove_some_param_p (node, known_csts)) { ipa_adjusted_param adj; @@ -4990,7 +4990,7 @@ 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.local + if (v->local && !v->call_for_symbol_thunks_and_aliases (has_undead_caller_from_outside_scc_p, NULL, true)) IPA_NODE_REF (v)->node_dead = 1; diff --git a/gcc/ipa-fnsummary.c b/gcc/ipa-fnsummary.c index 798fdbe5dd2..795e9656623 100644 --- a/gcc/ipa-fnsummary.c +++ b/gcc/ipa-fnsummary.c @@ -2712,7 +2712,7 @@ compute_fn_summary (struct cgraph_node *node, bool early) ipa_call_summary *es = ipa_call_summaries->get_create (node->callees); predicate t = true; - node->local.can_change_signature = false; + node->can_change_signature = false; es->call_stmt_size = eni_size_weights.call_cost; es->call_stmt_time = eni_time_weights.call_cost; info->account_size_time (ipa_fn_summary::size_scale @@ -2751,12 +2751,12 @@ compute_fn_summary (struct cgraph_node *node, bool early) with simd attribute. */ || lookup_attribute ("omp declare simd", DECL_ATTRIBUTES (node->decl))) - node->local.can_change_signature = false; + node->can_change_signature = false; else { /* Otherwise, inlinable functions always can change signature. */ if (info->inlinable) - node->local.can_change_signature = true; + node->can_change_signature = true; else { /* Functions calling builtin_apply cannot change signature. */ @@ -2767,7 +2767,7 @@ compute_fn_summary (struct cgraph_node *node, bool early) || fndecl_built_in_p (cdecl, BUILT_IN_VA_START)) break; } - node->local.can_change_signature = !e; + node->can_change_signature = !e; } } analyze_function_body (node, early); @@ -3485,7 +3485,7 @@ ipa_fn_summary_generate (void) FOR_EACH_DEFINED_FUNCTION (node) if (DECL_STRUCT_FUNCTION (node->decl)) - node->local.versionable = tree_versionable_function_p (node->decl); + node->versionable = tree_versionable_function_p (node->decl); ipa_fn_summary_alloc (); diff --git a/gcc/ipa-hsa.c b/gcc/ipa-hsa.c index 8af1d734d85..32280f3acac 100644 --- a/gcc/ipa-hsa.c +++ b/gcc/ipa-hsa.c @@ -51,7 +51,7 @@ namespace { static bool check_warn_node_versionable (cgraph_node *node) { - if (!node->local.versionable) + if (!node->versionable) { warning_at (EXPR_LOCATION (node->decl), OPT_Whsa, "could not emit HSAIL for function %s: function cannot be " @@ -113,7 +113,7 @@ process_hsa_functions (void) TREE_PUBLIC (clone->decl) = TREE_PUBLIC (node->decl); clone->externally_visible = node->externally_visible; - if (!node->local.local) + if (!node->local) clone->force_output = true; hsa_summaries->link_functions (clone, node, HSA_FUNCTION, false); diff --git a/gcc/ipa-icf.c b/gcc/ipa-icf.c index 066288d04ba..0d17fe990fc 100644 --- a/gcc/ipa-icf.c +++ b/gcc/ipa-icf.c @@ -926,7 +926,7 @@ sem_function::equals_private (sem_item *item) static bool set_local (cgraph_node *node, void *data) { - node->local.local = data != NULL; + node->local = data != NULL; return false; } diff --git a/gcc/ipa-inline-analysis.c b/gcc/ipa-inline-analysis.c index 8dee132600a..fb3299d896f 100644 --- a/gcc/ipa-inline-analysis.c +++ b/gcc/ipa-inline-analysis.c @@ -68,7 +68,7 @@ initialize_inline_failed (struct cgraph_edge *e) e->inline_failed = CIF_INDIRECT_UNKNOWN_CALL; else if (!callee->definition) e->inline_failed = CIF_BODY_NOT_AVAILABLE; - else if (callee->local.redefined_extern_inline) + else if (callee->redefined_extern_inline) e->inline_failed = CIF_REDEFINED_EXTERN_INLINE; else e->inline_failed = CIF_FUNCTION_NOT_CONSIDERED; diff --git a/gcc/ipa-inline.c b/gcc/ipa-inline.c index 210387050bc..05bc8e70677 100644 --- a/gcc/ipa-inline.c +++ b/gcc/ipa-inline.c @@ -1757,7 +1757,7 @@ speculation_useful_p (struct cgraph_edge *e, bool anticipate_inlining) to an ipa-cp clone (that are seen by having local flag set), it is probably pointless to inline it unless hardware is missing indirect call predictor. */ - if (!anticipate_inlining && !target->local.local) + if (!anticipate_inlining && !target->local) return false; /* For overwritable targets there is not much to do. */ if (!can_inline_edge_p (e, false) diff --git a/gcc/ipa-profile.c b/gcc/ipa-profile.c index 50a54ebf19b..a1acd2e413a 100644 --- a/gcc/ipa-profile.c +++ b/gcc/ipa-profile.c @@ -393,7 +393,7 @@ ipa_propagate_frequency (struct cgraph_node *node) /* We cannot propagate anything useful about externally visible functions nor about virtuals. */ - if (!node->local.local + if (!node->local || node->alias || (opt_for_fn (node->decl, flag_devirtualize) && DECL_VIRTUAL_P (node->decl))) @@ -682,12 +682,12 @@ ipa_profile (void) order_pos = ipa_reverse_postorder (order); for (i = order_pos - 1; i >= 0; i--) { - if (order[i]->local.local + if (order[i]->local && opt_for_fn (order[i]->decl, flag_ipa_profile) && ipa_propagate_frequency (order[i])) { for (e = order[i]->callees; e; e = e->next_callee) - if (e->callee->local.local && !e->callee->aux) + if (e->callee->local && !e->callee->aux) { something_changed = true; e->callee->aux = (void *)1; @@ -706,7 +706,7 @@ ipa_profile (void) && ipa_propagate_frequency (order[i])) { for (e = order[i]->callees; e; e = e->next_callee) - if (e->callee->local.local && !e->callee->aux) + if (e->callee->local && !e->callee->aux) { something_changed = true; e->callee->aux = (void *)1; diff --git a/gcc/ipa-split.c b/gcc/ipa-split.c index 375a15c44b3..0444bda704d 100644 --- a/gcc/ipa-split.c +++ b/gcc/ipa-split.c @@ -1204,7 +1204,7 @@ split_function (basic_block return_bb, class split_point *split_point, dump_split_point (dump_file, split_point); } - if (cur_node->local.can_change_signature) + if (cur_node->can_change_signature) args_to_skip = BITMAP_ALLOC (NULL); else args_to_skip = NULL; @@ -1757,7 +1757,7 @@ execute_split_functions (void) then inlining would still benefit. */ if ((!node->callers /* Local functions called once will be completely inlined most of time. */ - || (!node->callers->next_caller && node->local.local)) + || (!node->callers->next_caller && node->local)) && !node->address_taken && !node->has_aliases_p () && (!flag_lto || !node->externally_visible)) diff --git a/gcc/ipa-sra.c b/gcc/ipa-sra.c index 038f38b912a..ad11d6f8555 100644 --- a/gcc/ipa-sra.c +++ b/gcc/ipa-sra.c @@ -552,7 +552,7 @@ struct obstack gensum_obstack; static bool ipa_sra_preliminary_function_checks (cgraph_node *node) { - if (!node->local.can_change_signature) + if (!node->can_change_signature) { if (dump_file) fprintf (dump_file, "Function cannot change signature.\n"); @@ -2882,7 +2882,7 @@ ipa_sra_ipa_function_checks (cgraph_node *node) "made local.\n", node->dump_name ()); return false; } - if (!node->local.can_change_signature) + if (!node->can_change_signature) { if (dump_file) fprintf (dump_file, "Function can not change signature.\n"); diff --git a/gcc/ipa-visibility.c b/gcc/ipa-visibility.c index 274d3081ada..f470465f935 100644 --- a/gcc/ipa-visibility.c +++ b/gcc/ipa-visibility.c @@ -747,8 +747,8 @@ function_and_variable_visibility (bool whole_program) } FOR_EACH_DEFINED_FUNCTION (node) { - if (!node->local.local) - node->local.local |= node->local_p (); + if (!node->local) + node->local |= node->local_p (); /* If we know that function cannot be overwritten by a different semantics and moreover its section cannot be @@ -868,7 +868,7 @@ function_and_variable_visibility (bool whole_program) { fprintf (dump_file, "\nMarking local functions:"); FOR_EACH_DEFINED_FUNCTION (node) - if (node->local.local) + if (node->local) fprintf (dump_file, " %s", node->name ()); fprintf (dump_file, "\n\n"); fprintf (dump_file, "\nMarking externally visible functions:"); diff --git a/gcc/ipa.c b/gcc/ipa.c index 5d47e3d2146..934e49785f3 100644 --- a/gcc/ipa.c +++ b/gcc/ipa.c @@ -544,7 +544,7 @@ symbol_table::remove_unreachable_nodes (FILE *file) = remove_attribute ("always_inline", DECL_ATTRIBUTES (node->decl)); if (!node->in_other_partition) - node->local.local = false; + node->local = false; node->remove_callees (); node->remove_all_references (); changed = true; @@ -655,7 +655,7 @@ symbol_table::remove_unreachable_nodes (FILE *file) || !node->call_for_symbol_and_aliases (is_indirect_call_target_p, NULL, true))) { - node->local.local = true; + node->local = true; if (file) fprintf (file, " (local)"); } diff --git a/gcc/lto-cgraph.c b/gcc/lto-cgraph.c index b03835a9b8c..5b11150bc2f 100644 --- a/gcc/lto-cgraph.c +++ b/gcc/lto-cgraph.c @@ -507,13 +507,13 @@ lto_output_node (struct lto_simple_output_block *ob, struct cgraph_node *node, streamer_write_hwi_stream (ob->main_stream, node->tp_first_run); bp = bitpack_create (ob->main_stream); - bp_pack_value (&bp, node->local.local, 1); + bp_pack_value (&bp, node->local, 1); bp_pack_value (&bp, node->externally_visible, 1); bp_pack_value (&bp, node->no_reorder, 1); bp_pack_value (&bp, node->definition, 1); - bp_pack_value (&bp, node->local.versionable, 1); - bp_pack_value (&bp, node->local.can_change_signature, 1); - bp_pack_value (&bp, node->local.redefined_extern_inline, 1); + bp_pack_value (&bp, node->versionable, 1); + bp_pack_value (&bp, node->can_change_signature, 1); + bp_pack_value (&bp, node->redefined_extern_inline, 1); bp_pack_value (&bp, node->force_output, 1); bp_pack_value (&bp, node->forced_by_abi, 1); bp_pack_value (&bp, node->unique_name, 1); @@ -1139,13 +1139,13 @@ input_overwrite_node (struct lto_file_decl_data *file_data, node->aux = (void *) tag; node->lto_file_data = file_data; - node->local.local = bp_unpack_value (bp, 1); + node->local = bp_unpack_value (bp, 1); node->externally_visible = bp_unpack_value (bp, 1); node->no_reorder = bp_unpack_value (bp, 1); node->definition = bp_unpack_value (bp, 1); - node->local.versionable = bp_unpack_value (bp, 1); - node->local.can_change_signature = bp_unpack_value (bp, 1); - node->local.redefined_extern_inline = bp_unpack_value (bp, 1); + node->versionable = bp_unpack_value (bp, 1); + node->can_change_signature = bp_unpack_value (bp, 1); + node->redefined_extern_inline = bp_unpack_value (bp, 1); node->force_output = bp_unpack_value (bp, 1); node->forced_by_abi = bp_unpack_value (bp, 1); node->unique_name = bp_unpack_value (bp, 1); diff --git a/gcc/multiple_target.c b/gcc/multiple_target.c index 968c8cfb1ab..19dcfc94b27 100644 --- a/gcc/multiple_target.c +++ b/gcc/multiple_target.c @@ -429,7 +429,7 @@ expand_target_clones (struct cgraph_node *node, bool definition) attributes); if (new_node == NULL) return false; - new_node->local.local = false; + new_node->local = false; XDELETEVEC (suffix); decl2_v = new_node->function_version (); @@ -457,7 +457,7 @@ expand_target_clones (struct cgraph_node *node, bool definition) tree attributes = make_attribute ("target", "default", DECL_ATTRIBUTES (node->decl)); DECL_ATTRIBUTES (node->decl) = attributes; - node->local.local = false; + node->local = false; return true; } diff --git a/gcc/omp-simd-clone.c b/gcc/omp-simd-clone.c index f4bfcc8b8b8..76aea56bdcf 100644 --- a/gcc/omp-simd-clone.c +++ b/gcc/omp-simd-clone.c @@ -475,7 +475,7 @@ simd_clone_create (struct cgraph_node *old_node) /* The method cgraph_version_clone_with_body () will force the new symbol local. Undo this, and inherit external visibility from the old node. */ - new_node->local.local = old_node->local.local; + new_node->local = old_node->local; new_node->externally_visible = old_node->externally_visible; return new_node; diff --git a/gcc/trans-mem.c b/gcc/trans-mem.c index 4a3f130e876..2e775286540 100644 --- a/gcc/trans-mem.c +++ b/gcc/trans-mem.c @@ -2541,12 +2541,12 @@ expand_call_tm (struct tm_region *region, gimple_call_set_fndecl (stmt, repl); update_stmt (stmt); node = cgraph_node::create (repl); - node->local.tm_may_enter_irr = false; + node->tm_may_enter_irr = false; return expand_call_tm (region, gsi); } gcc_unreachable (); } - if (node->local.tm_may_enter_irr) + if (node->tm_may_enter_irr) transaction_subcode_ior (region, GTMA_MAY_ENTER_IRREVOCABLE); if (is_tm_abort (fn_decl)) @@ -4722,7 +4722,7 @@ ipa_tm_mayenterirr_function (struct cgraph_node *node) /* We may have previously marked this function as tm_may_enter_irr; see pass_diagnose_tm_blocks. */ - if (node->local.tm_may_enter_irr) + if (node->tm_may_enter_irr) return true; /* Recurse on the main body for aliases. In general, this will @@ -4746,7 +4746,7 @@ ipa_tm_diagnose_tm_safe (struct cgraph_node *node) for (e = node->callees; e ; e = e->next_callee) if (!is_tm_callable (e->callee->decl) - && e->callee->local.tm_may_enter_irr) + && e->callee->tm_may_enter_irr) error_at (gimple_location (e->call_stmt), "unsafe function call %qD within " "% function", e->callee->decl); @@ -4814,7 +4814,7 @@ ipa_tm_diagnose_transaction (struct cgraph_node *node, if (is_tm_callable (fndecl)) continue; - if (cgraph_node::local_info (fndecl)->tm_may_enter_irr) + if (cgraph_node::local_info_node (fndecl)->tm_may_enter_irr) error_at (gimple_location (stmt), "unsafe function call %qD within " "atomic transaction", fndecl); @@ -4989,7 +4989,7 @@ ipa_tm_create_version (struct cgraph_node *old_node) gcc_assert (!old_node->ipa_transforms_to_apply.exists ()); new_node = old_node->create_version_clone (new_decl, vNULL, NULL); - new_node->local.local = false; + new_node->local = false; new_node->externally_visible = old_node->externally_visible; new_node->lowered = true; new_node->tm_clone = 1; @@ -5209,7 +5209,7 @@ ipa_tm_transform_calls_redirect (struct cgraph_node *node, CALLER. Also note that find_tm_replacement_function also contains mappings into the TM runtime, e.g. memcpy. These we know won't go irrevocable. */ - new_node->local.tm_may_enter_irr = 1; + new_node->tm_may_enter_irr = 1; } else { @@ -5417,7 +5417,7 @@ ipa_tm_execute (void) No need to do this if the function's address can't be taken. */ if (is_tm_pure (node->decl)) { - if (!node->local.local) + if (!node->local) record_tm_clone_pair (node->decl, node->decl); continue; } @@ -5544,14 +5544,14 @@ ipa_tm_execute (void) node = irr_worklist[i]; d = get_cg_data (&node, true); d->in_worklist = false; - node->local.tm_may_enter_irr = true; + node->tm_may_enter_irr = true; /* Propagate back to normal callers. */ for (e = node->callers; e ; e = e->next_caller) { caller = e->caller; if (!is_tm_safe_or_pure (caller->decl) - && !caller->local.tm_may_enter_irr) + && !caller->tm_may_enter_irr) { d = get_cg_data (&caller, true); maybe_push_queue (caller, &irr_worklist, &d->in_worklist); @@ -5562,7 +5562,7 @@ ipa_tm_execute (void) FOR_EACH_ALIAS (node, ref) { caller = dyn_cast (ref->referring); - if (!caller->local.tm_may_enter_irr) + if (!caller->tm_may_enter_irr) { /* ?? Do not traverse aliases here. */ d = get_cg_data (&caller, false); diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c index d6920f48693..2b8b9ee58c1 100644 --- a/gcc/tree-inline.c +++ b/gcc/tree-inline.c @@ -4688,7 +4688,7 @@ expand_call_inline (basic_block bb, gimple *stmt, copy_body_data *id) be to be able to keep both bodies and use extern inline body for inlining, but we can't do that because frontends overwrite the body. */ - && !cg_edge->callee->local.redefined_extern_inline + && !cg_edge->callee->redefined_extern_inline /* During early inline pass, report only when optimization is not turned on. */ && (symtab->global_info_ready