This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

pretty-ipa merge 2: master clones removal


Hi,
this patch removes master clones that are not really used anywhere
anymore and are not compatible with the new clonning infrastructure.

Bootstrapped/regtested x86_64-linux, comitted.

Index: ChangeLog
===================================================================
*** ChangeLog	(revision 145174)
--- ChangeLog	(working copy)
***************
*** 1,5 ****
--- 1,15 ----
  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
  	inline are always safe to assume that it is not going to be replaced.
  
Index: cgraph.c
===================================================================
*** cgraph.c	(revision 145174)
--- 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 *
*** 985,995 ****
        if (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;
  	node->next_clone->prev_clone = NULL;
--- 982,987 ----
*************** dump_cgraph_node (FILE *f, struct cgraph
*** 1139,1146 ****
    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);
--- 1131,1136 ----
*************** cgraph_clone_node (struct cgraph_node *n
*** 1349,1355 ****
    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)
      {
--- 1339,1344 ----
*************** cgraph_clone_node (struct cgraph_node *n
*** 1381,1408 ****
    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)
--- 1370,1375 ----
Index: cgraph.h
===================================================================
*** cgraph.h	(revision 145173)
--- cgraph.h	(working copy)
*************** struct cgraph_node GTY((chain_next ("%h.
*** 143,151 ****
    /* 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;
--- 143,148 ----
*************** bool cgraph_function_possibly_inlined_p 
*** 334,341 ****
  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  */
--- 331,336 ----
Index: ipa-type-escape.c
===================================================================
*** ipa-type-escape.c	(revision 145173)
--- 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 145173)
--- tree-ssa-structalias.c	(working copy)
*************** ipa_pta_execute (void)
*** 5669,5675 ****
  
    for (node = cgraph_nodes; node; node = node->next)
      {
!       if (!node->analyzed || cgraph_is_master_clone (node))
  	{
  	  unsigned int varid;
  
--- 5669,5675 ----
  
    for (node = cgraph_nodes; node; node = node->next)
      {
!       if (!node->analyzed)
  	{
  	  unsigned int varid;
  
*************** ipa_pta_execute (void)
*** 5685,5691 ****
      }
    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;
--- 5685,5691 ----
      }
    for (node = cgraph_nodes; node; node = node->next)
      {
!       if (node->analyzed)
  	{
  	  struct function *func = DECL_STRUCT_FUNCTION (node->decl);
  	  basic_block bb;


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]