This is the mail archive of the
mailing list for the GCC project.
Re: RFA: improvement to bt-load.c
- From: Richard Henderson <rth at redhat dot com>
- To: Joern Rennecke <joern dot rennecke at superh dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Fri, 23 Jan 2004 14:32:04 -0800
- Subject: Re: RFA: improvement to bt-load.c
- References: <200401231435.i0NEZ5b06943@linsvr4.uk.superh.com>
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.