OSDN Git Service

2011-09-06 Martin Jambor <mjambor@suse.cz>
authorjamborm <jamborm@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 6 Sep 2011 14:46:55 +0000 (14:46 +0000)
committerjamborm <jamborm@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 6 Sep 2011 14:46:55 +0000 (14:46 +0000)
* ipa-inline.h (struct inline_summary): Move versionable flag...
* cgraph.h (struct cgraph_local_info): ...here
* ipa-cp.c (determine_versionability): Use the new versionable flag.
(determine_versionability): Likewise.
(ipcp_versionable_function_p): Likewise.
(ipcp_generate_summary): Likewise.
* ipa-inline-analysis.c (dump_inline_summary): Do not dump the
versionable flag.
(compute_inline_parameters): Do not clear the versionable flag.
(inline_read_section): Do not stream the versionable flag.
(inline_write_summary): Likewise.
* lto-cgraph.c (lto_output_node): Stream the versionable flag.
(input_overwrite_node): Likewise.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@178598 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/cgraph.h
gcc/ipa-cp.c
gcc/ipa-inline-analysis.c
gcc/ipa-inline.h
gcc/lto-cgraph.c

index 3109216..65d8113 100644 (file)
@@ -1,3 +1,19 @@
+2011-09-06  Martin Jambor  <mjambor@suse.cz>
+
+       * ipa-inline.h (struct inline_summary): Move versionable flag...
+       * cgraph.h (struct cgraph_local_info): ...here
+       * ipa-cp.c (determine_versionability): Use the new versionable flag.
+       (determine_versionability): Likewise.
+       (ipcp_versionable_function_p): Likewise.
+       (ipcp_generate_summary): Likewise.
+       * ipa-inline-analysis.c (dump_inline_summary): Do not dump the
+       versionable flag.
+       (compute_inline_parameters): Do not clear the versionable flag.
+       (inline_read_section): Do not stream the versionable flag.
+       (inline_write_summary): Likewise.
+       * lto-cgraph.c (lto_output_node): Stream the versionable flag.
+       (input_overwrite_node): Likewise.
+
 2011-09-06  Richard Guenther  <rguenther@suse.de>
 
        PR tree-optimization/48149
index 4116d71..294fb77 100644 (file)
@@ -84,10 +84,13 @@ struct GTY(()) cgraph_local_info {
 
   /* Set when function is visible by other units.  */
   unsigned externally_visible : 1;
-  
+
   /* Set once it has been finalized so we consider it to be output.  */
   unsigned finalized : 1;
 
+  /* False when there is something makes versioning impossible.  */
+  unsigned versionable : 1;
+
   /* False when function calling convention and signature can not be changed.
      This is the case when __builtin_apply_args is used.  */
   unsigned can_change_signature : 1;
index e751899..f6e083e 100644 (file)
@@ -367,7 +367,7 @@ determine_versionability (struct cgraph_node *node)
      present.  */
   if (node->alias || node->thunk.thunk_p)
     reason = "alias or thunk";
-  else if (!inline_summary (node)->versionable)
+  else if (!node->local.versionable)
     reason = "not a tree_versionable_function";
   else if (cgraph_function_body_availability (node) <= AVAIL_OVERWRITABLE)
     reason = "insufficient body availability";
@@ -376,7 +376,7 @@ determine_versionability (struct cgraph_node *node)
     fprintf (dump_file, "Function %s/%i is not versionable, reason: %s.\n",
             cgraph_node_name (node), node->uid, reason);
 
-  inline_summary (node)->versionable = (reason == NULL);
+  node->local.versionable = (reason == NULL);
 }
 
 /* Return true if it is at all technically possible to create clones of a
@@ -385,7 +385,7 @@ determine_versionability (struct cgraph_node *node)
 static bool
 ipcp_versionable_function_p (struct cgraph_node *node)
 {
-  return inline_summary (node)->versionable;
+  return node->local.versionable;
 }
 
 /* Structure holding accumulated information about callers of a node.  */
