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] bb-reorder.c uses maybe_hot_bb_p


Hi,
this patch adds using the maybe_hot_bb_p and similar functions to set the parameters of the function copy_bb_p, which tells whether the basic block should be copied.

Bootstrapped on i686.

Joe 

Mon Feb 18 21:26:15 CET 2002  Josef Zlomek  <zlomek@matfyz.cz>

	bb-reorder.c (copy_bb_p): Set different parameters when bb is hot and
	when is not.

*** gcc-old/gcc/bb-reorder.c	Mon Feb 18 19:53:59 2002
--- gcc-new/gcc/bb-reorder.c	Mon Feb 18 19:54:47 2002
***************
*** 37,42 ****
--- 37,43 ----
  #include "cfglayout.h"
  #include "fibheap.h"
  #include "target.h"
+ #include "profile.h"
  
  /* The number of rounds.  */
  #define N_ROUNDS 4
*************** copy_bb_p (bb, trace, size_can_grow)
*** 543,548 ****
--- 544,550 ----
       bool size_can_grow;
  {
    int size = 0;
+   int max_size;
    rtx insn;
    static unsigned int id;
  
*************** copy_bb_p (bb, trace, size_can_grow)
*** 557,568 ****
      }
    else
      id++;
-     
    
    if (!bb->frequency)
      return false;
    if (!bb->pred || !bb->pred->pred_next)
      return false;
    while (1)
      {
        edge e, best_edge;
--- 559,580 ----
      }
    else
      id++;
    
    if (!bb->frequency)
      return false;
    if (!bb->pred || !bb->pred->pred_next)
      return false;
+ 
+   max_size = 8 * uncond_jump_length;
+   if (profile_info.count_profiles_merged
+       && flag_branch_probabilities)
+     {
+       if (maybe_hot_bb_p (bb))
+ 	max_size = 16 * uncond_jump_length;
+       else if (probably_never_executed_bb_p (bb))
+ 	size_can_grow = false;
+     }
+   
    while (1)
      {
        edge e, best_edge;
*************** copy_bb_p (bb, trace, size_can_grow)
*** 581,587 ****
  	  if (INSN_P (insn))
  	    size += get_attr_length (insn);
  	}
!       if (size > 8 * uncond_jump_length)
  	return false;
  
        /* Select the successor.  */
--- 593,599 ----
  	  if (INSN_P (insn))
  	    size += get_attr_length (insn);
  	}
!       if (size > max_size)
  	return false;
  
        /* Select the successor.  */


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