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]

[cfg-branch] STC improved


Hi,

this patch avoids starting a trace from a basic block whose frequency is lower than exec threshold.
It also adds dumping the key of the BBs being added to heaps.

Bootstraped i386

Joe

2001-12-12  Josef Zlomek  <zlomek@matfyz.cz>

	* bb-reorder.c (find_traces_1_round): Avoid starting a trace from a BB
	whose frequency is lower than exec threshold,  print key of BB to dump,
	indentation fixes.


*** gcc-cvs/gcc/bb-reorder.c	Tue Dec 11 16:53:31 2001
--- gcc-new/gcc/bb-reorder.c	Wed Dec 12 18:06:01 2001
*************** find_traces_1_round (branch_th, exec_th,
*** 161,166 ****
--- 161,179 ----
        if (RBI (bb)->visited)
  	continue;
  
+       /* If the BB's frequency is too low send BB to the next round.  */
+       if (bb->frequency < exec_th)
+ 	{
+ 	  int key = bb_to_key (bb);
+ 	  fibheap_insert (new_heap, key, bb);
+ 
+ 	  if (rtl_dump_file)
+ 	    fprintf (rtl_dump_file, 
+ 		     "  Possible start point of next round: %d (key: %d)\n",
+ 		     bb->index, key);
+ 	  continue;
+ 	}
+ 
        trace = traces + *n_traces;
        trace->first = bb;
        trace->last = bb;
*************** find_traces_1_round (branch_th, exec_th,
*** 239,250 ****
  		    {
  		      /* This successor is possible starting point for next
  			 round of trace creation.  */
! 		      fibheap_insert (new_heap, bb_to_key (e->dest), e->dest);
  
  		      if (rtl_dump_file)
  			fprintf (rtl_dump_file,
! 				 "  Possible start point of next round: %d\n",
! 				 e->dest->index);
  		    }
  		  continue;
  		}
--- 252,264 ----
  		    {
  		      /* This successor is possible starting point for next
  			 round of trace creation.  */
! 		      int key = bb_to_key (e->dest);
! 		      fibheap_insert (new_heap, key, e->dest);
  
  		      if (rtl_dump_file)
  			fprintf (rtl_dump_file,
! 				 "  Possible start point of next round: %d"
! 				 " (key: %d)\n", e->dest->index, key);
  		    }
  		  continue;
  		}
*************** find_traces_1_round (branch_th, exec_th,
*** 256,268 ****
  		    {
  		      /* Start a secondary trace from the old temporary best
  			 successor.  */
! 		      fibheap_insert (*heap, bb_to_key (best_edge->dest),
! 				      best_edge->dest);
  
  		      if (rtl_dump_file)
  			fprintf (rtl_dump_file, 
! 				 "  Possible start of secondary trace: %d\n",
! 				 best_edge->dest->index);
  		    }
  
  		  best_edge = e;
--- 270,282 ----
  		    {
  		      /* Start a secondary trace from the old temporary best
  			 successor.  */
! 		      int key = bb_to_key (best_edge->dest);
! 		      fibheap_insert (*heap, key, best_edge->dest);
  
  		      if (rtl_dump_file)
  			fprintf (rtl_dump_file, 
! 				 "  Possible start of secondary trace: %d"
! 				 " (key: %d)\n", best_edge->dest->index, key);
  		    }
  
  		  best_edge = e;
*************** find_traces_1_round (branch_th, exec_th,
*** 270,281 ****
  	      else if (!RBI (e->dest)->visited)
  		{
  		  /* Start a secondary trace from this successor.  */
! 		  fibheap_insert (*heap, bb_to_key (e->dest), e->dest);
  
  		  if (rtl_dump_file)
  		    fprintf (rtl_dump_file, 
! 			     "  Possible start of secondary trace: %d\n",
! 			     e->dest->index);
  		}
  	    }
  
--- 284,296 ----
  	      else if (!RBI (e->dest)->visited)
  		{
  		  /* Start a secondary trace from this successor.  */
! 		  int key = bb_to_key (e->dest);
! 		  fibheap_insert (*heap, key, e->dest);
  
  		  if (rtl_dump_file)
  		    fprintf (rtl_dump_file, 
! 			     "  Possible start of secondary trace: %d"
! 			     " (key: %d)\n", e->dest->index, key);
  		}
  	    }
  
*************** copy_bb_p (bb, trace, size_can_grow)
*** 453,461 ****
  	/* All edges point to EXIT_BLOCK or to the same trace
  	   OR the selected successor has not been visited yet.  */
  	{
!           if (size_can_grow || size <= uncond_jump_length)
  	    return true;
!           else
  	    return false;
  	}
        if (bb == first)
--- 468,476 ----
  	/* All edges point to EXIT_BLOCK or to the same trace
  	   OR the selected successor has not been visited yet.  */
  	{
! 	  if (size_can_grow || size <= uncond_jump_length)
  	    return true;
! 	  else
  	    return false;
  	}
        if (bb == first)


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