+2015-10-20 Martin Liska <mliska@suse.cz>
+
+ * cgraphclones.c (cgraph_node::create_virtual_clone):
+ Verify cgraph_node.local.versionable instead of calling
+ tree_versionable_function_p.
+ * ipa-cp.c (determine_versionability): Save the information
+ to ipa_node_params summary.
+ (ipcp_versionable_function_p): Use it.
+ (ipcp_propagate_stage): Pass IPA_NODE_REF to a called function.
+ (ipcp_generate_summary): Do not compute cgraph_node
+ versionability.
+ * ipa-inline-analysis.c (inline_generate_summary): Compute
+ versionability for all cgraph nodes.
+ * ipa-prop.c (ipa_node_params_t::duplicate): Duplicate
+ ipa_node_params::versionability.
+ * ipa-prop.h (struct ipa_node_params): Declare it.
+
2015-10-20 Ramana Radhakrishnan <ramana.radhakrishnan@arm.com>
PR other/67868
ipa_replace_map *map;
char *name;
- if (!in_lto_p)
- gcc_checking_assert (tree_versionable_function_p (old_decl));
-
+ gcc_checking_assert (local.versionable);
gcc_assert (local.can_change_signature || !args_to_skip);
/* Make a new FUNCTION_DECL tree node */
with NODE. */
static void
-determine_versionability (struct cgraph_node *node)
+determine_versionability (struct cgraph_node *node,
+ struct ipa_node_params *info)
{
const char *reason = NULL;
fprintf (dump_file, "Function %s/%i is not versionable, reason: %s.\n",
node->name (), node->order, reason);
- node->local.versionable = (reason == NULL);
+ info->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 node->local.versionable;
+ return IPA_NODE_REF (node)->versionable;
}
/* Structure holding accumulated information about callers of a node. */
{
struct ipa_node_params *info = IPA_NODE_REF (node);
- determine_versionability (node);
+ determine_versionability (node, info);
if (node->has_gimple_body_p ())
{
info->lattices = XCNEWVEC (struct ipcp_param_lattices,
ipa_register_cgraph_hooks ();
FOR_EACH_FUNCTION_WITH_GIMPLE_BODY (node)
- {
- node->local.versionable
- = tree_versionable_function_p (node->decl);
- ipa_analyze_node (node);
- }
+ ipa_analyze_node (node);
}
/* Write ipcp summary for nodes in SET. */
{
struct cgraph_node *node;
+ FOR_EACH_DEFINED_FUNCTION (node)
+ if (DECL_STRUCT_FUNCTION (node->decl))
+ node->local.versionable = tree_versionable_function_p (node->decl);
+
/* When not optimizing, do not bother to analyze. Inlining is still done
because edge redirection needs to happen there. */
if (!optimize && !flag_generate_lto && !flag_generate_offload && !flag_wpa)
new_info->analysis_done = old_info->analysis_done;
new_info->node_enqueued = old_info->node_enqueued;
+ new_info->versionable = old_info->versionable;
old_av = ipa_get_agg_replacements_for_node (src);
if (old_av)
unsigned node_within_scc : 1;
/* Node is calling a private function called only once. */
unsigned node_calling_single_call : 1;
+ /* False when there is something makes versioning impossible. */
+ unsigned versionable : 1;
};
/* Intermediate information that we get from alias analysis about a particular