aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorjamborm <jamborm@138bc75d-0d04-0410-961f-82ee72b054a4>2011-09-06 14:46:55 +0000
committerjamborm <jamborm@138bc75d-0d04-0410-961f-82ee72b054a4>2011-09-06 14:46:55 +0000
commitc8d92fc149064d33a7f7d30c11bdba33792d70d2 (patch)
tree60c8adebdd85ef74f46a1d6e5721b6e999184d27 /gcc
parent77d62cb7843c57618c1a8ba320d6fb96479c798d (diff)
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@178598 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog16
-rw-r--r--gcc/cgraph.h5
-rw-r--r--gcc/ipa-cp.c11
-rw-r--r--gcc/ipa-inline-analysis.c7
-rw-r--r--gcc/ipa-inline.h3
-rw-r--r--gcc/lto-cgraph.c2
6 files changed, 27 insertions, 17 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 3109216d5e3..65d81138d4b 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -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
diff --git a/gcc/cgraph.h b/gcc/cgraph.h
index 4116d71d0f6..294fb772a5b 100644
--- a/gcc/cgraph.h
+++ b/gcc/cgraph.h
@@ -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;
diff --git a/gcc/ipa-cp.c b/gcc/ipa-cp.c
index e751899f131..f6e083e6654 100644
--- a/gcc/ipa-cp.c
+++ b/gcc/ipa-cp.c
@@ -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);
}
}
diff --git a/gcc/ipa-inline-analysis.c b/gcc/ipa-inline-analysis.c
index 63737535008..f9254165183 100644
--- a/gcc/ipa-inline-analysis.c
+++ b/gcc/ipa-inline-analysis.c
@@ -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++)
diff --git a/gcc/ipa-inline.h b/gcc/ipa-inline.h
index 8162cf2d777..bba13b6af46 100644
--- a/gcc/ipa-inline.h
+++ b/gcc/ipa-inline.h
@@ -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
diff --git a/gcc/lto-cgraph.c b/gcc/lto-cgraph.c
index 72d084b50e0..edc3ad7759e 100644
--- a/gcc/lto-cgraph.c
+++ b/gcc/lto-cgraph.c
@@ -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);