diff options
author | Michael Hayes <mhayes@redhat.com> | 2001-01-01 00:17:45 +0000 |
---|---|---|
committer | Michael Hayes <m.hayes@gcc.gnu.org> | 2001-01-01 00:17:45 +0000 |
commit | b8056b46cd76fc0ad5b493b3f9e71d8d0e8236c3 (patch) | |
tree | 1c5f9be87db97981004d9757b9fef53f1cb8a532 /gcc/loop.c | |
parent | 8529a489d600279cd32ff2e1b243f17c3e6e951c (diff) | |
download | gcc-b8056b46cd76fc0ad5b493b3f9e71d8d0e8236c3.zip gcc-b8056b46cd76fc0ad5b493b3f9e71d8d0e8236c3.tar.gz gcc-b8056b46cd76fc0ad5b493b3f9e71d8d0e8236c3.tar.bz2 |
loop.c (LOOP_REG_LIFETIME, [...]): Define.
* loop.c (LOOP_REG_LIFETIME, LOOP_REG_GLOBAL_P): Define.
(scan_loop, record_giv): Use LOOP_REG_LIFETIME and LOOP_REG_GLOBAL_P.
From-SVN: r38576
Diffstat (limited to 'gcc/loop.c')
-rw-r--r-- | gcc/loop.c | 25 |
1 files changed, 12 insertions, 13 deletions
@@ -54,6 +54,13 @@ Boston, MA 02111-1307, USA. */ #include "except.h" #include "toplev.h" +#define LOOP_REG_LIFETIME(LOOP, REGNO) \ +((REGNO_LAST_LUID (REGNO) - REGNO_FIRST_LUID (REGNO))) + +#define LOOP_REG_GLOBAL_P(LOOP, REGNO) \ +((REGNO_LAST_LUID (REGNO) > INSN_LUID ((LOOP)->end) \ + || REGNO_FIRST_LUID (REGNO) < INSN_LUID ((LOOP)->start))) + /* Vector mapping INSN_UIDs to luids. The luids are like uids but increase monotonically always. @@ -824,12 +831,9 @@ scan_loop (loop, flags) or consec_sets_invariant_p returned 2 (only conditionally invariant). */ m->cond = ((tem | tem1 | tem2) > 1); - m->global = (REGNO_LAST_LUID (regno) - > INSN_LUID (loop_end) - || REGNO_FIRST_LUID (regno) < INSN_LUID (loop_start)); + m->global = LOOP_REG_GLOBAL_P (loop, regno); m->match = 0; - m->lifetime = (REGNO_LAST_LUID (regno) - - REGNO_FIRST_LUID (regno)); + m->lifetime = LOOP_REG_LIFETIME (loop, regno); m->savings = VARRAY_INT (regs->n_times_set, regno); if (find_reg_note (p, REG_RETVAL, NULL_RTX)) m->savings += libcall_benefit (p); @@ -922,10 +926,7 @@ scan_loop (loop, flags) INSN_LUID and hence must make a conservative assumption. */ m->global = (INSN_UID (p) >= max_uid_for_loop - || (REGNO_LAST_LUID (regno) - > INSN_LUID (loop_end)) - || (REGNO_FIRST_LUID (regno) - < INSN_LUID (p)) + || LOOP_REG_GLOBAL_P (loop, regno) || (labels_in_range_p (p, REGNO_FIRST_LUID (regno)))); if (maybe_never && m->global) @@ -935,8 +936,7 @@ scan_loop (loop, flags) m->regno = regno; m->cond = 0; m->match = 0; - m->lifetime = (REGNO_LAST_LUID (regno) - - REGNO_FIRST_LUID (regno)); + m->lifetime = LOOP_REG_LIFETIME (loop, regno); m->savings = 1; VARRAY_INT (regs->set_in_loop, regno) = -1; /* Add M to the end of the chain MOVABLES. */ @@ -4936,8 +4936,7 @@ record_giv (loop, v, insn, src_reg, dest_reg, mult_val, add_val, ext_val, { v->mode = GET_MODE (SET_DEST (set)); - v->lifetime = (REGNO_LAST_LUID (REGNO (dest_reg)) - - REGNO_FIRST_LUID (REGNO (dest_reg))); + v->lifetime = LOOP_REG_LIFETIME (loop, REGNO (dest_reg)); /* If the lifetime is zero, it means that this register is really a dead store. So mark this as a giv that can be |