ipa-prop uses symbol_summary class.
authorMartin Liska <mliska@suse.cz>
Mon, 22 Dec 2014 09:19:09 +0000 (10:19 +0100)
committerMartin Liska <marxin@gcc.gnu.org>
Mon, 22 Dec 2014 09:19:09 +0000 (09:19 +0000)
* 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.

From-SVN: r219005

27 files changed:
gcc/ChangeLog
gcc/auto-profile.c
gcc/cgraph.c
gcc/cgraphbuild.c
gcc/cgraphclones.c
gcc/cgraphunit.c
gcc/ipa-cp.c
gcc/ipa-devirt.c
gcc/ipa-icf.c
gcc/ipa-inline-analysis.c
gcc/ipa-inline-transform.c
gcc/ipa-inline.c
gcc/ipa-polymorphic-call.c
gcc/ipa-profile.c
gcc/ipa-prop.c
gcc/ipa-prop.h
gcc/ipa-split.c
gcc/ipa-utils.c
gcc/ipa.c
gcc/lto/ChangeLog
gcc/lto/lto-partition.c
gcc/lto/lto-symtab.c
gcc/lto/lto.c
gcc/omp-low.c
gcc/tree-inline.c
gcc/tree-sra.c
gcc/tree-ssa-pre.c

index d5e2b7b8899c235f26c0781821d072adfa314abc..abe1785955f6ebf6828dc339f99b71e35d61f8e2 100644 (file)
@@ -1,3 +1,46 @@
+2014-12-22  Martin Liska  <mliska@suse.cz>
+
+       * 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.
+
 2014-12-22  Martin Liska  <mliska@suse.cz>
 
        * cgraph.h (symbol_table::allocate_cgraph_symbol): Summary UID
index 085bbd6ec549d1ca0627b9050e224bf3b127b3e4..a7fa559fee5f879372b7db6cb5ae10cc00245910 100644 (file)
@@ -67,6 +67,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "coverage.h"
 #include "params.h"
 #include "alloc-pool.h"
+#include "symbol-summary.h"
 #include "ipa-prop.h"
 #include "ipa-inline.h"
 #include "tree-inline.h"
index 50c7b34b3dc9efd85a1a989de4fe814d1bebcc67..c415a0302f3bdf9de498c191b8772640e94e57ea 100644 (file)
@@ -72,6 +72,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "ipa-utils.h"
 #include "lto-streamer.h"
 #include "alloc-pool.h"
+#include "symbol-summary.h"
 #include "ipa-prop.h"
 #include "ipa-inline.h"
 #include "cfgloop.h"
index 53acb43dc5632840ae0a02edb20fe829526dfc2a..2a5bc9b2eb349bde7d294f1b875436a25f6ae0de 100644 (file)
@@ -52,6 +52,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "ipa-utils.h"
 #include "except.h"
 #include "alloc-pool.h"
+#include "symbol-summary.h"
 #include "ipa-prop.h"
 #include "ipa-inline.h"
 
index 43d81a9f0ab539306704099839a81301dec26541..77d0b1181582f3326006dbfdb59b4e59c906ee1a 100644 (file)
@@ -103,6 +103,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "ipa-ref.h"
 #include "cgraph.h"
 #include "alloc-pool.h"
+#include "symbol-summary.h"
 #include "ipa-prop.h"
 #include "tree-iterator.h"
 #include "tree-dump.h"
index b0f78ef908ebd6fc476a6308f174a3cd1e582658..41b284c466b3b8dbfc6d867f07981398db69c9a1 100644 (file)
@@ -203,6 +203,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "ipa-ref.h"
 #include "cgraph.h"
 #include "alloc-pool.h"
+#include "symbol-summary.h"
 #include "ipa-prop.h"
 #include "tree-iterator.h"
 #include "tree-pass.h"
index 79a1799d90137295e015a629ca0709c2e068fbaa..ba86f0e85837b1166c8b3c3701fb9b7aa57b73fb 100644 (file)
@@ -123,6 +123,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "ipa-ref.h"
 #include "cgraph.h"
 #include "alloc-pool.h"
