+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
/* 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;
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";
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
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. */
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);
}
}
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);
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;
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);
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);
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++)
/* 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
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);
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);