aboutsummaryrefslogtreecommitdiff
path: root/gcc/local-alloc.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/local-alloc.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/local-alloc.c')
-rw-r--r--gcc/local-alloc.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/gcc/local-alloc.c b/gcc/local-alloc.c
index 4424074..a068db8 100644
--- a/gcc/local-alloc.c
+++ b/gcc/local-alloc.c
@@ -1698,13 +1698,14 @@ block_alloc (b)
/* 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 frequency (max REG_FREQ_MAX).
+ Multiplying this by 10000/REG_FREQ_MAX can't overflow.
QTY_CMP_PRI is also used by qty_sugg_compare. */
#define QTY_CMP_PRI(q) \
((int) (((double) (floor_log2 (qty[q].n_refs) * qty[q].freq * qty[q].size) \
- / (qty[q].death - qty[q].birth)) * 10000))
+ / (qty[q].death - qty[q].birth)) * (10000 / REG_FREQ_MAX)))
static int
qty_compare (q1, q2)