aboutsummaryrefslogtreecommitdiff
path: root/gcc/global.c
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2001-07-30 22:03:37 +0200
committerJan Hubicka <hubicka@gcc.gnu.org>2001-07-30 20:03:37 +0000
commita08b260482d8972aaaa3eb2a0175f9cc175dbad9 (patch)
treeaa952727c06ed38ed797f094dd095bd14f5da5f4 /gcc/global.c
parente5b3941e7e73831e7adecf066ee08461254eaadd (diff)
downloadgcc-a08b260482d8972aaaa3eb2a0175f9cc175dbad9.zip
gcc-a08b260482d8972aaaa3eb2a0175f9cc175dbad9.tar.gz
gcc-a08b260482d8972aaaa3eb2a0175f9cc175dbad9.tar.bz2
flow.c (mark_set_1): Use REG_FREQ_FROM_BB.
* flow.c (mark_set_1): Use REG_FREQ_FROM_BB. (attempt_auto_inc): LIkewise. (mark_used_reg): Likewise. (try_pre_increment_1): Likewise. * regclass.c (regclass): Likewise. * global.c (allocno_compare): Update comment; change scaling factor. * local-alloc.c (QTY_CMP_PRI): Likewise. * regs.h (REG_FREQ_FROM_BB): New. (REG_FREQ_MAX): Likewise. From-SVN: r44483
Diffstat (limited to 'gcc/global.c')
-rw-r--r--gcc/global.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/gcc/global.c b/gcc/global.c
index f03de63..6558fac 100644
--- a/gcc/global.c
+++ b/gcc/global.c
@@ -611,16 +611,17 @@ allocno_compare (v1p, v2p)
int v1 = *(const int *)v1p, v2 = *(const int *)v2p;
/* Note that the quotient will never be bigger than
the value of floor_log2 times the maximum number of
- times a register can occur in one insn (surely less than 100).
- Multiplying this by 10000 can't overflow. */
+ times a register can occur in one insn (surely less than 100)
+ weighted by the frequency (maximally REG_FREQ_MAX).
+ Multiplying this by 10000/REG_FREQ_MAX can't overflow. */
register int pri1
= (((double) (floor_log2 (allocno[v1].n_refs) * allocno[v1].freq)
/ allocno[v1].live_length)
- * 10000 * allocno[v1].size);
+ * (10000 / REG_FREQ_MAX) * allocno[v1].size);
register int pri2
= (((double) (floor_log2 (allocno[v2].n_refs) * allocno[v2].freq)
/ allocno[v2].live_length)
- * 10000 * allocno[v2].size);
+ * (10000 / REG_FREQ_MAX) * allocno[v2].size);
if (pri2 - pri1)
return pri2 - pri1;