aboutsummaryrefslogtreecommitdiff
path: root/gcc/flow.c
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2000-05-10 22:29:27 +0000
committerNick Clifton <nickc@gcc.gnu.org>2000-05-10 22:29:27 +0000
commitebfe71a8d1c7d4616e47d9de620d709499213322 (patch)
tree71bff9cc342616febb50293f425ececfecdf1c5b /gcc/flow.c
parent402823c45e9aa790ccbe0e4ce1cac4acdebe02a8 (diff)
downloadgcc-ebfe71a8d1c7d4616e47d9de620d709499213322.zip
gcc-ebfe71a8d1c7d4616e47d9de620d709499213322.tar.gz
gcc-ebfe71a8d1c7d4616e47d9de620d709499213322.tar.bz2
Do not bias REG_N_REFS by loop_depth when optimising for size.
From-SVN: r33833
Diffstat (limited to 'gcc/flow.c')
-rw-r--r--gcc/flow.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/gcc/flow.c b/gcc/flow.c
index e20e4b2..1bea9c2 100644
--- a/gcc/flow.c
+++ b/gcc/flow.c
@@ -4854,7 +4854,8 @@ find_auto_inc (pbi, x, insn)
/* 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_N_REFS (regno) += pbi->bb->loop_depth + 1;
+ REG_N_REFS (regno) += (optimize_size ? 1
+ : pbi->bb->loop_depth + 1);
/* Count the increment as a setting of the register,
even though it isn't a SET in rtl. */
@@ -4935,7 +4936,8 @@ mark_used_reg (pbi, reg, cond, insn)
REG_BASIC_BLOCK (regno) = REG_BLOCK_GLOBAL;
/* Count (weighted) number of uses of each reg. */
- REG_N_REFS (regno) += pbi->bb->loop_depth + 1;
+ REG_N_REFS (regno) += (optimize_size ? 1
+ : pbi->bb->loop_depth + 1);
}
}
@@ -5353,7 +5355,8 @@ try_pre_increment_1 (pbi, insn)
less likely. */
if (regno >= FIRST_PSEUDO_REGISTER)
{
- REG_N_REFS (regno) += pbi->bb->loop_depth + 1;
+ REG_N_REFS (regno) += (optimize_size ? 1
+ : pbi->bb->loop_depth + 1);
REG_N_SETS (regno)++;
}
return 1;