aboutsummaryrefslogtreecommitdiff
path: root/gcc/ipa-cp.c
diff options
context:
space:
mode:
authorMartin Liska <mliska@suse.cz>2015-10-20 13:59:51 +0200
committerMartin Liska <marxin@gcc.gnu.org>2015-10-20 11:59:51 +0000
commit7e729474b27556fc64cf413e32b460bce101b435 (patch)
treed5b42adfb7238acffc09b8dfa4f33bfe9f65cbab /gcc/ipa-cp.c
parent5f0a92e5c46e74b5d5232aab9997f6f3a27d8619 (diff)
downloadgcc-7e729474b27556fc64cf413e32b460bce101b435.zip
gcc-7e729474b27556fc64cf413e32b460bce101b435.tar.gz
gcc-7e729474b27556fc64cf413e32b460bce101b435.tar.bz2
Correctly fill up cgraph_node::local.versionable flag.
* 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. From-SVN: r229055
Diffstat (limited to 'gcc/ipa-cp.c')
-rw-r--r--gcc/ipa-cp.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/gcc/ipa-cp.c b/gcc/ipa-cp.c
index d9d81f1..ef93b20 100644
--- a/gcc/ipa-cp.c
+++ b/gcc/ipa-cp.c
@@ -514,7 +514,8 @@ print_all_lattices (FILE * f, bool dump_sources, bool dump_benefits)
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;
@@ -546,7 +547,7 @@ determine_versionability (struct cgraph_node *node)
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
@@ -555,7 +556,7 @@ determine_versionability (struct cgraph_node *node)
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. */
@@ -2896,7 +2897,7 @@ ipcp_propagate_stage (struct ipa_topo_info *topo)
{
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,
@@ -4609,11 +4610,7 @@ ipcp_generate_summary (void)
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. */