Commit 144e8aac by Jan Hubicka Committed by Jan Hubicka

cgraph.c (cgraph_node, [...]): Remove master clone handling.


	* cgraph.c (cgraph_node, cgraph_remove_node, dump_cgraph_node,
	cgraph_clone_node): Remove master clone handling.
	(cgraph_is_master_clone, cgraph_master_clone): Remove.
	* cgraph.h (master_clone): Remove.
	(cgraph_is_master_clone, cgraph_master_clone): Remove.
	* ipa-type-escape.c (type_escape_execute): Remove use of master clone.
	(tree-ssa-structalias.c (ipa_pta_execute): Likewise.

From-SVN: r145175
parent 4a371c8d
2009-03-28 Jan Hubicka <jh@suse.cz> 2009-03-28 Jan Hubicka <jh@suse.cz>
* cgraph.c (cgraph_node, cgraph_remove_node, dump_cgraph_node,
cgraph_clone_node): Remove master clone handling.
(cgraph_is_master_clone, cgraph_master_clone): Remove.
* cgraph.h (master_clone): Remove.
(cgraph_is_master_clone, cgraph_master_clone): Remove.
* ipa-type-escape.c (type_escape_execute): Remove use of master clone.
(tree-ssa-structalias.c (ipa_pta_execute): Likewise.
2009-03-28 Jan Hubicka <jh@suse.cz>
* cgraph.c (cgraph_function_body_availability): Functions declared * cgraph.c (cgraph_function_body_availability): Functions declared
inline are always safe to assume that it is not going to be replaced. inline are always safe to assume that it is not going to be replaced.
......
...@@ -464,8 +464,6 @@ cgraph_node (tree decl) ...@@ -464,8 +464,6 @@ cgraph_node (tree decl)
if (*slot) if (*slot)
{ {
node = *slot; node = *slot;
if (!node->master_clone)
node->master_clone = node;
return node; return node;
} }
...@@ -477,7 +475,6 @@ cgraph_node (tree decl) ...@@ -477,7 +475,6 @@ cgraph_node (tree decl)
node->origin = cgraph_node (DECL_CONTEXT (decl)); node->origin = cgraph_node (DECL_CONTEXT (decl));
node->next_nested = node->origin->nested; node->next_nested = node->origin->nested;
node->origin->nested = node; node->origin->nested = node;
node->master_clone = node;
} }
if (assembler_name_hash) if (assembler_name_hash)
{ {
...@@ -985,11 +982,6 @@ cgraph_remove_node (struct cgraph_node *node) ...@@ -985,11 +982,6 @@ cgraph_remove_node (struct cgraph_node *node)
if (node->next_clone) if (node->next_clone)
{ {
struct cgraph_node *new_node = node->next_clone; struct cgraph_node *new_node = node->next_clone;
struct cgraph_node *n;
/* Make the next clone be the master clone */
for (n = new_node; n; n = n->next_clone)
n->master_clone = new_node;
*slot = new_node; *slot = new_node;
node->next_clone->prev_clone = NULL; node->next_clone->prev_clone = NULL;
...@@ -1139,8 +1131,6 @@ dump_cgraph_node (FILE *f, struct cgraph_node *node) ...@@ -1139,8 +1131,6 @@ dump_cgraph_node (FILE *f, struct cgraph_node *node)
if (cgraph_function_flags_ready) if (cgraph_function_flags_ready)
fprintf (f, " availability:%s", fprintf (f, " availability:%s",
cgraph_availability_names [cgraph_function_body_availability (node)]); cgraph_availability_names [cgraph_function_body_availability (node)]);
if (node->master_clone && node->master_clone->uid != node->uid)
fprintf (f, "(%i)", node->master_clone->uid);
if (node->count) if (node->count)
fprintf (f, " executed "HOST_WIDEST_INT_PRINT_DEC"x", fprintf (f, " executed "HOST_WIDEST_INT_PRINT_DEC"x",
(HOST_WIDEST_INT)node->count); (HOST_WIDEST_INT)node->count);
...@@ -1349,7 +1339,6 @@ cgraph_clone_node (struct cgraph_node *n, gcov_type count, int freq, ...@@ -1349,7 +1339,6 @@ cgraph_clone_node (struct cgraph_node *n, gcov_type count, int freq,
new_node->local = n->local; new_node->local = n->local;
new_node->global = n->global; new_node->global = n->global;
new_node->rtl = n->rtl; new_node->rtl = n->rtl;
new_node->master_clone = n->master_clone;
new_node->count = count; new_node->count = count;
if (n->count) if (n->count)
{ {
...@@ -1381,28 +1370,6 @@ cgraph_clone_node (struct cgraph_node *n, gcov_type count, int freq, ...@@ -1381,28 +1370,6 @@ cgraph_clone_node (struct cgraph_node *n, gcov_type count, int freq,
return new_node; return new_node;
} }
/* Return true if N is an master_clone, (see cgraph_master_clone). */
bool
cgraph_is_master_clone (struct cgraph_node *n)
{
return (n == cgraph_master_clone (n));
}
struct cgraph_node *
cgraph_master_clone (struct cgraph_node *n)
{
enum availability avail = cgraph_function_body_availability (n);
if (avail == AVAIL_NOT_AVAILABLE || avail == AVAIL_OVERWRITABLE)
return NULL;
if (!n->master_clone)
n->master_clone = cgraph_node (n->decl);
return n->master_clone;
}
/* NODE is no longer nested function; update cgraph accordingly. */ /* NODE is no longer nested function; update cgraph accordingly. */
void void
cgraph_unnest_node (struct cgraph_node *node) cgraph_unnest_node (struct cgraph_node *node)
......
...@@ -143,9 +143,6 @@ struct cgraph_node GTY((chain_next ("%h.next"), chain_prev ("%h.previous"))) ...@@ -143,9 +143,6 @@ struct cgraph_node GTY((chain_next ("%h.next"), chain_prev ("%h.previous")))
/* Pointer to the next clone. */ /* Pointer to the next clone. */
struct cgraph_node *next_clone; struct cgraph_node *next_clone;
struct cgraph_node *prev_clone; struct cgraph_node *prev_clone;
/* Pointer to a single unique cgraph node for this function. If the
function is to be output, this is the copy that will survive. */
struct cgraph_node *master_clone;
/* For functions with many calls sites it holds map from call expression /* For functions with many calls sites it holds map from call expression
to the edge to speed up cgraph_edge function. */ to the edge to speed up cgraph_edge function. */
htab_t GTY((param_is (struct cgraph_edge))) call_site_hash; htab_t GTY((param_is (struct cgraph_edge))) call_site_hash;
...@@ -334,8 +331,6 @@ bool cgraph_function_possibly_inlined_p (tree); ...@@ -334,8 +331,6 @@ bool cgraph_function_possibly_inlined_p (tree);
void cgraph_unnest_node (struct cgraph_node *); void cgraph_unnest_node (struct cgraph_node *);
enum availability cgraph_function_body_availability (struct cgraph_node *); enum availability cgraph_function_body_availability (struct cgraph_node *);
bool cgraph_is_master_clone (struct cgraph_node *);
struct cgraph_node *cgraph_master_clone (struct cgraph_node *);
void cgraph_add_new_function (tree, bool); void cgraph_add_new_function (tree, bool);
/* In cgraphunit.c */ /* In cgraphunit.c */
......
...@@ -1987,9 +1987,7 @@ type_escape_execute (void) ...@@ -1987,9 +1987,7 @@ type_escape_execute (void)
they may cause a type variable to escape. they may cause a type variable to escape.
*/ */
for (node = cgraph_nodes; node; node = node->next) for (node = cgraph_nodes; node; node = node->next)
if (node->analyzed if (node->analyzed)
&& (cgraph_is_master_clone (node)
|| (cgraph_function_body_availability (node) == AVAIL_OVERWRITABLE)))
analyze_function (node); analyze_function (node);
......
...@@ -5669,7 +5669,7 @@ ipa_pta_execute (void) ...@@ -5669,7 +5669,7 @@ ipa_pta_execute (void)
for (node = cgraph_nodes; node; node = node->next) for (node = cgraph_nodes; node; node = node->next)
{ {
if (!node->analyzed || cgraph_is_master_clone (node)) if (!node->analyzed)
{ {
unsigned int varid; unsigned int varid;
...@@ -5685,7 +5685,7 @@ ipa_pta_execute (void) ...@@ -5685,7 +5685,7 @@ ipa_pta_execute (void)
} }
for (node = cgraph_nodes; node; node = node->next) for (node = cgraph_nodes; node; node = node->next)
{ {
if (node->analyzed && cgraph_is_master_clone (node)) if (node->analyzed)
{ {
struct function *func = DECL_STRUCT_FUNCTION (node->decl); struct function *func = DECL_STRUCT_FUNCTION (node->decl);
basic_block bb; basic_block bb;
......
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