aboutsummaryrefslogtreecommitdiff
path: root/gcc/symbol-summary.h
diff options
context:
space:
mode:
authorMartin Liska <mliska@suse.cz>2018-06-08 14:11:48 +0200
committerMartin Liska <marxin@gcc.gnu.org>2018-06-08 12:11:48 +0000
commit99353fcfe4f50d131fae9978ce9cd19bcaf243cf (patch)
treefbbefc6f259347afb53703958f7a24081975a0cd /gcc/symbol-summary.h
parent2a281178f70c38d796c8ec77e049f8139e1110fc (diff)
downloadgcc-99353fcfe4f50d131fae9978ce9cd19bcaf243cf.zip
gcc-99353fcfe4f50d131fae9978ce9cd19bcaf243cf.tar.gz
gcc-99353fcfe4f50d131fae9978ce9cd19bcaf243cf.tar.bz2
Rename get methods in symbol-summary.h to get_create.
2018-06-08 Martin Liska <mliska@suse.cz> * config/i386/i386.c (ix86_can_inline_p): Use get_create instead of get. * hsa-common.c (hsa_summary_t::link_functions): Likewise. (hsa_register_kernel): Likewise. * hsa-common.h (hsa_gpu_implementation_p): Likewise. * hsa-gen.c (hsa_get_host_function): Likewise. (get_brig_function_name): Likewise. (generate_hsa): Likewise. (pass_gen_hsail::execute): Likewise. * ipa-cp.c (ipcp_cloning_candidate_p): Likewise. (devirtualization_time_bonus): Likewise. (ipcp_propagate_stage): Likewise. * ipa-fnsummary.c (redirect_to_unreachable): Likewise. (edge_set_predicate): Likewise. (evaluate_conditions_for_known_args): Likewise. (evaluate_properties_for_edge): Likewise. (ipa_fn_summary::reset): Likewise. (ipa_fn_summary_t::duplicate): Likewise. (dump_ipa_call_summary): Likewise. (ipa_dump_fn_summary): Likewise. (analyze_function_body): Likewise. (compute_fn_summary): Likewise. (estimate_edge_devirt_benefit): Likewise. (estimate_edge_size_and_time): Likewise. (estimate_calls_size_and_time): Likewise. (estimate_node_size_and_time): Likewise. (inline_update_callee_summaries): Likewise. (remap_edge_change_prob): Likewise. (remap_edge_summaries): Likewise. (ipa_merge_fn_summary_after_inlining): Likewise. (ipa_update_overall_fn_summary): Likewise. (read_ipa_call_summary): Likewise. (inline_read_section): Likewise. (write_ipa_call_summary): Likewise. (ipa_fn_summary_write): Likewise. (ipa_free_fn_summary): Likewise. * ipa-hsa.c (process_hsa_functions): Likewise. (ipa_hsa_write_summary): Likewise. (ipa_hsa_read_section): Likewise. * ipa-icf.c (sem_function::merge): Likewise. * ipa-inline-analysis.c (simple_edge_hints): Likewise. (do_estimate_edge_time): Likewise. (estimate_size_after_inlining): Likewise. (estimate_growth): Likewise. (growth_likely_positive): Likewise. * ipa-inline-transform.c (clone_inlined_nodes): Likewise. (inline_call): Likewise. * ipa-inline.c (caller_growth_limits): Likewise. (can_inline_edge_p): Likewise. (can_inline_edge_by_limits_p): Likewise. (compute_uninlined_call_time): Likewise. (compute_inlined_call_time): Likewise. (want_inline_small_function_p): Likewise. (edge_badness): Likewise. (update_caller_keys): Likewise. (update_callee_keys): Likewise. (recursive_inlining): Likewise. (inline_small_functions): Likewise. (inline_to_all_callers_1): Likewise. (dump_overall_stats): Likewise. (early_inline_small_functions): Likewise. (early_inliner): Likewise. * ipa-inline.h (estimate_edge_growth): Likewise. * ipa-profile.c (ipa_propagate_frequency_1): Likewise. * ipa-prop.c (ipa_make_edge_direct_to_target): Likewise. * ipa-prop.h (IPA_NODE_REF): Likewise. (IPA_EDGE_REF): Likewise. * ipa-pure-const.c (malloc_candidate_p): Likewise. (propagate_malloc): Likewise. * ipa-split.c (execute_split_functions): Likewise. * symbol-summary.h: Rename get to get_create. (get): Likewise. (get_create): Likewise. * tree-sra.c (ipa_sra_preliminary_function_checks): Likewise. 2018-06-08 Martin Liska <mliska@suse.cz> * lto-partition.c (add_symbol_to_partition_1): Use get_create instead of get. (undo_partition): Likewise. (lto_balanced_map): Likewise. From-SVN: r261309
Diffstat (limited to 'gcc/symbol-summary.h')
-rw-r--r--gcc/symbol-summary.h22
1 files changed, 12 insertions, 10 deletions
diff --git a/gcc/symbol-summary.h b/gcc/symbol-summary.h
index a73472e..7ba7697 100644
--- a/gcc/symbol-summary.h
+++ b/gcc/symbol-summary.h
@@ -86,11 +86,12 @@ public:
/* Release an item that is stored within map. */
void release (T *item);
- /* Getter for summary callgraph node pointer. */
- T* get (cgraph_node *node)
+ /* Getter for summary callgraph node pointer. If a summary for a node
+ does not exist it will be created. */
+ T* get_create (cgraph_node *node)
{
gcc_checking_assert (node->summary_uid);
- return get (node->summary_uid);
+ return get_create (node->summary_uid);
}
/* Return number of elements handled by data structure. */
@@ -135,7 +136,7 @@ private:
typedef int_hash <int, 0, -1> map_hash;
/* Getter for summary callgraph ID. */
- T* get (int uid);
+ T* get_create (int uid);
/* Indicates if insertion hook is enabled. */
bool m_insertion_enabled;
@@ -214,7 +215,7 @@ function_summary<T *>::symtab_insertion (cgraph_node *node, void *data)
function_summary *summary = (function_summary <T *> *) (data);
if (summary->m_insertion_enabled)
- summary->insert (node, summary->get (node));
+ summary->insert (node, summary->get_create (node));
}
template <typename T>
@@ -260,7 +261,7 @@ function_summary<T *>::symtab_duplication (cgraph_node *node,
template <typename T>
T*
-function_summary<T *>::get (int uid)
+function_summary<T *>::get_create (int uid)
{
bool existed;
T **v = &m_map.get_or_insert (uid, &existed);
@@ -357,10 +358,11 @@ public:
/* Release an item that is stored within map. */
void release (T *item);
- /* Getter for summary callgraph edge pointer. */
- T* get (cgraph_edge *edge)
+ /* Getter for summary callgraph edge pointer.
+ If a summary for an edge does not exist, it will be created. */
+ T* get_create (cgraph_edge *edge)
{
- return get (hashable_uid (edge));
+ return get_create (hashable_uid (edge));
}
/* Return number of elements handled by data structure. */
@@ -390,7 +392,7 @@ private:
typedef int_hash <int, 0, -1> map_hash;
/* Getter for summary callgraph ID. */
- T* get (int uid)
+ T* get_create (int uid)
{
bool existed;
T **v = &m_map.get_or_insert (uid, &existed);