summaryrefslogtreecommitdiff
path: root/gcc/local-alloc.c
diff options
context:
space:
mode:
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2001-06-22 17:18:23 +0000
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2001-06-22 17:18:23 +0000
commit63f236087f033781e482c61b8d159595cb371d4f (patch)
treed48fd46b997881efda1b77cb5b95669fa3c2921d /gcc/local-alloc.c
parent9c207309827b51482008b0bcc36f73d9147f6eaf (diff)
downloadgcc-63f236087f033781e482c61b8d159595cb371d4f.tar.gz
* regs.h (struct reg_info_def): Add freq field.
(REG_N_REFS): Update comment. (REG_FREQ): New. * regclass.c (scan_one_insn): Update REG_FREQ. * flow.c (mark_set_1): Update REG_FREQ, make REG_N_SETS unweighted. (attempt_auto_inc): Likewise. (mark_used_reg): Likewise. (try_pre_increment_1): Likewise. * local-alloc.c (struct qty): Add freq field. (alloc_qty): Set freq. (update_equiv_regs): Set REG_FREQ. (QTY_CMP_PRI): Use freq. (combine_regs): Update qty->freq. * global.c (struct allocno): Update comment for n_refs; add freq field. (local_reg_freq): New array. (global_alloc): Update freq field; allocate and initialize local_reg_freq. (allocno_compare): Use freq field. (find_reg): Likewise. * reload1.c (count_pseudo): Use freq isntead of n_refs. (count_spilled_pseudo): Likewise. * tm.texi (GCOV_TYPE_SIZE): Document. * basic-block.h (gcov_type): Define. (struct edge_def): Use gcov_type for count field. (struct basic_block_def): Likewise. * defaults.h (GCOV_TYPE_SIZE): Define. * final.c (end_final): Use GCOV_TYPE_SIZE. * flow.c (dump_edge_info, dump_flow_info, dump_bb): Print count fields using HOST_WIDEST_INT_PRINT_DEC. * gcov-io.h (__fetch_gcov_type, __store_gcov_type, __read_gcov_type, __write_gcov_type): New. (store_long): Remove. * gcov.c (gcov_type): Set default. (struct adj_list): Use gcov_type for arc_count. (bb_info): Use gcov_type for succ_count, pred_count and exec_count. (create_program_flow_graph): Read arc_count properly. (solve_program_flow_graph): 'total' is gcov_type. (output_data): Line_counts is gcov_type, print it properly. * libgcc2.c (struct bb): Counts is gcov_type. (__bb_exit_func): Use __read_gcov_type and __write_gcov_type. * profile.c (LONG_TYPE_SIZE, LONG_LONG_TYPE_SIZE): Set default. (GCOV_TYPE_SIZE): Define. (struct bb_info): succ_count and pred_count is gcov_type. (compute_branch_probabilities): Use __read_gcov_type, print read edges to the dump file. (total): Is gcov_type. (gen_edge_profiler): Use GCOV_TYPE_SIZE. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@43505 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/local-alloc.c')
-rw-r--r--gcc/local-alloc.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/gcc/local-alloc.c b/gcc/local-alloc.c
index 13155f3a6b5..4424074b653 100644
--- a/gcc/local-alloc.c
+++ b/gcc/local-alloc.c
@@ -85,6 +85,10 @@ struct qty
int n_refs;
+ /* The frequency of uses of quantity Q. */
+
+ int freq;
+
/* Insn number (counting from head of basic block)
where quantity Q was born. -1 if birth has not been recorded. */
@@ -321,6 +325,7 @@ alloc_qty (regno, mode, size, birth)
qty[qtyno].min_class = reg_preferred_class (regno);
qty[qtyno].alternate_class = reg_alternate_class (regno);
qty[qtyno].n_refs = REG_N_REFS (regno);
+ qty[qtyno].freq = REG_FREQ (regno);
qty[qtyno].changes_mode = REG_CHANGES_MODE (regno);
}
@@ -1127,6 +1132,7 @@ update_equiv_regs ()
remove_death (regno, insn);
REG_N_REFS (regno) = 0;
+ REG_FREQ (regno) = 0;
PUT_CODE (equiv_insn, NOTE);
NOTE_LINE_NUMBER (equiv_insn) = NOTE_INSN_DELETED;
NOTE_SOURCE_FILE (equiv_insn) = 0;
@@ -1697,7 +1703,7 @@ block_alloc (b)
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].n_refs * qty[q].size) \
+ ((int) (((double) (floor_log2 (qty[q].n_refs) * qty[q].freq * qty[q].size) \
/ (qty[q].death - qty[q].birth)) * 10000))
static int
@@ -1966,6 +1972,7 @@ combine_regs (usedreg, setreg, may_save_copy, insn_number, insn, already_dead)
/* Update info about quantity SQTY. */
qty[sqty].n_calls_crossed += REG_N_CALLS_CROSSED (sreg);
qty[sqty].n_refs += REG_N_REFS (sreg);
+ qty[sqty].freq += REG_FREQ (sreg);
if (usize < ssize)
{
register int i;