aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeffrey A Law <law@cygnus.com>2000-01-04 07:26:08 +0000
committerJeff Law <law@gcc.gnu.org>2000-01-04 00:26:08 -0700
commit8c0ede34a2381fae5012efa703f0277bfc9b6358 (patch)
treedf113e819b87f51b0ac10ba17b994a0cce2a92ae
parent4963c995cc86f829725ad41a44674aa49ee82ef4 (diff)
downloadgcc-8c0ede34a2381fae5012efa703f0277bfc9b6358.zip
gcc-8c0ede34a2381fae5012efa703f0277bfc9b6358.tar.gz
gcc-8c0ede34a2381fae5012efa703f0277bfc9b6358.tar.bz2
regclass.c (regclass): Properly compute loop_cost.
* regclass.c (regclass): Properly compute loop_cost. Adjust comments. From-SVN: r31192
-rw-r--r--gcc/ChangeLog3
-rw-r--r--gcc/regclass.c12
2 files changed, 11 insertions, 4 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 8998871..fe4c381 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,8 @@
Tue Jan 4 00:18:46 2000 Jeffrey A Law (law@cygnus.com)
+ * regclass.c (regclass): Properly compute loop_cost. Adjust
+ comments.
+
* regclass.c: Fix minor whitespace problems.
2000-01-03 Anthony Green <green@cygnus.com>
diff --git a/gcc/regclass.c b/gcc/regclass.c
index d25af73..667250c 100644
--- a/gcc/regclass.c
+++ b/gcc/regclass.c
@@ -1100,13 +1100,17 @@ regclass (f, nregs, dump)
basic_block bb = BASIC_BLOCK (index);
/* Show that an insn inside a loop is likely to be executed three
- times more than insns outside a loop. This is much more aggressive
- than the assumptions made elsewhere and is being tried as an
- experiment. */
+ times more than insns outside a loop. This is much more
+ aggressive than the assumptions made elsewhere and is being
+ tried as an experiment.
+
+ Note that a block's loop depth starts at zero, not one! We
+ must not subract one from the loop depth as that could give
+ a negative shift count below. */
if (optimize_size)
loop_cost = 1;
else
- loop_cost = 1 << (2 * MIN (bb->loop_depth - 1, 5));
+ loop_cost = 1 << (2 * MIN (bb->loop_depth, 5));
for (insn = bb->head; ; insn = NEXT_INSN (insn))
{
insn = scan_one_insn (insn, pass);