aboutsummaryrefslogtreecommitdiff
path: root/gcc/flow.c
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2001-06-23 01:27:48 +0200
committerJan Hubicka <hubicka@gcc.gnu.org>2001-06-22 23:27:48 +0000
commit9401afe31a29a1b933a87eb5f11d20e950cae82d (patch)
tree1487bbd44b4837e8ff22896787a36be48e22e427 /gcc/flow.c
parent44f498639c0cdfd08c184f834ebae07b8dc51831 (diff)
downloadgcc-9401afe31a29a1b933a87eb5f11d20e950cae82d.zip
gcc-9401afe31a29a1b933a87eb5f11d20e950cae82d.tar.gz
gcc-9401afe31a29a1b933a87eb5f11d20e950cae82d.tar.bz2
flow.c (mark_set_1, [...]): compute REG_FREQ using bb->frequency.
* flow.c (mark_set_1, attempt_auto_inc, mark_used_reg, try_pre_increment_1): compute REG_FREQ using bb->frequency. * 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. * flow.c (split_edge): Set frequency. From-SVN: r43523
Diffstat (limited to 'gcc/flow.c')
-rw-r--r--gcc/flow.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/gcc/flow.c b/gcc/flow.c
index 5c0c6d7..2db6d20 100644
--- a/gcc/flow.c
+++ b/gcc/flow.c
@@ -1627,7 +1627,8 @@ split_edge (edge_in)
bb->pred = edge_in;
bb->succ = edge_out;
bb->count = edge_in->count;
- /* ??? Set bb->frequency. */
+ bb->frequency = (edge_in->probability * edge_in->src->frequency
+ / REG_BR_PROB_BASE);
edge_in->dest = bb;
edge_in->flags &= ~EDGE_CRITICAL;
@@ -4857,7 +4858,8 @@ mark_set_1 (pbi, code, reg, cond, insn, flags)
register twice if it is modified, but that is correct. */
REG_N_SETS (i) += 1;
REG_N_REFS (i) += 1;
- REG_FREQ (i) += (optimize_size ? 1 : pbi->bb->loop_depth + 1);
+ REG_FREQ (i) += (optimize_size || !pbi->bb->frequency
+ ? 1 : pbi->bb->frequency);
/* The insns where a reg is live are normally counted
elsewhere, but we want the count to include the insn
@@ -5524,7 +5526,8 @@ attempt_auto_inc (pbi, inc, insn, mem, incr, incr_reg)
/* Count an extra reference to the reg. When a reg is
incremented, spilling it is worse, so we want to make
that less likely. */
- REG_FREQ (regno) += (optimize_size ? 1 : pbi->bb->loop_depth + 1);
+ REG_FREQ (regno) += (optimize_size || !phi->bb->frequency
+ ? 1 : pbi->bb->frequency);
/* Count the increment as a setting of the register,
even though it isn't a SET in rtl. */
@@ -5690,7 +5693,7 @@ mark_used_reg (pbi, reg, cond, insn)
/* Count (weighted) number of uses of each reg. */
REG_FREQ (regno_first)
- += (optimize_size ? 1 : pbi->bb->loop_depth + 1);
+ += (optimize_size || !pbi->bb->frequency ? 1 : pbi->bb->frequency);
REG_N_REFS (regno_first)++;
}
}
@@ -6112,7 +6115,8 @@ try_pre_increment_1 (pbi, insn)
so we want to make that less likely. */
if (regno >= FIRST_PSEUDO_REGISTER)
{
- REG_FREQ (regno) += (optimize_size ? 1 : pbi->bb->loop_depth + 1);
+ REG_FREQ (regno) += (optimize_size || !phi->bb->frequency
+ ? 1 : pbi->bb->frequency);
REG_N_SETS (regno)++;
}