diff options
author | Martin Liska <mliska@suse.cz> | 2018-06-08 14:22:58 +0200 |
---|---|---|
committer | Martin Liska <marxin@gcc.gnu.org> | 2018-06-08 12:22:58 +0000 |
commit | 9d3e0adc2a0e657b2aa384f1392dd2fac77a62d4 (patch) | |
tree | 1a46184e2d16f7de6dd7036ef288451962d349bb /gcc/ipa-prop.h | |
parent | 36330f8203fc19bf11d1e6a21fd0637be1a792d0 (diff) | |
download | gcc-9d3e0adc2a0e657b2aa384f1392dd2fac77a62d4.zip gcc-9d3e0adc2a0e657b2aa384f1392dd2fac77a62d4.tar.gz gcc-9d3e0adc2a0e657b2aa384f1392dd2fac77a62d4.tar.bz2 |
Convert IPA CP to symbol_summary.
2018-06-08 Martin Liska <mliska@suse.cz>
* ipa-cp.c (ipcp_store_bits_results): Use
ipcp_transformation_sum.
(ipcp_store_vr_results): Likewise.
* ipa-prop.c (ipcp_grow_transformations_if_necessary): Renamed
to ...
(ipcp_transformation_initialize): ... this.
(ipa_set_node_agg_value_chain):
(ipa_node_params_t::duplicate): Use ipcp_transformation_sum.
(write_ipcp_transformation_info): Likewise.
(read_ipcp_transformation_info): Likewise.
(ipcp_update_bits): Likewise.
(ipcp_update_vr): Likewise.
(ipcp_transform_function): Likewise.
* ipa-prop.h: Rename ipcp_transformation_summary to
ipcp_transformation.
(class ipcp_transformation_t): New function summary.
(ipcp_get_transformation_summary): Use ipcp_transformation_sum.
(ipa_get_agg_replacements_for_node): Likewise.
From-SVN: r261314
Diffstat (limited to 'gcc/ipa-prop.h')
-rw-r--r-- | gcc/ipa-prop.h | 36 |
1 files changed, 28 insertions, 8 deletions
diff --git a/gcc/ipa-prop.h b/gcc/ipa-prop.h index 6fd3159..55e10cf 100644 --- a/gcc/ipa-prop.h +++ b/gcc/ipa-prop.h @@ -544,7 +544,7 @@ struct GTY(()) ipa_agg_replacement_value /* Structure holding information for the transformation phase of IPA-CP. */ -struct GTY(()) ipcp_transformation_summary +struct GTY(()) ipcp_transformation { /* Linked list of known aggregate values. */ ipa_agg_replacement_value *agg_values; @@ -556,7 +556,7 @@ struct GTY(()) ipcp_transformation_summary void ipa_set_node_agg_value_chain (struct cgraph_node *node, struct ipa_agg_replacement_value *aggvals); -void ipcp_grow_transformations_if_necessary (void); +void ipcp_transformation_initialize (void); /* ipa_edge_args stores information related to a callsite and particularly its arguments. It can be accessed by the IPA_EDGE_REF macro. */ @@ -649,8 +649,27 @@ extern GTY(()) ipa_node_params_t * ipa_node_params_sum; /* Call summary to store information about edges such as jump functions. */ extern GTY(()) ipa_edge_args_sum_t *ipa_edge_args_sum; -/* Vector of IPA-CP transformation data for each clone. */ -extern GTY(()) vec<ipcp_transformation_summary, va_gc> *ipcp_transformations; +/* Function summary for IPA-CP transformation. */ +class ipcp_transformation_t +: public function_summary<ipcp_transformation *> +{ +public: + ipcp_transformation_t (symbol_table *table, bool ggc): + function_summary<ipcp_transformation *> (table, ggc) {} + + ~ipcp_transformation_t () {} + + static ipcp_transformation_t *create_ggc (symbol_table *symtab) + { + ipcp_transformation_t *summary + = new (ggc_cleared_alloc <ipcp_transformation_t> ()) + ipcp_transformation_t (symtab, true); + return summary; + } +}; + +/* 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. */ @@ -694,12 +713,13 @@ ipa_edge_args_info_available_for_edge_p (struct cgraph_edge *edge) return ipa_edge_args_sum->exists (edge); } -static inline ipcp_transformation_summary * +static inline ipcp_transformation * ipcp_get_transformation_summary (cgraph_node *node) { - if ((unsigned) node->uid >= vec_safe_length (ipcp_transformations)) + if (ipcp_transformation_sum == NULL) return NULL; - return &(*ipcp_transformations)[node->uid]; + + return ipcp_transformation_sum->get (node); } /* Return the aggregate replacements for NODE, if there are any. */ @@ -707,7 +727,7 @@ ipcp_get_transformation_summary (cgraph_node *node) static inline struct ipa_agg_replacement_value * ipa_get_agg_replacements_for_node (cgraph_node *node) { - ipcp_transformation_summary *ts = ipcp_get_transformation_summary (node); + ipcp_transformation *ts = ipcp_get_transformation_summary (node); return ts ? ts->agg_values : NULL; } |