diff options
author | Jan Hubicka <jh@suse.cz> | 2001-07-30 22:03:37 +0200 |
---|---|---|
committer | Jan Hubicka <hubicka@gcc.gnu.org> | 2001-07-30 20:03:37 +0000 |
commit | a08b260482d8972aaaa3eb2a0175f9cc175dbad9 (patch) | |
tree | aa952727c06ed38ed797f094dd095bd14f5da5f4 /gcc/regs.h | |
parent | e5b3941e7e73831e7adecf066ee08461254eaadd (diff) | |
download | gcc-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/regs.h')
-rw-r--r-- | gcc/regs.h | 18 |
1 files changed, 18 insertions, 0 deletions
@@ -86,6 +86,24 @@ extern varray_type reg_n_info; #define REG_FREQ(N) (VARRAY_REG (reg_n_info, N)->freq) +/* The weights for each insn varries from 0 to REG_FREQ_BASE. + This constant does not need to be high, as in infrequently executed + regions we want to count instructions equivalently to optimize for + size instead of speed. */ +#define REG_FREQ_MAX 1000 + +/* Compute register frequency from the BB frequency. When optimizing for size, + or profile driven feedback is available and the function is never executed, + frequency is always equivalent. Otherwise rescale the basic block + frequency. */ +#define REG_FREQ_FROM_BB(bb) (optimize_size \ + || (flag_branch_probabilities \ + && !ENTRY_BLOCK_PTR->count) \ + ? REG_FREQ_MAX \ + : ((bb)->frequency * REG_FREQ_MAX / BB_FREQ_MAX)\ + ? ((bb)->frequency * REG_FREQ_MAX / BB_FREQ_MAX)\ + : 1) + /* Indexed by n, gives number of times (REG n) is set. ??? both regscan and flow allocate space for this. We should settle on just copy. */ |