This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[pretty-ipa] Remove master clones
- From: Jan Hubicka <jh at suse dot cz>
- To: gcc-patches at gcc dot gnu dot org
- Date: Mon, 17 Nov 2008 16:52:18 +0100
- Subject: [pretty-ipa] Remove master clones
Hi,
this patch removes master clones, with passes properly WHOPRized we no
longer need them and they was not that good idea from beggining.
Honza
* 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.
Index: cgraph.c
===================================================================
*** cgraph.c (revision 141944)
--- cgraph.c (working copy)
*************** cgraph_node (tree decl)
*** 464,471 ****
if (*slot)
{
node = *slot;
- if (!node->master_clone)
- node->master_clone = node;
return node;
}
--- 464,469 ----
*************** cgraph_node (tree decl)
*** 477,483 ****
node->origin = cgraph_node (DECL_CONTEXT (decl));
node->next_nested = node->origin->nested;
node->origin->nested = node;
- node->master_clone = node;
}
if (assembler_name_hash)
{
--- 475,480 ----
*************** cgraph_remove_node (struct cgraph_node *
*** 983,992 ****
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;
node->next_clone->prev_clone = NULL;
}
--- 980,985 ----
*************** dump_cgraph_node (FILE *f, struct cgraph
*** 1135,1142 ****
if (cgraph_function_flags_ready)
fprintf (f, " availability:%s",
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)
fprintf (f, " executed "HOST_WIDEST_INT_PRINT_DEC"x",
(HOST_WIDEST_INT)node->count);
--- 1128,1133 ----
*************** cgraph_clone_node (struct cgraph_node *n
*** 1352,1358 ****
new_node->local = n->local;
new_node->global = n->global;
new_node->rtl = n->rtl;
- new_node->master_clone = n->master_clone;
new_node->count = count;
if (n->count)
{
--- 1343,1348 ----
*************** cgraph_clone_node (struct cgraph_node *n
*** 1384,1411 ****
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. */
void
cgraph_unnest_node (struct cgraph_node *node)
--- 1374,1379 ----
Index: cgraph.h
===================================================================
*** cgraph.h (revision 141944)
--- cgraph.h (working copy)
*************** struct cgraph_node GTY((chain_next ("%h.
*** 149,157 ****
/* Pointer to the next clone. */
struct cgraph_node *next_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
to the edge to speed up cgraph_edge function. */
htab_t GTY((param_is (struct cgraph_edge))) call_site_hash;
--- 149,154 ----
*************** bool cgraph_function_possibly_inlined_p
*** 337,344 ****
void cgraph_unnest_node (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);
/* In cgraphunit.c */
--- 334,339 ----
Index: ipa-type-escape.c
===================================================================
*** ipa-type-escape.c (revision 141944)
--- ipa-type-escape.c (working copy)
*************** type_escape_execute (void)
*** 1987,1995 ****
they may cause a type variable to escape.
*/
for (node = cgraph_nodes; node; node = node->next)
! if (node->analyzed
! && (cgraph_is_master_clone (node)
! || (cgraph_function_body_availability (node) == AVAIL_OVERWRITABLE)))
analyze_function (node);
--- 1987,1993 ----
they may cause a type variable to escape.
*/
for (node = cgraph_nodes; node; node = node->next)
! if (node->analyzed)
analyze_function (node);
Index: tree-ssa-structalias.c
===================================================================
*** tree-ssa-structalias.c (revision 141944)
--- tree-ssa-structalias.c (working copy)
*************** ipa_pta_execute (void)
*** 5525,5531 ****
for (node = cgraph_nodes; node; node = node->next)
{
! if (!node->analyzed || cgraph_is_master_clone (node))
{
unsigned int varid;
--- 5525,5531 ----
for (node = cgraph_nodes; node; node = node->next)
{
! if (!node->analyzed)
{
unsigned int varid;
*************** ipa_pta_execute (void)
*** 5541,5547 ****
}
for (node = cgraph_nodes; node; node = node->next)
{
! if (node->analyzed && cgraph_is_master_clone (node))
{
struct function *func = DECL_STRUCT_FUNCTION (node->decl);
basic_block bb;
--- 5541,5547 ----
}
for (node = cgraph_nodes; node; node = node->next)
{
! if (node->analyzed)
{
struct function *func = DECL_STRUCT_FUNCTION (node->decl);
basic_block bb;