This is the mail archive of the 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]

Re: RFA: improvement to bt-load.c

On Fri, Jan 23, 2004 at 02:35:05PM +0000, Joern Rennecke wrote:
> -   If we have a profiling count available, we could use it here.  */
> +   When we have a profiling count available, we get it as bb->frequency.
> +   However, if not compiling with -fbranch-probabilities, or no valid
> +   profile data is available, all the execution counts are zero, so
> +   augment these counts with a heuristic based on loop depth.  */
>  static int
>  basic_block_freq (basic_block bb)
>  {
> -  return bb->frequency;
> +  int loop_depth = MIN (10, (bb->loop_depth));
> +
> +  return bb->frequency + (1 << (loop_depth * 3));

This shouldn't be needed?  See estimate_bb_frequencies.

The rest of it looks good.  I'm not sure we need to keep the old
algorithm around though.  At the moment, SH is the only user of
this code, so if you get better results there, great.  And, really,
it makes sense that you would; I can't think of any reason the new
would work worse than the old.


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