diff options
author | m.hayes <m.hayes@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-01-01 00:17:45 +0000 |
---|---|---|
committer | m.hayes <m.hayes@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-01-01 00:17:45 +0000 |
commit | 979238562139973ebcb249e61edd988e48023684 (patch) | |
tree | 1c5f9be87db97981004d9757b9fef53f1cb8a532 /gcc/loop.c | |
parent | 23e52523089ace013e66309eef8bbd03fa2b7dce (diff) | |
download | gcc-979238562139973ebcb249e61edd988e48023684.tar.gz |
* loop.c (LOOP_REG_LIFETIME, LOOP_REG_GLOBAL_P): Define.
(scan_loop, record_giv): Use LOOP_REG_LIFETIME and LOOP_REG_GLOBAL_P.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@38576 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/loop.c')
-rw-r--r-- | gcc/loop.c | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/gcc/loop.c b/gcc/loop.c index 57b4555839f..87a5adfe727 100644 --- a/gcc/loop.c +++ b/gcc/loop.c @@ -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 |