diff options
author | law <law@138bc75d-0d04-0410-961f-82ee72b054a4> | 2000-01-04 07:26:08 +0000 |
---|---|---|
committer | law <law@138bc75d-0d04-0410-961f-82ee72b054a4> | 2000-01-04 07:26:08 +0000 |
commit | e663e5afcd1e54ce6c0fad64b45a4d04a6965394 (patch) | |
tree | df113e819b87f51b0ac10ba17b994a0cce2a92ae /gcc/regclass.c | |
parent | d1c0bcc36c9fa6906155c4d24be273e14ea5231c (diff) | |
download | gcc-e663e5afcd1e54ce6c0fad64b45a4d04a6965394.tar.gz |
* regclass.c (regclass): Properly compute loop_cost. Adjust
comments.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@31192 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/regclass.c')
-rw-r--r-- | gcc/regclass.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/gcc/regclass.c b/gcc/regclass.c index d25af735f02..667250c7cc6 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); |