+#include "symbol-summary.h"
 #include "ipa-prop.h"
 #include "bitmap.h"
 #include "tree-pass.h"
index 9f8dcb57ceb053ae686ad697ab79a210d8b2eccb..497db77e458a4ad93f12ccaaf022a5b4d72321eb 100644 (file)
@@ -139,6 +139,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "gimple-expr.h"
 #include "gimple.h"
 #include "alloc-pool.h"
+#include "symbol-summary.h"
 #include "ipa-prop.h"
 #include "ipa-inline.h"
 #include "diagnostic.h"
index 244edaa1bc4b784221ab3f88b62be60c92daa6bc..6cdc21b1ae6a075a837cb90598ee5d640e087d62 100644 (file)
@@ -87,6 +87,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "ipa-ref.h"
 #include "cgraph.h"
 #include "alloc-pool.h"
+#include "symbol-summary.h"
 #include "ipa-prop.h"
 #include "ipa-inline.h"
 #include "cfgloop.h"
index 3b622f2f0e40d32daaca8bf29ab28e084c6d1b37..888d6e35f85b151184990a114ef7bb6387594649 100644 (file)
@@ -110,6 +110,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "ipa-ref.h"
 #include "cgraph.h"
 #include "alloc-pool.h"
+#include "symbol-summary.h"
 #include "ipa-prop.h"
 #include "lto-streamer.h"
 #include "data-streamer.h"
