This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: make regclass to use estimated basic block frequencies
- To: Jan Hubicka <jh at suse dot cz>
- Subject: Re: make regclass to use estimated basic block frequencies
- From: Richard Henderson <rth at redhat dot com>
- Date: Thu, 21 Jun 2001 14:25:56 -0700
- Cc: gcc-patches at gcc dot gnu dot org, patches at x86-64 dot org
- References: <20010620173310.F28759@atrey.karlin.mff.cuni.cz>
On Wed, Jun 20, 2001 at 05:33:10PM +0200, Jan Hubicka wrote:
> * regclass.c (loop_cost): Kill.
> (frequency): New global variable.
> (record_operand_costs): Replace loop_cost by frequency.
> (scan_one_insn): Likewise.
> (regclass): Likewise; set frequency according to bb->frequency.
Ok.
On a related note, I was looking at your frequency estimation output.
Something isn't quite right. Consider
void f2(int n)
{
int i, j;
for (i = 0; i < n; ++i)
for (j = 0; j < n; ++j)
foo();
}
The correct answer should have the inner loop blocks run more than
the outer loop blocks run more than the entry block. Instead we see
Basic block 0: first insn 65, last 75, loop_depth 0, count 0, freq 1526.
Basic block 1: first insn 100, last 94, loop_depth 0, count 0, freq 916.
Basic block 2: first insn 19, last 81, loop_depth 1, count 0, freq 1665.
Basic block 3: first insn 101, last 87, loop_depth 1, count 0, freq 999.
Basic block 4: first insn 29, last 92, loop_depth 2, count 0, freq 10000.
Basic block 5: first insn 82, last 99, loop_depth 1, count 0, freq 1582.
Basic block 6: first insn 76, last 72, loop_depth 0, count 0, freq 686.
which shows only the inner block being reflected clearly.
r~