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]

[tree-ssa] Alternative patch for split_critical_edges problem


Hello,

this patch makes the time spent in split_critical_edges in 20001226-1.c
to drop from 98 seconds to 7, i.e. it seems to be almost as effective as
not updating the dominators at all.

Regardless of whether the Daniel's patch will turn out to be beneficial,
this patch should be considered also, since split_edges is also used
on other places.

OK if it passes bootstrap & regtesting?

Zdenek

	* cfghooks.c (split_edge): Speed up updating of dominators.

Index: cfghooks.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cfghooks.c,v
retrieving revision 1.1.2.10
diff -c -3 -p -r1.1.2.10 cfghooks.c
*** cfghooks.c	13 Feb 2004 13:11:03 -0000	1.1.2.10
--- cfghooks.c	13 Feb 2004 14:39:26 -0000
*************** split_edge (edge e)
*** 385,390 ****
--- 385,391 ----
    basic_block ret;
    gcov_type count = e->count;
    int freq = EDGE_FREQUENCY (e);
+   edge f;
  
    if (!cfg_hooks->split_edge)
      internal_error ("%s does not support split_edge.", cfg_hooks->name);
*************** split_edge (edge e)
*** 399,407 ****
      set_immediate_dominator (CDI_DOMINATORS, ret, ret->pred->src);
  
    if (dom_computed[CDI_DOMINATORS] >= DOM_NO_FAST_QUERY)
!     set_immediate_dominator (CDI_DOMINATORS, ret->succ->dest,
! 			     recount_dominator (CDI_DOMINATORS,
! 						ret->succ->dest));
  
    return ret;
  }
--- 400,432 ----
      set_immediate_dominator (CDI_DOMINATORS, ret, ret->pred->src);
  
    if (dom_computed[CDI_DOMINATORS] >= DOM_NO_FAST_QUERY)
!     {
!       /* There are two cases:
! 
! 	 If the immediate dominator of e->dest is not e->src, it
! 	 remains unchanged.
! 
! 	 If immediate dominator of e->dest is e->src, it may become
! 	 ret, provided that all other predecessors of e->dest are
! 	 dominated by e->dest.  */
! 
!       if (get_immediate_dominator (CDI_DOMINATORS, ret->succ->dest)
! 	  == ret->pred->src)
! 	{
! 	  for (f = ret->succ->dest->pred; f; f = f->pred_next)
! 	    {
! 	      if (f == ret->succ)
! 		continue;
! 
! 	      if (!dominated_by_p (CDI_DOMINATORS, f->src,
! 				   ret->succ->dest))
! 		break;
! 	    }
! 
! 	  if (!f)
! 	    set_immediate_dominator (CDI_DOMINATORS, ret->succ->dest, ret);
! 	}
!     };
  
    return ret;
  }


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