@@ -920,7 +921,7 @@ evaluate_properties_for_edge (struct cgraph_edge *e, bool inline_p,
   if (known_contexts_ptr)
     known_contexts_ptr->create (0);
 
-  if (ipa_node_params_vector.exists ()
+  if (ipa_node_params_sum
       && !e->call_stmt_cannot_inline_p
       && ((clause_ptr && info->conds) || known_vals_ptr || known_contexts_ptr))
     {
@@ -1142,7 +1143,7 @@ inline_node_duplication_hook (struct cgraph_node *src,
 
   /* When there are any replacements in the function body, see if we can figure
      out that something was optimized out.  */
-  if (ipa_node_params_vector.exists () && dst->clone.tree_map)
+  if (ipa_node_params_sum && dst->clone.tree_map)
     {
       vec<size_time_entry, va_gc> *entry = info->entry;
       /* Use SRC parm info since it may not be copied yet.  */
@@ -2487,7 +2488,7 @@ estimate_function_body_sizes (struct cgraph_node *node, bool early)
       calculate_dominance_info (CDI_DOMINATORS);
       loop_optimizer_init (LOOPS_NORMAL | LOOPS_HAVE_RECORDED_EXITS);
 
-      if (ipa_node_params_vector.exists ())
+      if (ipa_node_params_sum)
        {
          parms_info = IPA_NODE_REF (node);
          nonconstant_names.safe_grow_cleared
@@ -2637,7 +2638,7 @@ estimate_function_body_sizes (struct cgraph_node *node, bool early)
                  nonconstant_names[SSA_NAME_VERSION (gimple_call_lhs (stmt))]
                    = false_p;
                }
-             if (ipa_node_params_vector.exists ())
+             if (ipa_node_params_sum)
                {
                  int count = gimple_call_num_args (stmt);
                  int i;
@@ -3384,7 +3385,7 @@ static void
 remap_edge_change_prob (struct cgraph_edge *inlined_edge,
                        struct cgraph_edge *edge)
 {
-  if (ipa_node_params_vector.exists ())
+  if (ipa_node_params_sum)
     {
       int i;
       struct ipa_edge_args *args = IPA_EDGE_REF (edge);
@@ -3540,7 +3541,7 @@ inline_merge_summary (struct cgraph_edge *edge)
   else
     toplev_predicate = true_predicate ();
 
-  if (ipa_node_params_vector.exists () && callee_info->conds)
+  if (ipa_node_params_sum && callee_info->conds)
     {
       struct ipa_edge_args *args = IPA_EDGE_REF (edge);
       int count = ipa_get_cs_argument_count (args);
index 063cd94cda67ac6e1a63e7332a8b0aa363249e28..62f68f0997211412523dba3dd6c07d796a1dbd24 100644 (file)
@@ -51,6 +51,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "ipa-ref.h"
 #include "cgraph.h"
 #include "alloc-pool.h"
+#include "symbol-summary.h"
 #include "ipa-prop.h"
 #include "ipa-inline.h"
 #include "tree-inline.h"
index 451695f0a80a21621e358b6cc0b4691e688eeac0..dc017c6ff460a9c1c65a0c10f729156a5a232c8a 100644 (file)
@@ -128,6 +128,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "ipa-ref.h"
 #include "cgraph.h"
 #include "alloc-pool.h"
+#include "symbol-summary.h"
 #include "ipa-prop.h"
 #include "except.h"
 #include "target.h"
@@ -2394,7 +2395,7 @@ early_inliner (function *fun)
      it.  This may confuse ourself when early inliner decide to inline call to
      function clone, because function clones don't have parameter list in
      ipa-prop matching their signature.  */
-  if (ipa_node_params_vector.exists ())
+  if (ipa_node_params_sum)
     return 0;
 
 #ifdef ENABLE_CHECKING
index bfd4bd4f0a537f45209b1df883c904c1a655556f..75820a99934e575634323b0e6166e394b0404977 100644 (file)
@@ -52,6 +52,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "gimple-expr.h"
 #include "gimple.h"
 #include "alloc-pool.h"
+#include "symbol-summary.h"
 #include "ipa-prop.h"
 #include "ipa-inline.h"
 #include "diagnostic.h"
index f540bd6558b6b58dcb2d5b50def14de4e5e87de4..eaa6b4960a8dea62132e978532193de572759c5e 100644 (file)
@@ -82,6 +82,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "tree-inline.h"
 #include "lto-streamer.h"
 #include "data-streamer.h"
+#include "symbol-summary.h"
 #include "ipa-prop.h"
 #include "ipa-inline.h"
 
index 50adefbcde51d708cf58f34d08d0712df6236e38..febcd0cef87dc3cc6325d67521bcc753290f4c9f 100644 (file)
@@ -54,6 +54,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "ipa-ref.h"
 #include "cgraph.h"
 #include "alloc-pool.h"
+#include "symbol-summary.h"
 #include "ipa-prop.h"
 #include "bitmap.h"
 #include "gimple-ssa.h"
@@ -131,8 +132,8 @@ struct func_body_info
   unsigned int aa_walked;
 };
 
-/* Vector where the parameter infos are actually stored. */
-vec<ipa_node_params> ipa_node_params_vector;
+/* Function summary where the parameter infos are actually stored. */
+ipa_node_params_t *ipa_node_params_sum = NULL;
 /* Vector of IPA-CP transformation data for each clone.  */
 vec<ipcp_transformation_summary, va_gc> *ipcp_transformations;
 /* Vector where the parameter infos are actually stored. */
@@ -140,9 +141,7 @@ vec<ipa_edge_args, va_gc> *ipa_edge_args_vector;
 
 /* Holders of ipa cgraph hooks: */
 static struct cgraph_edge_hook_list *edge_removal_hook_holder;
-static struct cgraph_node_hook_list *node_removal_hook_holder;
 static struct cgraph_2edge_hook_list *edge_duplication_hook_holder;
-static struct cgraph_2node_hook_list *node_duplication_hook_holder;
 static struct cgraph_node_hook_list *function_insertion_hook_holder;
 
 /* Description of a reference to an IPA constant.  */
@@ -3300,7 +3299,7 @@ ipa_propagate_indirect_call_infos (struct cgraph_edge *cs,
   bool changed;
   /* Do nothing if the preparation phase has not been carried out yet
      (i.e. during early inlining).  */
-  if (!ipa_node_params_vector.exists ())
+  if (!ipa_node_params_sum)
     return false;
   gcc_assert (ipa_edge_args_vector);
 
@@ -3340,16 +3339,21 @@ ipa_free_all_edge_args (void)
 /* Frees all dynamically allocated structures that the param info points
    to.  */
 
-void
-ipa_free_node_params_substructures (struct ipa_node_params *info)
+ipa_node_params::~ipa_node_params ()
 {
-  info->descriptors.release ();
-  free (info->lattices);
+  descriptors.release ();
+  free (lattices);
   /* Lattice values and their sources are deallocated with their alocation
      pool.  */
-  info->known_csts.release ();
-  info->known_contexts.release ();
-  memset (info, 0, sizeof (*info));
+  known_contexts.release ();
+
+  lattices = NULL;
+  ipcp_orig_node = NULL;
+  analysis_done = 0;
+  node_enqueued = 0;
+  do_clone_for_all_contexts = 0;
+  is_all_contexts_clone = 0;
+  node_dead = 0;
 }
 
 /* Free all ipa_node_params structures.  */
@@ -3357,13 +3361,8 @@ ipa_free_node_params_substructures (struct ipa_node_params *info)
 void
 ipa_free_all_node_params (void)
 {
-  int i;
-  struct ipa_node_params *info;
-
-  FOR_EACH_VEC_ELT (ipa_node_params_vector, i, info)
-    ipa_free_node_params_substructures (info);
-
-  ipa_node_params_vector.release ();
+  delete ipa_node_params_sum;
+  ipa_node_params_sum = NULL;
 }
 
 /* Grow ipcp_transformations if necessary.  */
@@ -3416,26 +3415,11 @@ ipa_edge_removal_hook (struct cgraph_edge *cs, void *data ATTRIBUTE_UNUSED)
   ipa_free_edge_args_substructures (IPA_EDGE_REF (cs));
 }
 
-/* Hook that is called by cgraph.c when a node is removed.  */
-
-static void
-ipa_node_removal_hook (struct cgraph_node *node, void *data ATTRIBUTE_UNUSED)
-{
-  /* During IPA-CP updating we can be called on not-yet analyze clones.  */
-  if (ipa_node_params_vector.length () > (unsigned)node->uid)
-    ipa_free_node_params_substructures (IPA_NODE_REF (node));
-  if (vec_safe_length (ipcp_transformations) > (unsigned)node->uid)
-    {
-      (*ipcp_transformations)[(unsigned)node->uid].agg_values = NULL;
-      (*ipcp_transformations)[(unsigned)node->uid].alignments = NULL;
-    }
-}
-
 /* Hook that is called by cgraph.c when an edge is duplicated.  */
 
 static void
 ipa_edge_duplication_hook (struct cgraph_edge *src, struct cgraph_edge *dst,
-                          __attribute__((unused)) void *data)
+                          void *)
 {
   struct ipa_edge_args *old_args, *new_args;
   unsigned int i;
@@ -3535,18 +3519,23 @@ ipa_edge_duplication_hook (struct cgraph_edge *src, struct cgraph_edge *dst,
     }
 }
 
-/* Hook that is called by cgraph.c when a node is duplicated.  */
+/* Analyze newly added function into callgraph.  */
 
 static void
-ipa_node_duplication_hook (struct cgraph_node *src, struct cgraph_node *dst,
-                          ATTRIBUTE_UNUSED void *data)
+ipa_add_new_function (cgraph_node *node, void *data ATTRIBUTE_UNUSED)
 {
-  struct ipa_node_params *old_info, *new_info;
-  struct ipa_agg_replacement_value *old_av, *new_av;
+  if (node->has_gimple_body_p ())
+    ipa_analyze_node (node);
+}
 
-  ipa_check_create_node_params ();
-  old_info = IPA_NODE_REF (src);
-  new_info = IPA_NODE_REF (dst);
+/* Hook that is called by summary when a node is duplicated.  */
+
+void
+ipa_node_params_t::duplicate(cgraph_node *src, cgraph_node *dst,
+                            ipa_node_params *old_info,
+                            ipa_node_params *new_info)
+{
+  ipa_agg_replacement_value *old_av, *new_av;
 
   new_info->descriptors = old_info->descriptors.copy ();
   new_info->lattices = NULL;
@@ -3587,35 +3576,20 @@ ipa_node_duplication_hook (struct cgraph_node *src, struct cgraph_node *dst,
     }
 }
 
-
-/* Analyze newly added function into callgraph.  */
-
-static void
-ipa_add_new_function (struct cgraph_node *node, void *data ATTRIBUTE_UNUSED)
-{
-  if (node->has_gimple_body_p ())
-    ipa_analyze_node (node);
-}
-
 /* Register our cgraph hooks if they are not already there.  */
 
 void
 ipa_register_cgraph_hooks (void)
 {
+  ipa_check_create_node_params ();
+
   if (!edge_removal_hook_holder)
     edge_removal_hook_holder =
       symtab->add_edge_removal_hook (&ipa_edge_removal_hook, NULL);
-  if (!node_removal_hook_holder)
-    node_removal_hook_holder =
-      symtab->add_cgraph_removal_hook (&ipa_node_removal_hook, NULL);
   if (!edge_duplication_hook_holder)
     edge_duplication_hook_holder =
       symtab->add_edge_duplication_hook (&ipa_edge_duplication_hook, NULL);
-  if (!node_duplication_hook_holder)
-    node_duplication_hook_holder =
-      symtab->add_cgraph_duplication_hook (&ipa_node_duplication_hook, NULL);
-  if (!function_insertion_hook_holder)
-    function_insertion_hook_holder =
+  function_insertion_hook_holder =
       symtab->add_cgraph_insertion_hook (&ipa_add_new_function, NULL);
 }
 
@@ -3626,12 +3600,8 @@ ipa_unregister_cgraph_hooks (void)
 {
   symtab->remove_edge_removal_hook (edge_removal_hook_holder);
   edge_removal_hook_holder = NULL;
-  symtab->remove_cgraph_removal_hook (node_removal_hook_holder);
-  node_removal_hook_holder = NULL;
   symtab->remove_edge_duplication_hook (edge_duplication_hook_holder);
   edge_duplication_hook_holder = NULL;
-  symtab->remove_cgraph_duplication_hook (node_duplication_hook_holder);
-  node_duplication_hook_holder = NULL;
   symtab->remove_cgraph_insertion_hook (function_insertion_hook_holder);
   function_insertion_hook_holder = NULL;
 }
@@ -4801,8 +4771,7 @@ ipa_prop_write_jump_functions (void)
   lto_symtab_encoder_iterator lsei;
   lto_symtab_encoder_t encoder;
 
-
-  if (!ipa_node_params_vector.exists ())
+  if (!ipa_node_params_sum)
     return;
 
   ob = create_output_block (LTO_section_jump_functions);
index 76b503382a66021a86228c885b39f24d76ff2e24..16ab1d08e890099fd9c87db9ebad49c0cef5c842 100644 (file)
@@ -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
index 276de3c5dfb164a86c68c14cf3946aa6f2d3de6a..2670643f06baf51a4a354aff37a561be957ea793 100644 (file)
@@ -109,6 +109,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "ipa-ref.h"
 #include "cgraph.h"
 #include "alloc-pool.h"
+#include "symbol-summary.h"
 #include "ipa-prop.h"
 #include "gimple-ssa.h"
 #include "tree-cfg.h"
index c158837ba364e629d7691069aadaa93a0a446281..2e07f2022b2f2e3b18d03438be89c1badeebc3df 100644 (file)
@@ -55,6 +55,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "langhooks.h"
 #include "lto-streamer.h"
 #include "alloc-pool.h"
+#include "symbol-summary.h"
 #include "ipa-prop.h"
 #include "ipa-inline.h"
 
index d7ec4978533e4da7359e79236eef90ebc4594309..aca9498b7ade0c7f869de08b2a339edd2945f058 100644 (file)
--- a/gcc/ipa.c
+++ b/gcc/ipa.c
@@ -46,6 +46,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "tree-iterator.h"
 #include "ipa-utils.h"
 #include "alloc-pool.h"
+#include "symbol-summary.h"
 #include "ipa-prop.h"
 #include "ipa-inline.h"
 #include "tree-inline.h"
index 7f1088fa1454da4f677f669217f3b18e7b765e82..8e158bedef9d90fc014a6c53f816c34fb54f6834 100644 (file)
@@ -1,3 +1,9 @@
+2014-12-22  Martin Liska  <mliska@suse.cz>
+
+       * lto-partition.c: Include of symbol-summary.h is added.
+       * lto-symtab.c: Likewise.
+       * lto.c: Likewise.
+
 2014-12-11  Jan Hubicka  <hubicka@ucw.cz>
 
        PR ipa/61324
index 809a4937b663d205f05c8c31cb87c0ca8659028b..13beafbdb2a020d5e035bc05da01c7daafd4a7f8 100644 (file)
@@ -45,6 +45,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "timevar.h"
 #include "params.h"
 #include "alloc-pool.h"
+#include "symbol-summary.h"
 #include "ipa-prop.h"
 #include "ipa-inline.h"
 #include "ipa-utils.h"
index f5d82a74b082fdecea3b0b092d8a9733a0917b76..0366067a75f9332d6912111b1bf295d43cc6c602 100644 (file)
@@ -45,6 +45,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "lto-streamer.h"
 #include "ipa-utils.h"
 #include "alloc-pool.h"
+#include "symbol-summary.h"
 #include "ipa-prop.h"
 #include "ipa-inline.h"
 #include "builtins.h"
index 324538a0cb8b355352a38b1723a9c5d575b63bce..7f5233fb559e26350fc01d9c627970b29d038ab3 100644 (file)
@@ -47,6 +47,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "bitmap.h"
 #include "inchash.h"
 #include "alloc-pool.h"
+#include "symbol-summary.h"
 #include "ipa-prop.h"
 #include "common.h"
 #include "debug.h"
index a2e4737915b8fc09a751bee0e4d12cb2dc916f15..a5cc857b02bfcd7600b9db9e18151f6498b5b281 100644 (file)
@@ -83,6 +83,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "tree-cfgcleanup.h"
 #include "pretty-print.h"
 #include "alloc-pool.h"
+#include "symbol-summary.h"
 #include "ipa-prop.h"
 #include "tree-nested.h"
 #include "tree-eh.h"
index 59f2dab8d0866f505b1633f7a41a10942d5a61e0..b68770013d64e086a44362c39ea7fc5afd1375a5 100644 (file)
@@ -74,6 +74,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "ipa-ref.h"
 #include "cgraph.h"
 #include "alloc-pool.h"
+#include "symbol-summary.h"
 #include "ipa-prop.h"
 #include "value-prof.h"
 #include "tree-pass.h"
index f213c8076e6e77a40c7d55c3fb328b6b47bc1c4f..4c0aa15bab96f8071d7de6a9f0c8c388e0eca573 100644 (file)
@@ -115,6 +115,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "plugin-api.h"
 #include "ipa-ref.h"
 #include "cgraph.h"
+#include "symbol-summary.h"
 #include "ipa-prop.h"
 #include "statistics.h"
 #include "params.h"
index 933cf36bc572a99013377732f9c1d6c94f18ae95..062dc681388d2d5aee2e532b732f8c375f8ab06c 100644 (file)
@@ -77,6 +77,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "plugin-api.h"
 #include "ipa-ref.h"
 #include "cgraph.h"
+#include "symbol-summary.h"
 #include "ipa-prop.h"
 #include "tree-ssa-propagate.h"
 #include "ipa-utils.h"