@@ -2449,14 +2449,11 @@ ipcp_generate_summary (void)
     fprintf (dump_file, "\nIPA constant propagation start:\n");
   ipa_register_cgraph_hooks ();
 
-  /* FIXME: We could propagate through thunks happily and we could be
-     even able to clone them, if needed.  Do that later.  */
   FOR_EACH_FUNCTION_WITH_GIMPLE_BODY (node)
       {
        /* Unreachable nodes should have been eliminated before ipcp.  */
        gcc_assert (node->needed || node->reachable);
-
-       inline_summary (node)->versionable = tree_versionable_function_p (node->decl);
+       node->local.versionable = tree_versionable_function_p (node->decl);
        ipa_analyze_node (node);
       }
 }
index 6373753..f925416 100644 (file)
@@ -986,8 +986,6 @@ dump_inline_summary (FILE * f, struct cgraph_node *node)
        fprintf (f, " always_inline");
       if (s->inlinable)
        fprintf (f, " inlinable");
-      if (s->versionable)
-       fprintf (f, " versionable");
       fprintf (f, "\n  self time:       %i\n",
               s->self_time);
       fprintf (f, "  global time:     %i\n", s->time);
@@ -1644,7 +1642,7 @@ compute_inline_parameters (struct cgraph_node *node, bool early)
       struct inline_edge_summary *es = inline_edge_summary (node->callees);
       struct predicate t = true_predicate ();
 
-      info->inlinable = info->versionable = 0;
+      info->inlinable = 0;
       node->callees->call_stmt_cannot_inline_p = true;
       node->local.can_change_signature = false;
       es->call_stmt_time = 1;
@@ -2410,7 +2408,6 @@ inline_read_section (struct lto_file_decl_data *file_data, const char *data,
 
       bp = streamer_read_bitpack (&ib);
       info->inlinable = bp_unpack_value (&bp, 1);
-      info->versionable = bp_unpack_value (&bp, 1);
 
       count2 = streamer_read_uhwi (&ib);
       gcc_assert (!info->conds);
@@ -2541,7 +2538,6 @@ inline_write_summary (cgraph_node_set set,
          int i;
          size_time_entry *e;
          struct condition *c;
-         
 
          streamer_write_uhwi (ob, lto_cgraph_encoder_encode (encoder, node));
          streamer_write_hwi (ob, info->estimated_self_stack_size);
@@ -2549,7 +2545,6 @@ inline_write_summary (cgraph_node_set set,
          streamer_write_hwi (ob, info->self_time);
          bp = bitpack_create (ob->main_stream);
          bp_pack_value (&bp, info->inlinable, 1);
-         bp_pack_value (&bp, info->versionable, 1);
          streamer_write_bitpack (&bp);
          streamer_write_uhwi (ob, VEC_length (condition, info->conds));
          for (i = 0; VEC_iterate (condition, info->conds, i, c); i++)
index 8162cf2..bba13b6 100644 (file)
@@ -85,9 +85,6 @@ struct GTY(()) inline_summary
 
   /* False when there something makes inlining impossible (such as va_arg).  */
   unsigned inlinable : 1;
-  /* False when there something makes versioning impossible.
-     Currently computed and used only by ipa-cp.  */
-  unsigned versionable : 1;
 
   /* Information about function that will result after applying all the
      inline decisions present in the callgraph.  Generally kept up to
index 72d084b..edc3ad7 100644 (file)
@@ -495,6 +495,7 @@ lto_output_node (struct lto_simple_output_block *ob, struct cgraph_node *node,
   bp_pack_value (&bp, node->local.local, 1);
   bp_pack_value (&bp, node->local.externally_visible, 1);
   bp_pack_value (&bp, node->local.finalized, 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->needed, 1);
@@ -896,6 +897,7 @@ input_overwrite_node (struct lto_file_decl_data *file_data,
   node->local.local = bp_unpack_value (bp, 1);
   node->local.externally_visible = bp_unpack_value (bp, 1);
   node->local.finalized = 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->needed = bp_unpack_value (bp, 1);