Commit ccbbf8a2 by Jan Hubicka Committed by Jan Hubicka

cgraph.c (dump_cgraph_node): Dump versionable flag.

	* cgraph.c (dump_cgraph_node): Dump versionable flag.
	* cgraph.h (cgraph_local_info): Add versionable flag.
	* ipa-cp.c (ipcp_analyze_node): Set versionable flag.
	(ipcp_versionable_function_p): Use it.
	* lto-cgraph.c (lto_output_node, input_overwrite_node): Stream
	versionable flag.

From-SVN: r159467
parent 91fbf0c7
2010-05-16 Jan Hubicka <jh@suse.cz> 2010-05-16 Jan Hubicka <jh@suse.cz>
* cgraph.c (dump_cgraph_node): Dump versionable flag.
* cgraph.h (cgraph_local_info): Add versionable flag.
* ipa-cp.c (ipcp_analyze_node): Set versionable flag.
(ipcp_versionable_function_p): Use it.
* lto-cgraph.c (lto_output_node, input_overwrite_node): Stream
versionable flag.
2010-05-16 Jan Hubicka <jh@suse.cz>
* cgraph.c (cgraph_clone_node): Take decl argument and insert * cgraph.c (cgraph_clone_node): Take decl argument and insert
clone into hash when it is different from orig. clone into hash when it is different from orig.
(cgraph_create_virtual_clone): Update use of cgraph_clone_node. (cgraph_create_virtual_clone): Update use of cgraph_clone_node.
...@@ -7,7 +16,8 @@ ...@@ -7,7 +16,8 @@
* lto-cgrpah.c (lto_cgraph_encoder_new): Create body map. * lto-cgrpah.c (lto_cgraph_encoder_new): Create body map.
(lto_cgraph_encoder_delete): Delete body map. (lto_cgraph_encoder_delete): Delete body map.
(lto_cgraph_encoder_size): Move to header. (lto_cgraph_encoder_size): Move to header.
(lto_cgraph_encoder_encode_body_p, lto_set_cgraph_encoder_encode_body): New. (lto_cgraph_encoder_encode_body_p,
lto_set_cgraph_encoder_encode_body): New.
(lto_output_node): Do not take written_decls argument; output clone_of (lto_output_node): Do not take written_decls argument; output clone_of
pointer. pointer.
(add_node_to): Add include_body_argument; call (add_node_to): Add include_body_argument; call
......
...@@ -1830,6 +1830,8 @@ dump_cgraph_node (FILE *f, struct cgraph_node *node) ...@@ -1830,6 +1830,8 @@ dump_cgraph_node (FILE *f, struct cgraph_node *node)
fprintf (f, " always_inline"); fprintf (f, " always_inline");
else if (node->local.inlinable) else if (node->local.inlinable)
fprintf (f, " inlinable"); fprintf (f, " inlinable");
else if (node->local.versionable)
fprintf (f, " versionable");
if (node->local.redefined_extern_inline) if (node->local.redefined_extern_inline)
fprintf (f, " redefined_extern_inline"); fprintf (f, " redefined_extern_inline");
if (TREE_ASM_WRITTEN (node->decl)) if (TREE_ASM_WRITTEN (node->decl))
...@@ -2046,6 +2048,8 @@ cgraph_clone_edge (struct cgraph_edge *e, struct cgraph_node *n, ...@@ -2046,6 +2048,8 @@ cgraph_clone_edge (struct cgraph_edge *e, struct cgraph_node *n,
/* Create node representing clone of N executed COUNT times. Decrease /* Create node representing clone of N executed COUNT times. Decrease
the execution counts from original node too. the execution counts from original node too.
The new clone will have decl set to DECL that may or may not be the same
as decl of N.
When UPDATE_ORIGINAL is true, the counts are subtracted from the original When UPDATE_ORIGINAL is true, the counts are subtracted from the original
function's profile to reflect the fact that part of execution is handled function's profile to reflect the fact that part of execution is handled
......
...@@ -105,6 +105,10 @@ struct GTY(()) cgraph_local_info { ...@@ -105,6 +105,10 @@ struct GTY(()) cgraph_local_info {
/* False when there something makes inlining impossible (such as va_arg). */ /* False when there something makes inlining impossible (such as va_arg). */
unsigned inlinable : 1; unsigned inlinable : 1;
/* False when there something makes versioning impossible.
Currently computed and used only by ipa-cp. */
unsigned versionable : 1;
/* True when function should be inlined independently on its size. */ /* True when function should be inlined independently on its size. */
unsigned disregard_inline_limits : 1; unsigned disregard_inline_limits : 1;
......
...@@ -183,6 +183,7 @@ ipcp_analyze_node (struct cgraph_node *node) ...@@ -183,6 +183,7 @@ ipcp_analyze_node (struct cgraph_node *node)
/* Unreachable nodes should have been eliminated before ipcp. */ /* Unreachable nodes should have been eliminated before ipcp. */
gcc_assert (node->needed || node->reachable); gcc_assert (node->needed || node->reachable);
node->local.versionable = tree_versionable_function_p (node->decl);
ipa_initialize_node_params (node); ipa_initialize_node_params (node);
ipa_detect_param_modifications (node); ipa_detect_param_modifications (node);
} }
...@@ -419,7 +420,7 @@ ipcp_versionable_function_p (struct cgraph_node *node) ...@@ -419,7 +420,7 @@ ipcp_versionable_function_p (struct cgraph_node *node)
basic_block bb; basic_block bb;
/* There are a number of generic reasons functions cannot be versioned. */ /* There are a number of generic reasons functions cannot be versioned. */
if (!tree_versionable_function_p (decl)) if (!node->local.versionable)
return false; return false;
/* Removing arguments doesn't work if the function takes varargs. */ /* Removing arguments doesn't work if the function takes varargs. */
......
...@@ -468,6 +468,7 @@ lto_output_node (struct lto_simple_output_block *ob, struct cgraph_node *node, ...@@ -468,6 +468,7 @@ lto_output_node (struct lto_simple_output_block *ob, struct cgraph_node *node,
bp_pack_value (bp, node->local.externally_visible, 1); bp_pack_value (bp, node->local.externally_visible, 1);
bp_pack_value (bp, node->local.finalized, 1); bp_pack_value (bp, node->local.finalized, 1);
bp_pack_value (bp, node->local.inlinable, 1); bp_pack_value (bp, node->local.inlinable, 1);
bp_pack_value (bp, node->local.versionable, 1);
bp_pack_value (bp, node->local.disregard_inline_limits, 1); bp_pack_value (bp, node->local.disregard_inline_limits, 1);
bp_pack_value (bp, node->local.redefined_extern_inline, 1); bp_pack_value (bp, node->local.redefined_extern_inline, 1);
bp_pack_value (bp, node->local.vtable_method, 1); bp_pack_value (bp, node->local.vtable_method, 1);
...@@ -921,6 +922,7 @@ input_overwrite_node (struct lto_file_decl_data *file_data, ...@@ -921,6 +922,7 @@ input_overwrite_node (struct lto_file_decl_data *file_data,
node->local.externally_visible = bp_unpack_value (bp, 1); node->local.externally_visible = bp_unpack_value (bp, 1);
node->local.finalized = bp_unpack_value (bp, 1); node->local.finalized = bp_unpack_value (bp, 1);
node->local.inlinable = bp_unpack_value (bp, 1); node->local.inlinable = bp_unpack_value (bp, 1);
node->local.versionable = bp_unpack_value (bp, 1);
node->local.disregard_inline_limits = bp_unpack_value (bp, 1); node->local.disregard_inline_limits = bp_unpack_value (bp, 1);
node->local.redefined_extern_inline = bp_unpack_value (bp, 1); node->local.redefined_extern_inline = bp_unpack_value (bp, 1);
node->local.vtable_method = bp_unpack_value (bp, 1); node->local.vtable_method = bp_unpack_value (bp, 1);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment