aboutsummaryrefslogtreecommitdiff
path: root/gcc/ipa-prop.h
diff options
context:
space:
mode:
authormarxin <marxin@138bc75d-0d04-0410-961f-82ee72b054a4>2014-12-22 09:19:09 +0000
committermarxin <marxin@138bc75d-0d04-0410-961f-82ee72b054a4>2014-12-22 09:19:09 +0000
commit2cc80ac37074949b269d06bd7b3b8e61932eb0be (patch)
tree844d04e2bcaef55647fafa93f6a03d340b1f3412 /gcc/ipa-prop.h
parenta5d83f7dfcdca9b77d234661d447ad5874597f81 (diff)
ipa-prop uses symbol_summary class.
* lto-partition.c: Include of symbol-summary.h is added. * lto-symtab.c: Likewise. * lto.c: Likewise. * auto-profile.c: Include of symbol-summary.h is added. * cgraph.c: Likewise. * cgraphbuild.c: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * ipa-cp.c: Likewise. * ipa-devirt.c: Likewise. * ipa-icf.c: Likewise. * ipa-inline-analysis.c (evaluate_properties_for_edge): New ipa_node_params_sum data structure is used. (inline_node_duplication_hook): Likewise. (estimate_function_body_sizes): Likewise. (remap_edge_change_prob): Likewise. (inline_merge_summary): Likewise. * ipa-inline-transform.c: Include of symbol-summary.h is added. * ipa-inline.c (early_inliner): New ipa_node_params_sum data structure is used. * ipa-polymorphic-call.c: Include of symbol-summary.h is added. * ipa-profile.c: Include of symbol-summary.h is added. * ipa-prop.c (ipa_propagate_indirect_call_infos): New ipa_node_params_sum data structure is used. (ipa_node_params::~ipa_node_params): New function. (ipa_free_all_node_params): Destruction is simplified. (ipa_node_removal_hook): Removed. (ipa_add_new_function): Renamed from ipa_node_duplication_hook. (ipa_node_params_t::duplicate): New function. (ipa_register_cgraph_hooks): Few hooks are removed. (ipa_unregister_cgraph_hooks): Likewise. (ipa_prop_write_jump_functions): New ipa_node_params_sum is used. * ipa-prop.h (struct ipa_node_params): Destructor introduced for the structure. (ipa_check_create_node_params): Vector for ipa_node_params is replaced with function_summary. * ipa-split.c: Include of symbol-summary.h is added. * ipa-utils.c: Include of symbol-summary.h is added. * ipa.c: Include of symbol-summary.h is added. * omp-low.c: Include of symbol-summary.h is added. * tree-inline.c: Include of symbol-summary.h is added. * tree-sra.c: Include of symbol-summary.h is added. * tree-ssa-pre.c: Include of symbol-summary.h is added. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@219005 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ipa-prop.h')
-rw-r--r--gcc/ipa-prop.h32
1 files changed, 21 insertions, 11 deletions
diff --git a/gcc/ipa-prop.h b/gcc/ipa-prop.h
index 76b503382a6..16ab1d08e89 100644
--- a/gcc/ipa-prop.h
+++ b/gcc/ipa-prop.h
@@ -20,7 +20,6 @@ along with GCC; see the file COPYING3. If not see
#ifndef IPA_PROP_H
#define IPA_PROP_H
-
/* The following definitions and interfaces are used by
interprocedural analyses or parameters. */
@@ -301,6 +300,8 @@ struct ipa_param_descriptor
struct ipa_node_params
{
+ ~ipa_node_params ();
+
/* Information about individual formal parameters that are gathered when
summaries are generated. */
vec<ipa_param_descriptor> descriptors;
@@ -470,10 +471,22 @@ ipa_get_ith_polymorhic_call_context (struct ipa_edge_args *args, int i)
return &(*args->polymorphic_call_contexts)[i];
}
-/* Types of vectors holding the infos. */
+/* Callgraph summary for ipa_node_params. */
+class ipa_node_params_t: public function_summary <ipa_node_params *>
+{
+public:
+ ipa_node_params_t (symbol_table *table):
+ function_summary<ipa_node_params *> (table) { }
-/* Vector where the parameter infos are actually stored. */
-extern vec<ipa_node_params> ipa_node_params_vector;
+ /* Hook that is called by summary when a node is duplicated. */
+ virtual void duplicate (cgraph_node *node,
+ cgraph_node *node2,
+ ipa_node_params *data,
+ ipa_node_params *data2);
+};
+
+/* Function summary where the parameter infos are actually stored. */
+extern ipa_node_params_t *ipa_node_params_sum;
/* Vector of IPA-CP transformation data for each clone. */
extern GTY(()) vec<ipcp_transformation_summary, va_gc> *ipcp_transformations;
/* Vector where the parameter infos are actually stored. */
@@ -481,7 +494,7 @@ extern GTY(()) vec<ipa_edge_args, va_gc> *ipa_edge_args_vector;
/* Return the associated parameter/argument info corresponding to the given
node/edge. */
-#define IPA_NODE_REF(NODE) (&ipa_node_params_vector[(NODE)->uid])
+#define IPA_NODE_REF(NODE) (ipa_node_params_sum->get (NODE))
#define IPA_EDGE_REF(EDGE) (&(*ipa_edge_args_vector)[(EDGE)->uid])
/* This macro checks validity of index returned by
ipa_get_param_decl_index function. */
@@ -491,11 +504,11 @@ extern GTY(()) vec<ipa_edge_args, va_gc> *ipa_edge_args_vector;
void ipa_create_all_node_params (void);
void ipa_create_all_edge_args (void);
void ipa_free_edge_args_substructures (struct ipa_edge_args *);
-void ipa_free_node_params_substructures (struct ipa_node_params *);
void ipa_free_all_node_params (void);
void ipa_free_all_edge_args (void);
void ipa_free_all_structures_after_ipa_cp (void);
void ipa_free_all_structures_after_iinln (void);
+
void ipa_register_cgraph_hooks (void);
int count_formal_params (tree fndecl);
@@ -505,11 +518,8 @@ int count_formal_params (tree fndecl);
static inline void
ipa_check_create_node_params (void)
{
- if (!ipa_node_params_vector.exists ())
- ipa_node_params_vector.create (symtab->cgraph_max_uid);
-
- if (ipa_node_params_vector.length () <= (unsigned) symtab->cgraph_max_uid)
- ipa_node_params_vector.safe_grow_cleared (symtab->cgraph_max_uid + 1);
+ if (!ipa_node_params_sum)
+ ipa_node_params_sum = new ipa_node_params_t (symtab);
}
/* This function ensures the array of edge arguments infos is big enough to