diff options
author | Jeffrey A Law <law@cygnus.com> | 2000-01-04 07:26:08 +0000 |
---|---|---|
committer | Jeff Law <law@gcc.gnu.org> | 2000-01-04 00:26:08 -0700 |
commit | 8c0ede34a2381fae5012efa703f0277bfc9b6358 (patch) | |
tree | df113e819b87f51b0ac10ba17b994a0cce2a92ae | |
parent | 4963c995cc86f829725ad41a44674aa49ee82ef4 (diff) | |
download | gcc-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/ChangeLog | 3 | ||||
-rw-r--r-- | gcc/regclass.c | 12 |
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); |