OSDN Git Service

Use accessor macros to access arrays based on regno; move many of the arrays into...
authormeissner <meissner@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 30 May 1997 18:19:19 +0000 (18:19 +0000)
committermeissner <meissner@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 30 May 1997 18:19:19 +0000 (18:19 +0000)
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@14140 138bc75d-0d04-0410-961f-82ee72b054a4

15 files changed:
gcc/basic-block.h
gcc/caller-save.c
gcc/combine.c
gcc/cse.c
gcc/flow.c
gcc/global.c
gcc/jump.c
gcc/local-alloc.c
gcc/loop.c
gcc/regclass.c
gcc/regs.h
gcc/reload1.c
gcc/sched.c
gcc/stupid.c
gcc/unroll.c

index 3755388..3d1f3a9 100644 (file)
@@ -66,4 +66,5 @@ extern regset *basic_block_live_at_start;
 
 #define REG_BLOCK_UNKNOWN -1
 #define REG_BLOCK_GLOBAL -2
-extern int *reg_basic_block;
+
+#define REG_BASIC_BLOCK(N) (reg_n_info[(N)].basic_block)
index ea5923d..f05f327 100644 (file)
@@ -262,7 +262,7 @@ setup_save_areas (pchanged)
   /* Find and record all call-used hard-registers in this function.  */
   CLEAR_HARD_REG_SET (hard_regs_used);
   for (i = FIRST_PSEUDO_REGISTER; i < max_regno; i++)
-    if (reg_renumber[i] >= 0 && reg_n_calls_crossed[i] > 0)
+    if (reg_renumber[i] >= 0 && REG_N_CALLS_CROSSED (i) > 0)
       {
        int regno = reg_renumber[i];
        int endregno 
index edf2126..12538fd 100644 (file)
@@ -1589,7 +1589,7 @@ try_combine (i3, i2, i1)
          rtx new_dest = gen_rtx (REG, compare_mode, regno);
 
          if (regno < FIRST_PSEUDO_REGISTER
-             || (reg_n_sets[regno] == 1 && ! added_sets_2
+             || (REG_N_SETS (regno) == 1 && ! added_sets_2
                  && ! REG_USERVAR_P (SET_DEST (newpat))))
            {
              if (regno >= FIRST_PSEUDO_REGISTER)
@@ -1792,7 +1792,7 @@ try_combine (i3, i2, i1)
              && GET_MODE (SET_DEST (newpat)) != VOIDmode
              && GET_CODE (i2dest) == REG
              && (REGNO (i2dest) < FIRST_PSEUDO_REGISTER
-                 || (reg_n_sets[REGNO (i2dest)] == 1 && ! added_sets_2
+                 || (REG_N_SETS (REGNO (i2dest)) == 1 && ! added_sets_2
                      && ! REG_USERVAR_P (i2dest))))
            ni2dest = gen_rtx (REG, GET_MODE (SET_DEST (newpat)),
                               REGNO (i2dest));
@@ -1861,7 +1861,7 @@ try_combine (i3, i2, i1)
              if (GET_CODE (new_i3_dest) == REG
                  && GET_CODE (new_i2_dest) == REG
                  && REGNO (new_i3_dest) == REGNO (new_i2_dest))
-               reg_n_sets[REGNO (new_i2_dest)]++;
+               REG_N_SETS (REGNO (new_i2_dest))++;
            }
        }
 
@@ -1877,7 +1877,7 @@ try_combine (i3, i2, i1)
          && (GET_MODE (*split) == GET_MODE (i2dest)
              || GET_MODE (*split) == VOIDmode
              || REGNO (i2dest) < FIRST_PSEUDO_REGISTER
-             || (reg_n_sets[REGNO (i2dest)] == 1 && ! added_sets_2
+             || (REG_N_SETS (REGNO (i2dest)) == 1 && ! added_sets_2
                  && ! REG_USERVAR_P (i2dest)))
          && (next_real_insn (i2) == i3
              || ! use_crosses_set_p (*split, INSN_CUID (i2)))
@@ -2113,7 +2113,7 @@ try_combine (i3, i2, i1)
              && ! reg_set_p (XEXP (note, 0), PATTERN (undobuf.other_insn)))
            {
              if (GET_CODE (XEXP (note, 0)) == REG)
-               reg_n_deaths[REGNO (XEXP (note, 0))]--;
+               REG_N_DEATHS (REGNO (XEXP (note, 0)))--;
 
              remove_note (undobuf.other_insn, note);
            }
@@ -2121,7 +2121,7 @@ try_combine (i3, i2, i1)
 
       for (note = new_other_notes; note; note = XEXP (note, 1))
        if (GET_CODE (XEXP (note, 0)) == REG)
-         reg_n_deaths[REGNO (XEXP (note, 0))]++;
+         REG_N_DEATHS (REGNO (XEXP (note, 0)))++;
 
       distribute_notes (new_other_notes, undobuf.other_insn,
                        undobuf.other_insn, NULL_RTX, NULL_RTX, NULL_RTX);
@@ -2272,7 +2272,7 @@ try_combine (i3, i2, i1)
       {
        for (temp = new_i2_notes; temp; temp = XEXP (temp, 1))
          if (GET_CODE (XEXP (temp, 0)) == REG)
-           reg_n_deaths[REGNO (XEXP (temp, 0))]++;
+           REG_N_DEATHS (REGNO (XEXP (temp, 0)))++;
        
        distribute_notes (new_i2_notes, i2, i2, NULL_RTX, NULL_RTX, NULL_RTX);
       }
@@ -2281,7 +2281,7 @@ try_combine (i3, i2, i1)
       {
        for (temp = new_i3_notes; temp; temp = XEXP (temp, 1))
          if (GET_CODE (XEXP (temp, 0)) == REG)
-           reg_n_deaths[REGNO (XEXP (temp, 0))]++;
+           REG_N_DEATHS (REGNO (XEXP (temp, 0)))++;
        
        distribute_notes (new_i3_notes, i3, i3, NULL_RTX, NULL_RTX, NULL_RTX);
       }
@@ -2294,7 +2294,7 @@ try_combine (i3, i2, i1)
     if (i3dest_killed)
       {
        if (GET_CODE (i3dest_killed) == REG)
-         reg_n_deaths[REGNO (i3dest_killed)]++;
+         REG_N_DEATHS (REGNO (i3dest_killed))++;
 
        distribute_notes (gen_rtx (EXPR_LIST, REG_DEAD, i3dest_killed,
                                   NULL_RTX),
@@ -2309,7 +2309,7 @@ try_combine (i3, i2, i1)
     if (i2dest_in_i2src)
       {
        if (GET_CODE (i2dest) == REG)
-         reg_n_deaths[REGNO (i2dest)]++;
+         REG_N_DEATHS (REGNO (i2dest))++;
 
        if (newi2pat && reg_set_p (i2dest, newi2pat))
          distribute_notes (gen_rtx (EXPR_LIST, REG_DEAD, i2dest, NULL_RTX),
@@ -2323,7 +2323,7 @@ try_combine (i3, i2, i1)
     if (i1dest_in_i1src)
       {
        if (GET_CODE (i1dest) == REG)
-         reg_n_deaths[REGNO (i1dest)]++;
+         REG_N_DEATHS (REGNO (i1dest))++;
 
        if (newi2pat && reg_set_p (i1dest, newi2pat))
          distribute_notes (gen_rtx (EXPR_LIST, REG_DEAD, i1dest, NULL_RTX),
@@ -2365,11 +2365,11 @@ try_combine (i3, i2, i1)
            && ! i2dest_in_i2src)
          {
            regno = REGNO (i2dest);
-           reg_n_sets[regno]--;
-           if (reg_n_sets[regno] == 0
+           REG_N_SETS (regno)--;
+           if (REG_N_SETS (regno) == 0
                && ! (basic_block_live_at_start[0][regno / REGSET_ELT_BITS]
                      & ((REGSET_ELT_TYPE) 1 << (regno % REGSET_ELT_BITS))))
-             reg_n_refs[regno] = 0;
+             REG_N_REFS (regno) = 0;
          }
       }
 
@@ -2388,11 +2388,11 @@ try_combine (i3, i2, i1)
        regno = REGNO (i1dest);
        if (! added_sets_1 && ! i1dest_in_i1src)
          {
-           reg_n_sets[regno]--;
-           if (reg_n_sets[regno] == 0
+           REG_N_SETS (regno)--;
+           if (REG_N_SETS (regno) == 0
                && ! (basic_block_live_at_start[0][regno / REGSET_ELT_BITS]
                      & ((REGSET_ELT_TYPE) 1 << (regno % REGSET_ELT_BITS))))
-             reg_n_refs[regno] = 0;
+             REG_N_REFS (regno) = 0;
          }
       }
 
@@ -4457,7 +4457,7 @@ simplify_set (x)
          rtx new_dest = gen_rtx (REG, compare_mode, regno);
 
          if (regno < FIRST_PSEUDO_REGISTER
-             || (reg_n_sets[regno] == 1 && ! REG_USERVAR_P (dest)))
+             || (REG_N_SETS (regno) == 1 && ! REG_USERVAR_P (dest)))
            {
              if (regno >= FIRST_PSEUDO_REGISTER)
                SUBST (regno_reg_rtx[regno], new_dest);
@@ -7246,7 +7246,7 @@ nonzero_bits (x, mode)
 
       if (reg_last_set_value[REGNO (x)] != 0
          && reg_last_set_mode[REGNO (x)] == mode
-         && (reg_n_sets[REGNO (x)] == 1
+         && (REG_N_SETS (REGNO (x)) == 1
              || reg_last_set_label[REGNO (x)] == label_tick)
          && INSN_CUID (reg_last_set[REGNO (x)]) < subst_low_cuid)
        return reg_last_set_nonzero_bits[REGNO (x)];
@@ -7595,7 +7595,7 @@ num_sign_bit_copies (x, mode)
 
       if (reg_last_set_value[REGNO (x)] != 0
          && reg_last_set_mode[REGNO (x)] == mode
-         && (reg_n_sets[REGNO (x)] == 1
+         && (REG_N_SETS (REGNO (x)) == 1
              || reg_last_set_label[REGNO (x)] == label_tick)
          && INSN_CUID (reg_last_set[REGNO (x)]) < subst_low_cuid)
        return reg_last_set_sign_bit_copies[REGNO (x)];
@@ -8872,7 +8872,7 @@ gen_lowpart_for_combine (mode, x)
       && REGNO (SUBREG_REG (result)) >= FIRST_PSEUDO_REGISTER
       && (GET_MODE_SIZE (GET_MODE (result))
          != GET_MODE_SIZE (GET_MODE (SUBREG_REG (result)))))
-    reg_changes_size[REGNO (SUBREG_REG (result))] = 1;
+    REG_CHANGES_SIZE (REGNO (SUBREG_REG (result))) = 1;
 
   if (result)
     return result;
@@ -10351,7 +10351,7 @@ get_last_value_validate (loc, insn, tick, replace)
        if (reg_last_set_invalid[j]
            /* If this is a pseudo-register that was only set once, it is
               always valid.  */
-           || (! (regno >= FIRST_PSEUDO_REGISTER && reg_n_sets[regno] == 1)
+           || (! (regno >= FIRST_PSEUDO_REGISTER && REG_N_SETS (regno) == 1)
                && reg_last_set_label[j] > tick))
          {
            if (replace)
@@ -10414,7 +10414,7 @@ get_last_value (x)
      return 0.  */
 
   if (value == 0
-      || (reg_n_sets[regno] != 1
+      || (REG_N_SETS (regno) != 1
          && reg_last_set_label[regno] != label_tick))
     return 0;
 
@@ -10746,7 +10746,7 @@ remove_death (regno, insn)
 
   if (note)
     {
-      reg_n_deaths[regno]--;
+      REG_N_DEATHS (regno)--;
       remove_note (insn, note);
     }
 
@@ -10864,7 +10864,7 @@ move_deaths (x, maybe_kill_insn, from_cuid, to_insn, pnotes)
          else
            *pnotes = gen_rtx (EXPR_LIST, REG_DEAD, x, *pnotes);
 
-         reg_n_deaths[regno]++;
+         REG_N_DEATHS (regno)++;
        }
 
       return;
@@ -11163,9 +11163,9 @@ distribute_notes (notes, from_insn, i3, i2, elim_i2, elim_i1)
             special case.  */
 
          if (place == i3 && i2 != 0 && GET_CODE (XEXP (note, 0)) == REG
-             && reg_n_refs[REGNO (XEXP (note, 0))]== 2
+             && REG_N_REFS (REGNO (XEXP (note, 0)))== 2
              && reg_referenced_p (XEXP (note, 0), PATTERN (i2)))
-           reg_n_refs[REGNO (XEXP (note, 0))] = 3;
+           REG_N_REFS (REGNO (XEXP (note, 0))) = 3;
 
          if (place == 0)
            {
@@ -11389,14 +11389,14 @@ distribute_notes (notes, from_insn, i3, i2, elim_i2, elim_i1)
       else if ((REG_NOTE_KIND (note) == REG_DEAD
                || REG_NOTE_KIND (note) == REG_UNUSED)
               && GET_CODE (XEXP (note, 0)) == REG)
-       reg_n_deaths[REGNO (XEXP (note, 0))]--;
+       REG_N_DEATHS (REGNO (XEXP (note, 0)))--;
 
       if (place2)
        {
          if ((REG_NOTE_KIND (note) == REG_DEAD
               || REG_NOTE_KIND (note) == REG_UNUSED)
              && GET_CODE (XEXP (note, 0)) == REG)
-           reg_n_deaths[REGNO (XEXP (note, 0))]++;
+           REG_N_DEATHS (REGNO (XEXP (note, 0)))++;
 
          REG_NOTES (place2) = gen_rtx (GET_CODE (note), REG_NOTE_KIND (note),
                                        XEXP (note, 0), REG_NOTES (place2));
index df64afa..540ecdf 100644 (file)
--- a/gcc/cse.c
+++ b/gcc/cse.c
@@ -873,11 +873,11 @@ make_regs_eqv (new, old)
       && ((new < FIRST_PSEUDO_REGISTER && FIXED_REGNO_P (new))
          || (new >= FIRST_PSEUDO_REGISTER
              && (firstr < FIRST_PSEUDO_REGISTER
-                 || ((uid_cuid[regno_last_uid[new]] > cse_basic_block_end
-                      || (uid_cuid[regno_first_uid[new]]
+                 || ((uid_cuid[REGNO_LAST_UID (new)] > cse_basic_block_end
+                      || (uid_cuid[REGNO_FIRST_UID (new)]
                           < cse_basic_block_start))
-                     && (uid_cuid[regno_last_uid[new]]
-                         > uid_cuid[regno_last_uid[firstr]]))))))
+                     && (uid_cuid[REGNO_LAST_UID (new)]
+                         > uid_cuid[REGNO_LAST_UID (firstr)]))))))
     {
       reg_prev_eqv[firstr] = new;
       reg_next_eqv[new] = firstr;
@@ -6500,7 +6500,7 @@ cse_insn (insn, in_libcall_block)
          && find_reg_note (insn, REG_EQUIV, src) != 0
          && GET_CODE (dest) == REG
          && REGNO (dest) >= FIRST_PSEUDO_REGISTER
-         && reg_n_sets[REGNO (dest)] != 1)
+         && REG_N_SETS (REGNO (dest)) != 1)
        sets[i].src_volatile = 1;
 
 #if 0
index 1e5d265..12a9bf9 100644 (file)
@@ -164,56 +164,9 @@ int max_scratch;
 
 static int num_scratch;
 
-/* Indexed by n, gives number of basic block that  (REG n) is used in.
-   If the value is REG_BLOCK_GLOBAL (-2),
-   it means (REG n) is used in more than one basic block.
-   REG_BLOCK_UNKNOWN (-1) means it hasn't been seen yet so we don't know.
-   This information remains valid for the rest of the compilation
-   of the current function; it is used to control register allocation.  */
+/* Indexed by n, giving various register information */
 
-int *reg_basic_block;
-
-/* Indexed by n, gives number of times (REG n) is used or set, each
-   weighted by its loop-depth.
-   This information remains valid for the rest of the compilation
-   of the current function; it is used to control register allocation.  */
-
-int *reg_n_refs;
-
-/* Indexed by N; says whether a pseudo register N was ever used
-   within a SUBREG that changes the size of the reg.  Some machines prohibit
-   such objects to be in certain (usually floating-point) registers.  */
-
-char *reg_changes_size;
-
-/* Indexed by N, gives number of places register N dies.
-   This information remains valid for the rest of the compilation
-   of the current function; it is used to control register allocation.  */
-
-short *reg_n_deaths;
-
-/* Indexed by N, gives 1 if that reg is live across any CALL_INSNs.
-   This information remains valid for the rest of the compilation
-   of the current function; it is used to control register allocation.  */
-
-int *reg_n_calls_crossed;
-
-/* Total number of instructions at which (REG n) is live.
-   The larger this is, the less priority (REG n) gets for
-   allocation in a real register.
-   This information remains valid for the rest of the compilation
-   of the current function; it is used to control register allocation.
-
-   local-alloc.c may alter this number to change the priority.
-
-   Negative values are special.
-   -1 is used to mark a pseudo reg which has a constant or memory equivalent
-   and is used infrequently enough that it should not get a hard register.
-   -2 is used to mark a pseudo reg for a parameter, when a frame pointer
-   is not required.  global.c makes an allocno for this but does
-   not try to assign a hard register to it.  */
-
-int *reg_live_length;
+reg_info *reg_n_info;
 
 /* Element N is the next insn that uses (hard or pseudo) register number N
    within the current basic block; or zero, if there is no such insn.
@@ -1252,7 +1205,7 @@ life_analysis (f, nregs)
     for (i = FIRST_PSEUDO_REGISTER; i < max_regno; i++)
       if (basic_block_live_at_start[0][i / REGSET_ELT_BITS]
          & ((REGSET_ELT_TYPE) 1 << (i % REGSET_ELT_BITS)))
-       reg_basic_block[i] = REG_BLOCK_GLOBAL;
+       REG_BASIC_BLOCK (i) = REG_BLOCK_GLOBAL;
 
   /* Now the life information is accurate.
      Make one more pass over each basic block
@@ -1288,8 +1241,8 @@ life_analysis (f, nregs)
        & ((REGSET_ELT_TYPE) 1 << (i % REGSET_ELT_BITS))
        && regno_reg_rtx[i] != 0 && ! REG_USERVAR_P (regno_reg_rtx[i]))
       {
-       reg_live_length[i] = -1;
-       reg_basic_block[i] = -1;
+       REG_LIVE_LENGTH (i) = -1;
+       REG_BASIC_BLOCK (i) = -1;
       }
 #endif
 #endif
@@ -1308,8 +1261,8 @@ life_analysis (f, nregs)
         & ((REGSET_ELT_TYPE) 1 << (i % REGSET_ELT_BITS)))
        && regno_reg_rtx[i] != 0)
       {
-       reg_live_length[i] = -1;
-       reg_basic_block[i] = -1;
+       REG_LIVE_LENGTH (i) = -1;
+       REG_BASIC_BLOCK (i) = -1;
       }
 
   obstack_free (&flow_obstack, NULL_PTR);
@@ -1329,27 +1282,14 @@ allocate_for_life_analysis ()
   regset_size = ((max_regno + REGSET_ELT_BITS - 1) / REGSET_ELT_BITS);
   regset_bytes = regset_size * sizeof (*(regset) 0);
 
-  reg_n_refs = (int *) oballoc (max_regno * sizeof (int));
-  bzero ((char *) reg_n_refs, max_regno * sizeof (int));
-
-  reg_n_sets = (short *) oballoc (max_regno * sizeof (short));
-  bzero ((char *) reg_n_sets, max_regno * sizeof (short));
-
-  reg_n_deaths = (short *) oballoc (max_regno * sizeof (short));
-  bzero ((char *) reg_n_deaths, max_regno * sizeof (short));
-
-  reg_changes_size = (char *) oballoc (max_regno * sizeof (char));
-  bzero (reg_changes_size, max_regno * sizeof (char));;
-
-  reg_live_length = (int *) oballoc (max_regno * sizeof (int));
-  bzero ((char *) reg_live_length, max_regno * sizeof (int));
-
-  reg_n_calls_crossed = (int *) oballoc (max_regno * sizeof (int));
-  bzero ((char *) reg_n_calls_crossed, max_regno * sizeof (int));
+  /* Because both reg_scan and flow_analysis want to set up the REG_N_SETS
+     information, explicitly reset it here.  The allocation should have
+     already happened on the previous reg_scan pass.  Make sure in case
+     some more registers were allocated.  */
+  allocate_reg_info (max_regno, FALSE);
 
-  reg_basic_block = (int *) oballoc (max_regno * sizeof (int));
   for (i = 0; i < max_regno; i++)
-    reg_basic_block[i] = REG_BLOCK_UNKNOWN;
+    REG_N_SETS (i) = 0;
 
   basic_block_live_at_start
     = (regset *) oballoc (n_basic_blocks * sizeof (regset));
@@ -1476,7 +1416,7 @@ propagate_block (old, first, last, final, significant, bnum)
              break;
            if (old[offset] & bit)
              {
-               reg_basic_block[i] = REG_BLOCK_GLOBAL;
+               REG_BASIC_BLOCK (i) = REG_BLOCK_GLOBAL;
                regs_sometimes_live[sometimes_max].offset = offset;
                regs_sometimes_live[sometimes_max].bit = i % REGSET_ELT_BITS;
                sometimes_max++;
@@ -1699,7 +1639,7 @@ propagate_block (old, first, last, final, significant, bnum)
 
                  for (i = 0; i < sometimes_max; i++, p++)
                    if (old[p->offset] & ((REGSET_ELT_TYPE) 1 << p->bit))
-                     reg_n_calls_crossed[p->offset * REGSET_ELT_BITS + p->bit]+= 1;
+                     REG_N_CALLS_CROSSED (p->offset * REGSET_ELT_BITS + p->bit)++;
                }
            }
 
@@ -1733,7 +1673,7 @@ propagate_block (old, first, last, final, significant, bnum)
                for (i = 0; i < sometimes_max; i++, p++)
                  {
                    if (old[p->offset] & ((REGSET_ELT_TYPE) 1 << p->bit))
-                     reg_live_length[p->offset * REGSET_ELT_BITS + p->bit]++;
+                     REG_LIVE_LENGTH (p->offset * REGSET_ELT_BITS + p->bit)++;
                  }
              }
            }
@@ -1941,7 +1881,7 @@ regno_clobbered_at_setjmp (regno)
   if (n_basic_blocks == 0)
     return 0;
 
-  return ((reg_n_sets[regno] > 1
+  return ((REG_N_SETS (regno) > 1
           || (basic_block_live_at_start[0][regno / REGSET_ELT_BITS]
               & ((REGSET_ELT_TYPE) 1 << (regno % REGSET_ELT_BITS))))
          && (regs_live_at_setjmp[regno / REGSET_ELT_BITS]
@@ -2098,7 +2038,7 @@ mark_set_1 (needed, dead, x, insn, significant)
                  reg_next_use[i] = 0;
 
                  regs_ever_live[i] = 1;
-                 reg_n_sets[i]++;
+                 REG_N_SETS (i)++;
                }
            }
          else
@@ -2109,22 +2049,22 @@ mark_set_1 (needed, dead, x, insn, significant)
 
              /* Keep track of which basic blocks each reg appears in.  */
 
-             if (reg_basic_block[regno] == REG_BLOCK_UNKNOWN)
-               reg_basic_block[regno] = blocknum;
-             else if (reg_basic_block[regno] != blocknum)
-               reg_basic_block[regno] = REG_BLOCK_GLOBAL;
+             if (REG_BASIC_BLOCK (regno) == REG_BLOCK_UNKNOWN)
+               REG_BASIC_BLOCK (regno) = blocknum;
+             else if (REG_BASIC_BLOCK (regno) != blocknum)
+               REG_BASIC_BLOCK (regno) = REG_BLOCK_GLOBAL;
 
              /* Count (weighted) references, stores, etc.  This counts a
                 register twice if it is modified, but that is correct.  */
-             reg_n_sets[regno]++;
+             REG_N_SETS (regno)++;
 
-             reg_n_refs[regno] += loop_depth;
+             REG_N_REFS (regno) += loop_depth;
                  
              /* The insns where a reg is live are normally counted
                 elsewhere, but we want the count to include the insn
                 where the reg is set, and the normal counting mechanism
                 would not count it.  */
-             reg_live_length[regno]++;
+             REG_LIVE_LENGTH (regno)++;
            }
 
          if (! some_not_needed)
@@ -2152,7 +2092,7 @@ mark_set_1 (needed, dead, x, insn, significant)
                 Indicate this by marking the reg being set as dying here.  */
              REG_NOTES (insn)
                = gen_rtx (EXPR_LIST, REG_UNUSED, reg, REG_NOTES (insn));
-             reg_n_deaths[REGNO (reg)]++;
+             REG_N_DEATHS (REGNO (reg))++;
            }
          else
            {
@@ -2338,7 +2278,7 @@ find_auto_inc (needed, x, insn)
                 that REGNO now crosses them.  */
              for (temp = insn; temp != incr; temp = NEXT_INSN (temp))
                if (GET_CODE (temp) == CALL_INSN)
-                 reg_n_calls_crossed[regno]++;
+                 REG_N_CALLS_CROSSED (regno)++;
            }
          else
            return;
@@ -2370,11 +2310,11 @@ find_auto_inc (needed, x, insn)
              /* Count an extra reference to the reg.  When a reg is
                 incremented, spilling it is worse, so we want to make
                 that less likely.  */
-             reg_n_refs[regno] += loop_depth;
+             REG_N_REFS (regno) += loop_depth;
 
              /* Count the increment as a setting of the register,
                 even though it isn't a SET in rtl.  */
-             reg_n_sets[regno]++;
+             REG_N_SETS (regno)++;
            }
        }
     }
@@ -2447,7 +2387,7 @@ mark_used_regs (needed, live, x, final, insn)
          && REGNO (SUBREG_REG (x)) >= FIRST_PSEUDO_REGISTER
          && (GET_MODE_SIZE (GET_MODE (x))
              != GET_MODE_SIZE (GET_MODE (SUBREG_REG (x)))))
-       reg_changes_size[REGNO (SUBREG_REG (x))] = 1;
+       REG_CHANGES_SIZE (REGNO (SUBREG_REG (x))) = 1;
 
       /* While we're here, optimize this case.  */
       x = SUBREG_REG (x);
@@ -2549,14 +2489,14 @@ mark_used_regs (needed, live, x, final, insn)
 
                register int blocknum = BLOCK_NUM (insn);
 
-               if (reg_basic_block[regno] == REG_BLOCK_UNKNOWN)
-                 reg_basic_block[regno] = blocknum;
-               else if (reg_basic_block[regno] != blocknum)
-                 reg_basic_block[regno] = REG_BLOCK_GLOBAL;
+               if (REG_BASIC_BLOCK (regno) == REG_BLOCK_UNKNOWN)
+                 REG_BASIC_BLOCK (regno) = blocknum;
+               else if (REG_BASIC_BLOCK (regno) != blocknum)
+                 REG_BASIC_BLOCK (regno) = REG_BLOCK_GLOBAL;
 
                /* Count (weighted) number of uses of each reg.  */
 
-               reg_n_refs[regno] += loop_depth;
+               REG_N_REFS (regno) += loop_depth;
              }
 
            /* Record and count the insns in which a reg dies.
@@ -2588,7 +2528,7 @@ mark_used_regs (needed, live, x, final, insn)
                  {
                    REG_NOTES (insn)
                      = gen_rtx (EXPR_LIST, REG_DEAD, x, REG_NOTES (insn));
-                   reg_n_deaths[regno]++;
+                   REG_N_DEATHS (regno)++;
                  }
                else
                  {
@@ -2649,7 +2589,7 @@ mark_used_regs (needed, live, x, final, insn)
                && REGNO (SUBREG_REG (testreg)) >= FIRST_PSEUDO_REGISTER
                && (GET_MODE_SIZE (GET_MODE (testreg))
                    != GET_MODE_SIZE (GET_MODE (SUBREG_REG (testreg)))))
-             reg_changes_size[REGNO (SUBREG_REG (testreg))] = 1;
+             REG_CHANGES_SIZE (REGNO (SUBREG_REG (testreg))) = 1;
 
            /* Modifying a single register in an alternate mode
               does not use any of the old value.  But these other
@@ -2770,8 +2710,8 @@ try_pre_increment_1 (insn)
         less likely.  */
       if (regno >= FIRST_PSEUDO_REGISTER)
        {
-         reg_n_refs[regno] += loop_depth;
-         reg_n_sets[regno]++;
+         REG_N_REFS (regno) += loop_depth;
+         REG_N_SETS (regno)++;
        }
       return 1;
     }
@@ -2944,19 +2884,19 @@ dump_flow_info (file)
   fprintf (file, "%d registers.\n", max_regno);
 
   for (i = FIRST_PSEUDO_REGISTER; i < max_regno; i++)
-    if (reg_n_refs[i])
+    if (REG_N_REFS (i))
       {
        enum reg_class class, altclass;
        fprintf (file, "\nRegister %d used %d times across %d insns",
-                i, reg_n_refs[i], reg_live_length[i]);
-       if (reg_basic_block[i] >= 0)
-         fprintf (file, " in block %d", reg_basic_block[i]);
-       if (reg_n_deaths[i] != 1)
-         fprintf (file, "; dies in %d places", reg_n_deaths[i]);
-       if (reg_n_calls_crossed[i] == 1)
+                i, REG_N_REFS (i), REG_LIVE_LENGTH (i));
+       if (REG_BASIC_BLOCK (i) >= 0)
+         fprintf (file, " in block %d", REG_BASIC_BLOCK (i));
+       if (REG_N_DEATHS (i) != 1)
+         fprintf (file, "; dies in %d places", REG_N_DEATHS (i));
+       if (REG_N_CALLS_CROSSED (i) == 1)
          fprintf (file, "; crosses 1 call");
-       else if (reg_n_calls_crossed[i])
-         fprintf (file, "; crosses %d calls", reg_n_calls_crossed[i]);
+       else if (REG_N_CALLS_CROSSED (i))
+         fprintf (file, "; crosses %d calls", REG_N_CALLS_CROSSED (i));
        if (PSEUDO_REGNO_BYTES (i) != UNITS_PER_WORD)
          fprintf (file, "; %d bytes", PSEUDO_REGNO_BYTES (i));
        class = reg_preferred_class (i);
index a4f5ab1..ed2f9ea 100644 (file)
@@ -385,17 +385,17 @@ global_alloc (file)
     /* Note that reg_live_length[i] < 0 indicates a "constant" reg
        that we are supposed to refrain from putting in a hard reg.
        -2 means do make an allocno but don't allocate it.  */
-    if (reg_n_refs[i] != 0 && reg_renumber[i] < 0 && reg_live_length[i] != -1
+    if (REG_N_REFS (i) != 0 && reg_renumber[i] < 0 && REG_LIVE_LENGTH (i) != -1
        /* Don't allocate pseudos that cross calls,
           if this function receives a nonlocal goto.  */
        && (! current_function_has_nonlocal_label
-           || reg_n_calls_crossed[i] == 0))
+           || REG_N_CALLS_CROSSED (i) == 0))
       {
        if (reg_may_share[i] && reg_allocno[reg_may_share[i]] >= 0)
          reg_allocno[i] = reg_allocno[reg_may_share[i]];
        else
          reg_allocno[i] = max_allocno++;
-       if (reg_live_length[i] == 0)
+       if (REG_LIVE_LENGTH (i) == 0)
          abort ();
       }
     else
@@ -417,10 +417,10 @@ global_alloc (file)
        int allocno = reg_allocno[i];
        allocno_reg[allocno] = i;
        allocno_size[allocno] = PSEUDO_REGNO_SIZE (i);
-       allocno_calls_crossed[allocno] += reg_n_calls_crossed[i];
-       allocno_n_refs[allocno] += reg_n_refs[i];
-       if (allocno_live_length[allocno] < reg_live_length[i])
-         allocno_live_length[allocno] = reg_live_length[i];
+       allocno_calls_crossed[allocno] += REG_N_CALLS_CROSSED (i);
+       allocno_n_refs[allocno] += REG_N_REFS (i);
+       if (allocno_live_length[allocno] < REG_LIVE_LENGTH (i))
+         allocno_live_length[allocno] = REG_LIVE_LENGTH (i);
       }
 
   /* Calculate amount of usage of each hard reg by pseudos
@@ -437,8 +437,8 @@ global_alloc (file)
 
        for (j = regno; j < endregno; j++)
          {
-           local_reg_n_refs[j] += reg_n_refs[i];
-           local_reg_live_length[j] += reg_live_length[i];
+           local_reg_n_refs[j] += REG_N_REFS (i);
+           local_reg_live_length[j] += REG_LIVE_LENGTH (i);
          }
       }
 
@@ -554,7 +554,7 @@ global_alloc (file)
         except for parameters marked with reg_live_length[regno] == -2.  */
 
       for (i = 0; i < max_allocno; i++)
-       if (reg_live_length[allocno_reg[allocno_order[i]]] >= 0)
+       if (REG_LIVE_LENGTH (allocno_reg[allocno_order[i]]) >= 0)
          {
            /* If we have more than one register class,
               first try allocating in the class that is cheapest
@@ -940,7 +940,7 @@ find_reg (allocno, losers, alt_regs_p, accept_call_clobbered, retrying)
   IOR_HARD_REG_SET (used1, hard_reg_conflicts[allocno]);
 
 #ifdef CLASS_CANNOT_CHANGE_SIZE
-  if (reg_changes_size[allocno_reg[allocno]])
+  if (REG_CHANGES_SIZE (allocno_reg[allocno]))
     IOR_HARD_REG_SET (used1,
                      reg_class_contents[(int) CLASS_CANNOT_CHANGE_SIZE]);
 #endif
@@ -1127,7 +1127,7 @@ find_reg (allocno, losers, alt_regs_p, accept_call_clobbered, retrying)
              && ! TEST_HARD_REG_BIT (used2, regno)
              && HARD_REGNO_MODE_OK (regno, mode)
 #ifdef CLASS_CANNOT_CHANGE_SIZE
-             && ! (reg_changes_size[allocno_reg[allocno]]
+             && ! (REG_CHANGES_SIZE (allocno_reg[allocno])
                    && (TEST_HARD_REG_BIT
                        (reg_class_contents[(int) CLASS_CANNOT_CHANGE_SIZE],
                         regno)))
index 316e741..b277863 100644 (file)
@@ -570,11 +570,11 @@ jump_optimize (f, cross_jump, noop_moves, after_regscan)
 
        if (set && GET_CODE (SET_DEST (set)) == REG
            && REGNO (SET_DEST (set)) >= FIRST_PSEUDO_REGISTER
-           && regno_first_uid[REGNO (SET_DEST (set))] == INSN_UID (insn)
+           && REGNO_FIRST_UID (REGNO (SET_DEST (set))) == INSN_UID (insn)
            /* We use regno_last_note_uid so as not to delete the setting
               of a reg that's used in notes.  A subsequent optimization
               might arrange to use that reg for real.  */             
-           && regno_last_note_uid[REGNO (SET_DEST (set))] == INSN_UID (insn)
+           && REGNO_LAST_NOTE_UID (REGNO (SET_DEST (set))) == INSN_UID (insn)
            && ! side_effects_p (SET_SRC (set))
            && ! find_reg_note (insn, REG_RETVAL, 0))
          delete_insn (insn);
@@ -1085,8 +1085,8 @@ jump_optimize (f, cross_jump, noop_moves, after_regscan)
                       && (temp5 = SUBREG_REG (temp5),
                           GET_CODE (temp5) == REG))))
              && REGNO (temp5) >= FIRST_PSEUDO_REGISTER
-             && regno_first_uid[REGNO (temp5)] == INSN_UID (temp)
-             && regno_last_uid[REGNO (temp5)] == INSN_UID (temp3)
+             && REGNO_FIRST_UID (REGNO (temp5)) == INSN_UID (temp)
+             && REGNO_LAST_UID (REGNO (temp5)) == INSN_UID (temp3)
              && ! side_effects_p (SET_SRC (temp1))
              && ! may_trap_p (SET_SRC (temp1))
              && rtx_cost (SET_SRC (temp1), SET) < 10
@@ -2353,10 +2353,10 @@ duplicate_loop_exit_test (loop_start)
            || (GET_CODE (reg) == SUBREG
                && (reg = SUBREG_REG (reg), GET_CODE (reg) == REG)))
        && REGNO (reg) >= FIRST_PSEUDO_REGISTER
-       && regno_first_uid[REGNO (reg)] == INSN_UID (insn))
+       && REGNO_FIRST_UID (REGNO (reg)) == INSN_UID (insn))
       {
        for (p = NEXT_INSN (insn); p != lastexit; p = NEXT_INSN (p))
-         if (regno_last_uid[REGNO (reg)] == INSN_UID (p))
+         if (REGNO_LAST_UID (REGNO (reg)) == INSN_UID (p))
            break;
 
        if (p != lastexit)
@@ -4592,7 +4592,7 @@ rtx_equal_for_thread_p (x, y, yinsn)
          /* If this is the first time we are seeing a register on the `Y'
             side, see if it is the last use.  If not, we can't thread the 
             jump, so mark it as not equivalent.  */
-         if (regno_last_uid[REGNO (y)] != INSN_UID (yinsn))
+         if (REGNO_LAST_UID (REGNO (y)) != INSN_UID (yinsn))
            return 0;
 
          return 1;
index 8e75aa8..8b36f5f 100644 (file)
@@ -291,11 +291,11 @@ alloc_qty (regno, mode, size, birth)
   qty_size[qty] = size;
   qty_mode[qty] = mode;
   qty_birth[qty] = birth;
-  qty_n_calls_crossed[qty] = reg_n_calls_crossed[regno];
+  qty_n_calls_crossed[qty] = REG_N_CALLS_CROSSED (regno);
   qty_min_class[qty] = reg_preferred_class (regno);
   qty_alternate_class[qty] = reg_alternate_class (regno);
-  qty_n_refs[qty] = reg_n_refs[regno];
-  qty_changes_size[qty] = reg_changes_size[regno];
+  qty_n_refs[qty] = REG_N_REFS (regno);
+  qty_changes_size[qty] = REG_CHANGES_SIZE (regno);
 }
 \f
 /* Similar to `alloc_qty', but allocates a quantity for a SCRATCH rtx
@@ -469,7 +469,7 @@ local_alloc ()
 
   for (i = FIRST_PSEUDO_REGISTER; i < max_regno; i++)
     {
-      if (reg_basic_block[i] >= 0 && reg_n_deaths[i] == 1
+      if (REG_BASIC_BLOCK (i) >= 0 && REG_N_DEATHS (i) == 1
          && (reg_alternate_class (i) == NO_REGS
              || ! CLASS_LIKELY_SPILLED_P (reg_preferred_class (i))))
        reg_qty[i] = -2;
@@ -784,9 +784,9 @@ optimize_reg_copy_1 (insn, dest, src)
                         insn in the updates below.  If this is not correct,
                         no great harm is done.  */
                      if (sregno >= FIRST_PSEUDO_REGISTER)
-                       reg_n_refs[sregno] -= loop_depth;
+                       REG_N_REFS (sregno) -= loop_depth;
                      if (dregno >= FIRST_PSEUDO_REGISTER)
-                       reg_n_refs[dregno] += loop_depth;
+                       REG_N_REFS (dregno) += loop_depth;
                    }
                  else
                    {
@@ -823,25 +823,25 @@ optimize_reg_copy_1 (insn, dest, src)
            {
              if (sregno >= FIRST_PSEUDO_REGISTER)
                {
-                 if (reg_live_length[sregno] >= 0)
+                 if (REG_LIVE_LENGTH (sregno) >= 0)
                    {
-                     reg_live_length[sregno] -= length;
+                     REG_LIVE_LENGTH (sregno) -= length;
                      /* reg_live_length is only an approximation after
                         combine if sched is not run, so make sure that we
                         still have a reasonable value.  */
-                     if (reg_live_length[sregno] < 2)
-                       reg_live_length[sregno] = 2;
+                     if (REG_LIVE_LENGTH (sregno) < 2)
+                       REG_LIVE_LENGTH (sregno) = 2;
                    }
 
-                 reg_n_calls_crossed[sregno] -= n_calls;
+                 REG_N_CALLS_CROSSED (sregno) -= n_calls;
                }
 
              if (dregno >= FIRST_PSEUDO_REGISTER)
                {
-                 if (reg_live_length[dregno] >= 0)
-                   reg_live_length[dregno] += d_length;
+                 if (REG_LIVE_LENGTH (dregno) >= 0)
+                   REG_LIVE_LENGTH (dregno) += d_length;
 
-                 reg_n_calls_crossed[dregno] += d_n_calls;
+                 REG_N_CALLS_CROSSED (dregno) += d_n_calls;
                }
 
              /* Move death note of SRC from P to INSN.  */
@@ -922,28 +922,28 @@ optimize_reg_copy_2 (insn, dest, src)
                    /* We assume that a register is used exactly once per
                       insn in the updates below.  If this is not correct,
                       no great harm is done.  */
-                   reg_n_refs[dregno] -= loop_depth;
-                   reg_n_refs[sregno] += loop_depth;
+                   REG_N_REFS (dregno) -= loop_depth;
+                   REG_N_REFS (sregno) += loop_depth;
                  }
 
 
              if (GET_CODE (q) == CALL_INSN)
                {
-                 reg_n_calls_crossed[dregno]--;
-                 reg_n_calls_crossed[sregno]++;
+                 REG_N_CALLS_CROSSED (dregno)--;
+                 REG_N_CALLS_CROSSED (sregno)++;
                }
              }
 
          remove_note (p, find_reg_note (p, REG_DEAD, dest));
-         reg_n_deaths[dregno]--;
+         REG_N_DEATHS (dregno)--;
          remove_note (insn, find_reg_note (insn, REG_DEAD, src));
-         reg_n_deaths[sregno]--;
+         REG_N_DEATHS (sregno)--;
          return;
        }
 
       if (reg_set_p (src, p)
          || find_reg_note (p, REG_DEAD, dest)
-         || (GET_CODE (p) == CALL_INSN && reg_n_calls_crossed[sregno] == 0))
+         || (GET_CODE (p) == CALL_INSN && REG_N_CALLS_CROSSED (sregno) == 0))
        break;
     }
 }
@@ -1010,7 +1010,7 @@ update_equiv_regs ()
 
       if (GET_CODE (dest) == MEM && GET_CODE (SET_SRC (set)) == REG
          && (regno = REGNO (SET_SRC (set))) >= FIRST_PSEUDO_REGISTER
-         && reg_basic_block[regno] >= 0
+         && REG_BASIC_BLOCK (regno) >= 0
          && reg_equiv_init_insn[regno] != 0
          && validate_equiv_mem (reg_equiv_init_insn[regno], SET_SRC (set),
                                 dest)
@@ -1040,7 +1040,7 @@ update_equiv_regs ()
         in a register class that's likely to be spilled.  */
       if (GET_CODE (dest) != REG
          || (regno = REGNO (dest)) < FIRST_PSEUDO_REGISTER
-         || reg_n_sets[regno] != 1
+         || REG_N_SETS (regno) != 1
          || CLASS_LIKELY_SPILLED_P (reg_preferred_class (REGNO (dest)))
          || (GET_CODE (src) == REG
              && REGNO (src) >= FIRST_PSEUDO_REGISTER
@@ -1074,7 +1074,7 @@ update_equiv_regs ()
         
       note = find_reg_note (insn, REG_EQUIV, NULL_RTX);
 
-      if (note == 0 && reg_basic_block[regno] >= 0
+      if (note == 0 && REG_BASIC_BLOCK (regno) >= 0
          && GET_CODE (SET_SRC (set)) == MEM
          && validate_equiv_mem (insn, dest, SET_SRC (set)))
        REG_NOTES (insn) = note = gen_rtx (EXPR_LIST, REG_EQUIV, SET_SRC (set),
@@ -1087,11 +1087,11 @@ update_equiv_regs ()
          reg_equiv_replacement[regno] = XEXP (note, 0);
 
          /* Don't mess with things live during setjmp.  */
-         if (reg_live_length[regno] >= 0)
+         if (REG_LIVE_LENGTH (regno) >= 0)
            {
              /* Note that the statement below does not affect the priority
                 in local-alloc!  */
-             reg_live_length[regno] *= 2;
+             REG_LIVE_LENGTH (regno) *= 2;
 
 
              /* If the register is referenced exactly twice, meaning it is
@@ -1107,8 +1107,8 @@ update_equiv_regs ()
                 This case normally occurs when a parameter is read from
                 memory and then used exactly once, not in a loop.  */
 
-               if (reg_n_refs[regno] == 2
-                   && reg_basic_block[regno] < 0
+               if (REG_N_REFS (regno) == 2
+                   && REG_BASIC_BLOCK (regno) < 0
                    && rtx_equal_p (XEXP (note, 0), SET_SRC (set)))
                  reg_equiv_replace[regno] = 1;
            }
@@ -1168,7 +1168,7 @@ update_equiv_regs ()
                                        reg_equiv_replacement[regno], insn))
                {
                  remove_death (regno, insn);
-                 reg_n_refs[regno] = 0;
+                 REG_N_REFS (regno) = 0;
                  PUT_CODE (equiv_insn, NOTE);
                  NOTE_LINE_NUMBER (equiv_insn) = NOTE_INSN_DELETED;
                  NOTE_SOURCE_FILE (equiv_insn) = 0;
@@ -1180,7 +1180,7 @@ update_equiv_regs ()
              else if (depth == 0
                       && GET_CODE (equiv_insn) == INSN
                       && GET_CODE (insn) == INSN
-                      && reg_basic_block[regno] < 0)
+                      && REG_BASIC_BLOCK (regno) < 0)
                {
                  int l, offset;
                  REGSET_ELT_TYPE bit;
@@ -1194,11 +1194,11 @@ update_equiv_regs ()
                  REG_NOTES (equiv_insn) = 0;
 
                  if (block < 0)
-                   reg_basic_block[regno] = 0;
+                   REG_BASIC_BLOCK (regno) = 0;
                  else
-                   reg_basic_block[regno] = block;
-                 reg_n_calls_crossed[regno] = 0;
-                 reg_live_length[regno] = 2;
+                   REG_BASIC_BLOCK (regno) = block;
+                 REG_N_CALLS_CROSSED (regno) = 0;
+                 REG_LIVE_LENGTH (regno) = 2;
 
                  if (block >= 0 && insn == basic_block_head[block])
                    basic_block_head[block] = PREV_INSN (insn);
@@ -1902,8 +1902,8 @@ combine_regs (usedreg, setreg, may_save_copy, insn_number, insn, already_dead)
       /* If we are not going to let any regs live across calls,
         don't tie a call-crossing reg to a non-call-crossing reg.  */
       || (current_function_has_nonlocal_label
-         && ((reg_n_calls_crossed[ureg] > 0)
-             != (reg_n_calls_crossed[sreg] > 0))))
+         && ((REG_N_CALLS_CROSSED (ureg) > 0)
+             != (REG_N_CALLS_CROSSED (sreg) > 0))))
     return 0;
 
   /* We don't already know about SREG, so tie it to UREG
@@ -1924,8 +1924,8 @@ combine_regs (usedreg, setreg, may_save_copy, insn_number, insn, already_dead)
       update_qty_class (sqty, sreg);
 
       /* Update info about quantity SQTY.  */
-      qty_n_calls_crossed[sqty] += reg_n_calls_crossed[sreg];
-      qty_n_refs[sqty] += reg_n_refs[sreg];
+      qty_n_calls_crossed[sqty] += REG_N_CALLS_CROSSED (sreg);
+      qty_n_refs[sqty] += REG_N_REFS (sreg);
       if (usize < ssize)
        {
          register int i;
@@ -1995,7 +1995,7 @@ update_qty_class (qty, reg)
   if (reg_class_subset_p (rclass, qty_alternate_class[qty]))
     qty_alternate_class[qty] = rclass;
 
-  if (reg_changes_size[reg])
+  if (REG_CHANGES_SIZE (reg))
     qty_changes_size[qty] = 1;
 }
 \f
index 1c2cbc2..fd7c289 100644 (file)
@@ -735,8 +735,8 @@ scan_loop (loop_start, end, nregs)
 
              if (reg_single_usage && reg_single_usage[regno] != 0
                  && reg_single_usage[regno] != const0_rtx
-                 && regno_first_uid[regno] == INSN_UID (p)
-                 && (regno_last_uid[regno]
+                 && REGNO_FIRST_UID (regno) == INSN_UID (p)
+                 && (REGNO_LAST_UID (regno)
                      == INSN_UID (reg_single_usage[regno]))
                  && n_times_set[REGNO (SET_DEST (set))] == 1
                  && ! side_effects_p (SET_SRC (set))
@@ -787,11 +787,11 @@ scan_loop (loop_start, end, nregs)
              /* Set M->cond if either invariant_p or consec_sets_invariant_p
                 returned 2 (only conditionally invariant).  */
              m->cond = ((tem | tem1 | tem2) > 1);
-             m->global = (uid_luid[regno_last_uid[regno]] > INSN_LUID (end)
-                          || uid_luid[regno_first_uid[regno]] < INSN_LUID (loop_start));
+             m->global = (uid_luid[REGNO_LAST_UID (regno)] > INSN_LUID (end)
+                          || uid_luid[REGNO_FIRST_UID (regno)] < INSN_LUID (loop_start));
              m->match = 0;
-             m->lifetime = (uid_luid[regno_last_uid[regno]]
-                            - uid_luid[regno_first_uid[regno]]);
+             m->lifetime = (uid_luid[REGNO_LAST_UID (regno)]
+                            - uid_luid[REGNO_FIRST_UID (regno)]);
              m->savings = n_times_used[regno];
              if (find_reg_note (p, REG_RETVAL, NULL_RTX))
                m->savings += libcall_benefit (p);
@@ -881,12 +881,12 @@ scan_loop (loop_start, end, nregs)
                     INSN_LUID and hence must make a conservative
                     assumption.  */
                  m->global = (INSN_UID (p) >= max_uid_for_loop
-                              || (uid_luid[regno_last_uid[regno]]
+                              || (uid_luid[REGNO_LAST_UID (regno)]
                                   > INSN_LUID (end))
-                              || (uid_luid[regno_first_uid[regno]]
+                              || (uid_luid[REGNO_FIRST_UID (regno)]
                                   < INSN_LUID (p))
                               || (labels_in_range_p
-                                  (p, uid_luid[regno_first_uid[regno]])));
+                                  (p, uid_luid[REGNO_FIRST_UID (regno)])));
                  if (maybe_never && m->global)
                    m->savemode = GET_MODE (SET_SRC (set1));
                  else
@@ -894,8 +894,8 @@ scan_loop (loop_start, end, nregs)
                  m->regno = regno;
                  m->cond = 0;
                  m->match = 0;
-                 m->lifetime = (uid_luid[regno_last_uid[regno]]
-                                - uid_luid[regno_first_uid[regno]]);
+                 m->lifetime = (uid_luid[REGNO_LAST_UID (regno)]
+                                - uid_luid[REGNO_FIRST_UID (regno)]);
                  m->savings = 1;
                  n_times_set[regno] = -1;
                  /* Add M to the end of the chain MOVABLES.  */
@@ -1066,7 +1066,7 @@ reg_in_basic_block_p (insn, reg)
   int regno = REGNO (reg);
   rtx p;
 
-  if (regno_first_uid[regno] != INSN_UID (insn))
+  if (REGNO_FIRST_UID (regno) != INSN_UID (insn))
     return 0;
 
   /* Search this basic block for the already recorded last use of the reg.  */
@@ -1080,13 +1080,13 @@ reg_in_basic_block_p (insn, reg)
        case INSN:
        case CALL_INSN:
          /* Ordinary insn: if this is the last use, we win.  */
-         if (regno_last_uid[regno] == INSN_UID (p))
+         if (REGNO_LAST_UID (regno) == INSN_UID (p))
            return 1;
          break;
 
        case JUMP_INSN:
          /* Jump insn: if this is the last use, we win.  */
-         if (regno_last_uid[regno] == INSN_UID (p))
+         if (REGNO_LAST_UID (regno) == INSN_UID (p))
            return 1;
          /* Otherwise, it's the end of the basic block, so we lose.  */
          return 0;
@@ -1207,7 +1207,7 @@ force_movables (movables)
             this insn M->insn might not be where it dies.
             But very likely this doesn't matter; what matters is
             that M's reg is computed from M1's reg.  */
-         if (INSN_UID (m->insn) == regno_last_uid[regno]
+         if (INSN_UID (m->insn) == REGNO_LAST_UID (regno)
              && !m->done)
            break;
        if (m != 0 && m->set_src == m1->set_dest
@@ -1304,8 +1304,8 @@ combine_movables (movables, nregs)
            && mode == GET_MODE (SET_SRC (PATTERN (NEXT_INSN (m->insn)))))
          {
            register struct movable *m1;
-           int first = uid_luid[regno_first_uid[m->regno]];
-           int last = uid_luid[regno_last_uid[m->regno]];
+           int first = uid_luid[REGNO_FIRST_UID (m->regno)];
+           int last = uid_luid[REGNO_LAST_UID (m->regno)];
 
            if (m0 == 0)
              {
@@ -1323,8 +1323,8 @@ combine_movables (movables, nregs)
               already combined together.  */
            for (m1 = movables; m1 != m; m1 = m1->next)
              if (m1 == m0 || (m1->partial && m1->match == m0))
-               if (! (uid_luid[regno_first_uid[m1->regno]] > last
-                      || uid_luid[regno_last_uid[m1->regno]] < first))
+               if (! (uid_luid[REGNO_FIRST_UID (m1->regno)] > last
+                      || uid_luid[REGNO_LAST_UID (m1->regno)] < first))
                  goto overlap;
 
            /* No overlap: we can combine this with the others.  */
@@ -1922,13 +1922,13 @@ move_movables (movables, threshold, insn_count, loop_start, end, nregs)
                 to say it lives at least the full length of this loop.
                 This will help guide optimizations in outer loops.  */
 
-             if (uid_luid[regno_first_uid[regno]] > INSN_LUID (loop_start))
+             if (uid_luid[REGNO_FIRST_UID (regno)] > INSN_LUID (loop_start))
                /* This is the old insn before all the moved insns.
                   We can't use the moved insn because it is out of range
                   in uid_luid.  Only the old insns have luids.  */
-               regno_first_uid[regno] = INSN_UID (loop_start);
-             if (uid_luid[regno_last_uid[regno]] < INSN_LUID (end))
-               regno_last_uid[regno] = INSN_UID (end);
+               REGNO_FIRST_UID (regno) = INSN_UID (loop_start);
+             if (uid_luid[REGNO_LAST_UID (regno)] < INSN_LUID (end))
+               REGNO_LAST_UID (regno) = INSN_UID (end);
 
              /* Combine with this moved insn any other matching movables.  */
 
@@ -3785,10 +3785,10 @@ strength_reduce (scan_start, end, loop_top, insn_count,
         long as init_insn doesn't use the biv itself.
         March 14, 1989 -- self@bayes.arc.nasa.gov */
 
-      if ((uid_luid[regno_last_uid[bl->regno]] < INSN_LUID (loop_end)
+      if ((uid_luid[REGNO_LAST_UID (bl->regno)] < INSN_LUID (loop_end)
           && bl->init_insn
           && INSN_UID (bl->init_insn) < max_uid_for_loop
-          && uid_luid[regno_first_uid[bl->regno]] >= INSN_LUID (bl->init_insn)
+          && uid_luid[REGNO_FIRST_UID (bl->regno)] >= INSN_LUID (bl->init_insn)
 #ifdef HAVE_decrement_and_branch_until_zero
           && ! bl->nonneg
 #endif
@@ -3809,8 +3809,8 @@ strength_reduce (scan_start, end, loop_top, insn_count,
                       bl->regno);
              fprintf (loop_dump_stream,
                       "First use: insn %d, last use: insn %d.\n",
-                      regno_first_uid[bl->regno],
-                      regno_last_uid[bl->regno]);
+                      REGNO_FIRST_UID (bl->regno),
+                      REGNO_LAST_UID (bl->regno));
            }
        }
 
@@ -3961,7 +3961,7 @@ strength_reduce (scan_start, end, loop_top, insn_count,
                              other_giv = tv;
                          }
                      if (! tv && other_giv
-                         && (regno_last_uid[REGNO (other_giv->dest_reg)]
+                         && (REGNO_LAST_UID (REGNO (other_giv->dest_reg))
                              == INSN_UID (v->insn))
                          && INSN_LUID (v->insn) < INSN_LUID (bl->biv->insn))
                        auto_inc_opt = 1;
@@ -4042,12 +4042,12 @@ strength_reduce (scan_start, end, loop_top, insn_count,
            continue;
 
          if (v->giv_type == DEST_REG
-             && regno_first_uid[REGNO (v->dest_reg)] == INSN_UID (v->insn))
+             && REGNO_FIRST_UID (REGNO (v->dest_reg)) == INSN_UID (v->insn))
            {
              struct induction *v1;
 
              for (v1 = bl->giv; v1; v1 = v1->next_iv)
-               if (regno_last_uid[REGNO (v->dest_reg)] == INSN_UID (v1->insn))
+               if (REGNO_LAST_UID (REGNO (v->dest_reg)) == INSN_UID (v1->insn))
                  v->maybe_dead = 1;
            }
 
@@ -4548,8 +4548,8 @@ record_giv (v, insn, src_reg, dest_reg, mult_val, add_val, benefit,
     {
       v->mode = GET_MODE (SET_DEST (set));
 
-      v->lifetime = (uid_luid[regno_last_uid[REGNO (dest_reg)]]
-                    - uid_luid[regno_first_uid[REGNO (dest_reg)]]);
+      v->lifetime = (uid_luid[REGNO_LAST_UID (REGNO (dest_reg))]
+                    - uid_luid[REGNO_FIRST_UID (REGNO (dest_reg))]);
 
       v->times_used = n_times_used[REGNO (dest_reg)];
 
@@ -4594,9 +4594,9 @@ record_giv (v, insn, src_reg, dest_reg, mult_val, add_val, benefit,
         - the giv is not used outside the loop
         - no assignments to the biv occur during the giv's lifetime.  */
 
-      if (regno_first_uid[REGNO (dest_reg)] == INSN_UID (insn)
+      if (REGNO_FIRST_UID (REGNO (dest_reg)) == INSN_UID (insn)
          /* Previous line always fails if INSN was moved by loop opt.  */
-         && uid_luid[regno_last_uid[REGNO (dest_reg)]] < INSN_LUID (loop_end)
+         && uid_luid[REGNO_LAST_UID (REGNO (dest_reg))] < INSN_LUID (loop_end)
          && (! not_every_iteration
              || last_use_this_basic_block (dest_reg, insn)))
        {
@@ -4619,9 +4619,9 @@ record_giv (v, insn, src_reg, dest_reg, mult_val, add_val, benefit,
            {
              if (INSN_UID (b->insn) >= max_uid_for_loop
                  || ((uid_luid[INSN_UID (b->insn)]
-                      >= uid_luid[regno_first_uid[REGNO (dest_reg)]])
+                      >= uid_luid[REGNO_FIRST_UID (REGNO (dest_reg))])
                      && (uid_luid[INSN_UID (b->insn)]
-                         <= uid_luid[regno_last_uid[REGNO (dest_reg)]])))
+                         <= uid_luid[REGNO_LAST_UID (REGNO (dest_reg))])))
                {
                  v->replaceable = 0;
                  v->not_replaceable = 1;
@@ -6097,10 +6097,10 @@ check_dbra_loop (loop_end, insn_count, loop_start)
 
              /* Emit an insn after the end of the loop to set the biv's
                 proper exit value if it is used anywhere outside the loop.  */
-             if ((regno_last_uid[bl->regno]
+             if ((REGNO_LAST_UID (bl->regno)
                   != INSN_UID (PREV_INSN (PREV_INSN (loop_end))))
                  || ! bl->init_insn
-                 || regno_first_uid[bl->regno] != INSN_UID (bl->init_insn))
+                 || REGNO_FIRST_UID (bl->regno) != INSN_UID (bl->init_insn))
                emit_insn_after (gen_move_insn (reg, final_value),
                                 loop_end);
 
@@ -6612,7 +6612,7 @@ last_use_this_basic_block (reg, insn)
        n && GET_CODE (n) != CODE_LABEL && GET_CODE (n) != JUMP_INSN;
        n = NEXT_INSN (n))
     {
-      if (regno_last_uid[REGNO (reg)] == INSN_UID (n))
+      if (REGNO_LAST_UID (REGNO (reg)) == INSN_UID (n))
        return 1;
     }
   return 0;
@@ -6659,8 +6659,8 @@ update_reg_last_use (x, insn)
      and hence this insn will never be the last use of x.  */
   if (GET_CODE (x) == REG && REGNO (x) < max_reg_before_loop
       && INSN_UID (insn) < max_uid_for_loop
-      && uid_luid[regno_last_uid[REGNO (x)]] < uid_luid[INSN_UID (insn)])
-    regno_last_uid[REGNO (x)] = INSN_UID (insn);
+      && uid_luid[REGNO_LAST_UID (REGNO (x))] < uid_luid[INSN_UID (insn)])
+    REGNO_LAST_UID (REGNO (x)) = INSN_UID (insn);
   else
     {
       register int i, j;
index f562472..2f73a3d 100644 (file)
@@ -163,15 +163,6 @@ char *reg_names[] = REGISTER_NAMES;
 
 enum machine_mode reg_raw_mode[FIRST_PSEUDO_REGISTER];
 
-/* Indexed by n, gives number of times (REG n) is set or clobbered.
-   This information remains valid for the rest of the compilation
-   of the current function; it is used to control register allocation.
-
-   This information applies to both hard registers and pseudo registers,
-   unlike much of the information above.  */
-
-short *reg_n_sets;
-
 /* Maximum cost of moving from a register in one class to a register in
    another class.  Based on REGISTER_MOVE_COST.  */
 
@@ -835,7 +826,7 @@ regclass (f, nregs)
                        }
 
                      /* This makes one more setting of new insns's dest.  */
-                     reg_n_sets[REGNO (recog_operand[0])]++;
+                     REG_N_SETS (REGNO (recog_operand[0]))++;
 
                      *recog_operand_loc[1] = recog_operand[0];
                      for (i = insn_n_dups[insn_code_number] - 1; i >= 0; i--)
@@ -1658,6 +1649,43 @@ auto_inc_dec_reg_p (reg, mode)
 
 #endif /* REGISTER_CONSTRAINTS */
 \f
+/* Allocate enough space to hold NUM_REGS registers for the tables used for
+   reg_scan and flow_analysis that are indexed by the register number.  If
+   NEW_P is set, initialize all of the registers, otherwise only initialize the
+   new registers allocated.  The same table is kept from function to function,
+   only reallocating it when we need more room.  */
+
+void
+allocate_reg_info (num_regs, new_p)
+     int num_regs;
+     int new_p;
+{
+  static int regno_allocated = 0;
+  static int regno_max = 0;
+  int i;
+  int size;
+  int min = (new_p) ? 0 : regno_max+1;
+
+  if (num_regs > regno_allocated)
+    {
+      regno_allocated = num_regs + (num_regs / 20);    /* add some slop space */
+      size = regno_allocated * sizeof (reg_info);
+      reg_n_info = ((reg_n_info)
+                   ? (reg_info *) xrealloc ((char *)reg_n_info, size)
+                   : (reg_info *) xmalloc (size));
+    }
+
+  if (min < num_regs)
+    {
+      bzero ((char *) &reg_n_info[min], (num_regs - min) * sizeof (reg_info));
+      for (i = min; i < num_regs; i++)
+       REG_BASIC_BLOCK (i) = REG_BLOCK_UNKNOWN;
+    }
+
+  regno_max = num_regs;
+}
+
+\f
 /* This is the `regscan' pass of the compiler, run just before cse
    and again just before loop.
 
@@ -1667,27 +1695,6 @@ auto_inc_dec_reg_p (reg, mode)
 
    REPEAT is nonzero the second time this is called.  */
 
-/* Indexed by pseudo register number, gives uid of first insn using the reg
-   (as of the time reg_scan is called).  */
-
-int *regno_first_uid;
-
-/* Indexed by pseudo register number, gives uid of last insn using the reg
-   (as of the time reg_scan is called).  */
-
-int *regno_last_uid;
-
-/* Indexed by pseudo register number, gives uid of last insn using the reg
-   or mentioning it in a note (as of the time reg_scan is called).  */
-
-int *regno_last_note_uid;
-
-/* Record the number of registers we used when we allocated the above two
-   tables.  If we are called again with more than this, we must re-allocate
-   the tables.  */
-
-static int highest_regno_in_uid_map;
-
 /* Maximum number of parallel sets and clobbers in any insn in this fn.
    Always at least 3, since the combiner could put that many together
    and we want this to remain correct for all the remaining passes.  */
@@ -1702,26 +1709,7 @@ reg_scan (f, nregs, repeat)
 {
   register rtx insn;
 
-  if (!repeat || nregs > highest_regno_in_uid_map)
-    {
-      /* Leave some spare space in case more regs are allocated.  */
-      highest_regno_in_uid_map = nregs + nregs / 20;
-      regno_first_uid
-       = (int *) oballoc (highest_regno_in_uid_map * sizeof (int));
-      regno_last_uid
-       = (int *) oballoc (highest_regno_in_uid_map * sizeof (int));
-      regno_last_note_uid
-       = (int *) oballoc (highest_regno_in_uid_map * sizeof (int));
-      reg_n_sets
-       = (short *) oballoc (highest_regno_in_uid_map * sizeof (short));
-    }
-
-  bzero ((char *) regno_first_uid, highest_regno_in_uid_map * sizeof (int));
-  bzero ((char *) regno_last_uid, highest_regno_in_uid_map * sizeof (int));
-  bzero ((char *) regno_last_note_uid,
-        highest_regno_in_uid_map * sizeof (int));
-  bzero ((char *) reg_n_sets, highest_regno_in_uid_map * sizeof (short));
-
+  allocate_reg_info (nregs, TRUE);
   max_parallel = 3;
 
   for (insn = f; insn; insn = NEXT_INSN (insn))
@@ -1769,11 +1757,11 @@ reg_scan_mark_refs (x, insn, note_flag)
       {
        register int regno = REGNO (x);
 
-       regno_last_note_uid[regno] = INSN_UID (insn);
+       REGNO_LAST_NOTE_UID (regno) = INSN_UID (insn);
        if (!note_flag)
-         regno_last_uid[regno] = INSN_UID (insn);
-       if (regno_first_uid[regno] == 0)
-         regno_first_uid[regno] = INSN_UID (insn);
+         REGNO_LAST_UID (regno) = INSN_UID (insn);
+       if (REGNO_FIRST_UID (regno) == 0)
+         REGNO_FIRST_UID (regno) = INSN_UID (insn);
       }
       break;
 
@@ -1798,7 +1786,7 @@ reg_scan_mark_refs (x, insn, note_flag)
        ;
 
       if (GET_CODE (dest) == REG)
-       reg_n_sets[REGNO (dest)]++;
+       REG_N_SETS (REGNO (dest))++;
 
       /* If this is setting a pseudo from another pseudo or the sum of a
         pseudo and a constant integer and the other pseudo is known to be
index fe0d1ac..0091b88 100644 (file)
@@ -37,14 +37,37 @@ extern int max_regno;
 
 extern int max_scratch;
 
+/* Register information indexed by register number */
+typedef struct reg_info_def {
+                               /* fields set by reg_scan */
+  int first_uid;               /* UID of first insn to use (REG n) */
+  int last_uid;                        /* UID of last insn to use (REG n) */
+  int last_note_uid;           /* UID of last note to use (REG n) */
+
+                               /* fields set by both reg_scan and flow_analysis */
+  int sets;                    /* # of times (REG n) is set */
+
+                               /* fields set by flow_analysis */
+  int refs;                    /* # of times (REG n) is used or set */
+  int deaths;                  /* # of times (REG n) dies */
+  int live_length;             /* # of instructions (REG n) is live */
+  int calls_crossed;           /* # of calls (REG n) is live across */
+  int basic_block;             /* # of basic blocks (REG n) is used in */
+  char changes_size;           /* whether (SUBREG (REG n)) changes size */
+} reg_info;
+
+extern reg_info *reg_n_info;
+
 /* Indexed by n, gives number of times (REG n) is used or set.
    References within loops may be counted more times.  */
 
-extern int *reg_n_refs;
+#define REG_N_REFS(N) (reg_n_info[(N)].refs)
 
-/* Indexed by n, gives number of times (REG n) is set.  */
+/* Indexed by n, gives number of times (REG n) is set.
+   ??? both regscan and flow allocate space for this.  We should settle
+   on just copy.  */
 
-extern short *reg_n_sets;
+#define REG_N_SETS(N) (reg_n_info[(N)].sets)
 
 /* Indexed by N, gives number of insns in which register N dies.
    Note that if register N is live around loops, it can die
@@ -52,13 +75,13 @@ extern short *reg_n_sets;
    So this is only a reliable indicator of how many regions of life there are
    for registers that are contained in one basic block.  */
 
-extern short *reg_n_deaths;
+#define REG_N_DEATHS(N) (reg_n_info[(N)].deaths)
 
 /* Indexed by N; says whether a pseudo register N was ever used
    within a SUBREG that changes the size of the reg.  Some machines prohibit
    such objects to be in certain (usually floating-point) registers.  */
 
-extern char *reg_changes_size;
+#define REG_CHANGES_SIZE(N) (reg_n_info[(N)].changes_size)
 
 /* Get the number of consecutive words required to hold pseudo-reg N.  */
 
@@ -77,7 +100,7 @@ extern char *reg_changes_size;
 
 /* Indexed by N, gives number of CALL_INSNS across which (REG n) is live.  */
 
-extern int *reg_n_calls_crossed;
+#define REG_N_CALLS_CROSSED(N) (reg_n_info[(N)].calls_crossed)
 
 /* Total number of instructions at which (REG n) is live.
    The larger this is, the less priority (REG n) gets for
@@ -94,10 +117,14 @@ extern int *reg_n_calls_crossed;
    is not required.  global.c makes an allocno for this but does
    not try to assign a hard register to it.  */
 
-extern int *reg_live_length;
+#define REG_LIVE_LENGTH(N) (reg_n_info[(N)].live_length)
 
 /* Vector of substitutions of register numbers,
-   used to map pseudo regs into hardware regs.  */
+   used to map pseudo regs into hardware regs.
+
+   This can't be folded into reg_n_info without changing all of the
+   machine dependent directories, since the reload functions
+   access it.  */
 
 extern short *reg_renumber;
 
@@ -122,7 +149,7 @@ extern enum machine_mode reg_raw_mode[FIRST_PSEUDO_REGISTER];
    It is sometimes adjusted for subsequent changes during loop,
    but not adjusted by cse even if cse invalidates it.  */
 
-extern int *regno_first_uid;
+#define REGNO_FIRST_UID(N) (reg_n_info[(N)].first_uid)
 
 /* Vector indexed by regno; gives uid of last insn using that reg.
    This is computed by reg_scan for use by cse and loop.
@@ -130,11 +157,11 @@ extern int *regno_first_uid;
    but not adjusted by cse even if cse invalidates it.
    This is harmless since cse won't scan through a loop end.  */
 
-extern int *regno_last_uid;
+#define REGNO_LAST_UID(N) (reg_n_info[(N)].last_uid)
 
 /* Similar, but includes insns that mention the reg in their notes.  */
 
-extern int *regno_last_note_uid;
+#define REGNO_LAST_NOTE_UID(N) (reg_n_info[(N)].last_note_uid)
 
 /* This is reset to LAST_VIRTUAL_REGISTER + 1 at the start of each function.
    After rtl generation, it is 1 plus the largest register number used.  */
@@ -185,3 +212,6 @@ extern rtx *scratch_list;
 extern int *scratch_block;
 /* The length of the arrays pointed to by scratch_block and scratch_list.  */
 extern int scratch_list_length;
+
+/* Allocate reg_n_info tables */
+extern void allocate_reg_info PROTO((int, int));
index 80cb8c3..85790f8 100644 (file)
@@ -785,7 +785,7 @@ reload (first, global, dumpfile)
      in that case some pseudos might be in the wrong kind of hard reg.  */
 
   for (i = FIRST_PSEUDO_REGISTER; i < max_regno; i++)
-    if (reg_renumber[i] == -1 && reg_n_refs[i] != 0)
+    if (reg_renumber[i] == -1 && REG_N_REFS (i) != 0)
       break;
 
   if (i == max_regno && num_eliminable == 0 && ! caller_save_needed)
@@ -2471,7 +2471,7 @@ alter_reg (i, from_reg)
      allocate a stack slot for it.  */
 
   if (reg_renumber[i] < 0
-      && reg_n_refs[i] > 0
+      && REG_N_REFS (i) > 0
       && reg_equiv_constant[i] == 0
       && reg_equiv_memory_loc[i] == 0)
     {
@@ -3659,14 +3659,14 @@ spill_hard_reg (regno, global, dumpfile, cant_eliminate)
 
        if (! cant_eliminate
            && basic_block_needs[0]
-           && reg_basic_block[i] >= 0
-           && basic_block_needs[(int) class][reg_basic_block[i]] == 0)
+           && REG_BASIC_BLOCK (i) >= 0
+           && basic_block_needs[(int) class][REG_BASIC_BLOCK (i)] == 0)
          {
            enum reg_class *p;
 
            for (p = reg_class_superclasses[(int) class];
                 *p != LIM_REG_CLASSES; p++)
-             if (basic_block_needs[(int) *p][reg_basic_block[i]] > 0)
+             if (basic_block_needs[(int) *p][REG_BASIC_BLOCK (i)] > 0)
                break;
 
            if (*p == LIM_REG_CLASSES)
@@ -3827,12 +3827,12 @@ order_regs_for_reload (global)
                 we're not going to be able to reallocate it, but
                 we might if allocated by global alloc.  */
              if (global && reg_allocno[i] < 0)
-               hard_reg_n_uses[regno].uses += (reg_n_refs[i] + 1) / 2;
+               hard_reg_n_uses[regno].uses += (REG_N_REFS (i) + 1) / 2;
 
-             hard_reg_n_uses[regno++].uses += reg_n_refs[i];
+             hard_reg_n_uses[regno++].uses += REG_N_REFS (i);
            }
        }
-      large += reg_n_refs[i];
+      large += REG_N_REFS (i);
     }
 
   /* Now fixed registers (which cannot safely be used for reloading)
@@ -6241,8 +6241,8 @@ emit_reload_insns (insn)
                  SET_DEST (PATTERN (temp)) = reloadreg;
                  /* If these are the only uses of the pseudo reg,
                     pretend for GDB it lives in the reload reg we used.  */
-                 if (reg_n_deaths[REGNO (old)] == 1
-                     && reg_n_sets[REGNO (old)] == 1)
+                 if (REG_N_DEATHS (REGNO (old)) == 1
+                     && REG_N_SETS (REGNO (old)) == 1)
                    {
                      reg_renumber[REGNO (old)] = REGNO (reload_reg_rtx[j]);
                      alter_reg (REGNO (old), -1);
@@ -7280,8 +7280,8 @@ delete_output_reload (insn, j, output_reload_insn)
   /* See if the pseudo reg has been completely replaced
      with reload regs.  If so, delete the store insn
      and forget we had a stack slot for the pseudo.  */
-  else if (reg_n_deaths[REGNO (reg)] == 1
-          && reg_basic_block[REGNO (reg)] >= 0
+  else if (REG_N_DEATHS (REGNO (reg)) == 1
+          && REG_BASIC_BLOCK (REGNO (reg)) >= 0
           && find_regno_note (insn, REG_DEAD, REGNO (reg)))
     {
       rtx i2;
index cfef88f..ae873fa 100644 (file)
@@ -438,7 +438,7 @@ init_alias_analysis ()
        && GET_CODE (SET_DEST (set)) == REG
        && REGNO (SET_DEST (set)) >= FIRST_PSEUDO_REGISTER
        && (((note = find_reg_note (insn, REG_EQUAL, 0)) != 0
-            && reg_n_sets[REGNO (SET_DEST (set))] == 1)
+            && REG_N_SETS (REGNO (SET_DEST (set))) == 1)
            || (note = find_reg_note (insn, REG_EQUIV, NULL_RTX)) != 0)
        && GET_CODE (XEXP (note, 0)) != EXPR_LIST)
       {
@@ -1762,7 +1762,7 @@ sched_analyze_1 (x, insn)
 
          /* Don't let it cross a call after scheduling if it doesn't
             already cross one.  */
-         if (reg_n_calls_crossed[regno] == 0 && last_function_call)
+         if (REG_N_CALLS_CROSSED (regno) == 0 && last_function_call)
            add_dependence (insn, last_function_call, REG_DEP_ANTI);
        }
     }
@@ -1920,7 +1920,7 @@ sched_analyze_2 (x, insn)
            /* If the register does not already cross any calls, then add this
               insn to the sched_before_next_call list so that it will still
               not cross calls after scheduling.  */
-           if (reg_n_calls_crossed[regno] == 0)
+           if (REG_N_CALLS_CROSSED (regno) == 0)
              add_dependence (sched_before_next_call, insn, REG_DEP_ANTI);
          }
        return;
@@ -2531,7 +2531,7 @@ birthing_insn_p (pat)
         insn.  */
 
       if (bb_live_regs[offset] & bit)
-       return (reg_n_sets[i] == 1);
+       return (REG_N_SETS (i) == 1);
 
       return 0;
     }
@@ -4373,10 +4373,10 @@ update_n_sets (x, inc)
          int endregno = regno + HARD_REGNO_NREGS (regno, GET_MODE (dest));
          
          for (i = regno; i < endregno; i++)
-           reg_n_sets[i] += inc;
+           REG_N_SETS (i) += inc;
        }
       else
-       reg_n_sets[regno] += inc;
+       REG_N_SETS (regno) += inc;
     }
 }
 
@@ -4832,6 +4832,7 @@ schedule_insns (dump_file)
 {
   int max_uid = MAX_INSNS_PER_SPLIT * (get_max_uid () + 1);
   int b;
+  int i;
   rtx insn;
 
   /* Taking care of this degenerate case makes the rest of
@@ -4878,8 +4879,8 @@ schedule_insns (dump_file)
       bb_live_regs = (regset) alloca (regset_bytes);
       bzero ((char *) sched_reg_n_calls_crossed, max_regno * sizeof (int));
       bzero ((char *) sched_reg_live_length, max_regno * sizeof (int));
-      bcopy ((char *) reg_n_deaths, (char *) sched_reg_n_deaths,
-            max_regno * sizeof (short));
+      for (i = 0; i < max_regno; i++)
+       sched_reg_n_deaths[i] = REG_N_DEATHS (i);
       init_alias_analysis ();
     }
   else
@@ -5085,35 +5086,35 @@ schedule_insns (dump_file)
          {
            if (dump_file)
              {
-               if (reg_live_length[regno] > sched_reg_live_length[regno])
+               if (REG_LIVE_LENGTH (regno) > sched_reg_live_length[regno])
                  fprintf (dump_file,
                           ";; register %d life shortened from %d to %d\n",
-                          regno, reg_live_length[regno],
+                          regno, REG_LIVE_LENGTH (regno),
                           sched_reg_live_length[regno]);
                /* Negative values are special; don't overwrite the current
                   reg_live_length value if it is negative.  */
-               else if (reg_live_length[regno] < sched_reg_live_length[regno]
-                        && reg_live_length[regno] >= 0)
+               else if (REG_LIVE_LENGTH (regno) < sched_reg_live_length[regno]
+                        && REG_LIVE_LENGTH (regno) >= 0)
                  fprintf (dump_file,
                           ";; register %d life extended from %d to %d\n",
-                          regno, reg_live_length[regno],
+                          regno, REG_LIVE_LENGTH (regno),
                           sched_reg_live_length[regno]);
 
-               if (! reg_n_calls_crossed[regno]
+               if (! REG_N_CALLS_CROSSED (regno)
                    && sched_reg_n_calls_crossed[regno])
                  fprintf (dump_file,
                           ";; register %d now crosses calls\n", regno);
-               else if (reg_n_calls_crossed[regno]
+               else if (REG_N_CALLS_CROSSED (regno)
                         && ! sched_reg_n_calls_crossed[regno]
-                        && reg_basic_block[regno] != REG_BLOCK_GLOBAL)
+                        && REG_BASIC_BLOCK (regno) != REG_BLOCK_GLOBAL)
                  fprintf (dump_file,
                           ";; register %d no longer crosses calls\n", regno);
 
              }
            /* Negative values are special; don't overwrite the current
               reg_live_length value if it is negative.  */
-           if (reg_live_length[regno] >= 0)
-             reg_live_length[regno] = sched_reg_live_length[regno];
+           if (REG_LIVE_LENGTH (regno) >= 0)
+             REG_LIVE_LENGTH (regno) = sched_reg_live_length[regno];
 
            /* We can't change the value of reg_n_calls_crossed to zero for
               pseudos which are live in more than one block.
@@ -5129,8 +5130,8 @@ schedule_insns (dump_file)
               Alternatively, we could try to correctly update basic block live
               at start here in sched, but that seems complicated.  */
            if (sched_reg_n_calls_crossed[regno]
-               || reg_basic_block[regno] != REG_BLOCK_GLOBAL)
-             reg_n_calls_crossed[regno] = sched_reg_n_calls_crossed[regno];
+               || REG_BASIC_BLOCK (regno) != REG_BLOCK_GLOBAL)
+             REG_N_CALLS_CROSSED (regno) = sched_reg_n_calls_crossed[regno];
          }
     }
 }
index 6f10025..72e94d6 100644 (file)
@@ -197,7 +197,7 @@ stupid_life_analysis (f, nregs, file)
   allocate_for_life_analysis ();
 
   for (i = 0; i < max_regno; i++)
-    reg_n_deaths[i] = 1;
+    REG_N_DEATHS (i) = 1;
 
   bzero (regs_live, nregs);
 
@@ -277,7 +277,7 @@ stupid_life_analysis (f, nregs, file)
 
       /* Now find the best hard-register class for this pseudo register */
       if (N_REG_CLASSES > 1)
-       reg_renumber[r] = stupid_find_reg (reg_n_calls_crossed[r]
+       reg_renumber[r] = stupid_find_reg (REG_N_CALLS_CROSSED (r)
                                           reg_preferred_class (r),
                                           PSEUDO_REGNO_MODE (r),
                                           reg_where_born[r],
@@ -286,7 +286,7 @@ stupid_life_analysis (f, nregs, file)
 
       /* If no reg available in that class, try alternate class.  */
       if (reg_renumber[r] == -1 && reg_alternate_class (r) != NO_REGS)
-       reg_renumber[r] = stupid_find_reg (reg_n_calls_crossed[r],
+       reg_renumber[r] = stupid_find_reg (REG_N_CALLS_CROSSED (r),
                                           reg_alternate_class (r),
                                           PSEUDO_REGNO_MODE (r),
                                           reg_where_born[r],
@@ -315,7 +315,7 @@ stupid_reg_compare (r1p, r2p)
   if (tem != 0)
     return tem;
 
-  tem = reg_n_refs[r1] - reg_n_refs[r2];
+  tem = REG_N_REFS (r1) - REG_N_REFS (r2);
   if (tem != 0)
     return tem;
 
@@ -509,10 +509,10 @@ stupid_mark_refs (x, insn)
                }
 
              /* Count the refs of this reg.  */
-             reg_n_refs[regno]++;
+             REG_N_REFS (regno)++;
 
              if (last_call_suid < reg_where_dead[regno])
-               reg_n_calls_crossed[regno] += 1;
+               REG_N_CALLS_CROSSED (regno) += 1;
 
              if (last_setjmp_suid < reg_where_dead[regno])
                regs_crosses_setjmp[regno] = 1;
@@ -560,7 +560,7 @@ stupid_mark_refs (x, insn)
          /* Pseudo reg: record first use, last use and number of uses.  */
 
          reg_where_born[regno] = INSN_SUID (insn);
-         reg_n_refs[regno]++;
+         REG_N_REFS (regno)++;
          if (regs_live[regno] == 0)
            {
              regs_live[regno] = 1;
index de5f64a..74e54bd 100644 (file)
@@ -769,10 +769,10 @@ unroll_loop (loop_end, insn_count, loop_start, end_insert_before,
        can use a different pseudo in each unrolled copy of the loop.  This
        results in better code.  */
     for (j = FIRST_PSEUDO_REGISTER; j < max_reg_before_loop; ++j)
-      if (regno_first_uid[j] > 0 && regno_first_uid[j] <= max_uid_for_loop
-         && uid_luid[regno_first_uid[j]] >= copy_start_luid
-         && regno_last_uid[j] > 0 && regno_last_uid[j] <= max_uid_for_loop
-         && uid_luid[regno_last_uid[j]] <= copy_end_luid)
+      if (REGNO_FIRST_UID (j) > 0 && REGNO_FIRST_UID (j) <= max_uid_for_loop
+         && uid_luid[REGNO_FIRST_UID (j)] >= copy_start_luid
+         && REGNO_LAST_UID (j) > 0 && REGNO_LAST_UID (j) <= max_uid_for_loop
+         && uid_luid[REGNO_LAST_UID (j)] <= copy_end_luid)
        {
          /* However, we must also check for loop-carried dependencies.
             If the value the pseudo has at the end of iteration X is
@@ -783,7 +783,7 @@ unroll_loop (loop_end, insn_count, loop_start, end_insert_before,
             regno_last_uid.  */
          /* ??? This check is simplistic.  We would get better code if
             this check was more sophisticated.  */
-         if (set_dominates_use (j, regno_first_uid[j], regno_last_uid[j],
+         if (set_dominates_use (j, REGNO_FIRST_UID (j), REGNO_LAST_UID (j),
                                 copy_start, copy_end))
            local_regno[j] = 1;
 
@@ -1375,7 +1375,7 @@ precondition_loop_p (initial_value, final_value, increment, loop_start,
   /* Fail if loop_iteration_var is not live before loop_start, since we need
      to test its value in the preconditioning code.  */
 
-  if (uid_luid[regno_first_uid[REGNO (loop_iteration_var)]]
+  if (uid_luid[REGNO_FIRST_UID (REGNO (loop_iteration_var))]
       > INSN_LUID (loop_start))
     {
       if (loop_dump_stream)
@@ -2464,10 +2464,10 @@ find_splittable_regs (unroll_type, loop_start, loop_end, end_insert_before,
       if (unroll_type != UNROLL_COMPLETELY
          && (loop_number_exit_count[uid_loop_num[INSN_UID (loop_start)]]
              || unroll_type == UNROLL_NAIVE)
-         && (uid_luid[regno_last_uid[bl->regno]] >= INSN_LUID (loop_end)
+         && (uid_luid[REGNO_LAST_UID (bl->regno)] >= INSN_LUID (loop_end)
              || ! bl->init_insn
              || INSN_UID (bl->init_insn) >= max_uid_for_loop
-             || (uid_luid[regno_first_uid[bl->regno]]
+             || (uid_luid[REGNO_FIRST_UID (bl->regno)]
                  < INSN_LUID (bl->init_insn))
              || reg_mentioned_p (bl->biv->dest_reg, SET_SRC (bl->init_set)))
          && ! (biv_final_value = final_biv_value (bl, loop_start, loop_end)))
@@ -2676,15 +2676,15 @@ find_splittable_givs (bl, unroll_type, loop_start, loop_end, increment,
          && (loop_number_exit_count[uid_loop_num[INSN_UID (loop_start)]]
              || unroll_type == UNROLL_NAIVE)
          && v->giv_type != DEST_ADDR
-         && ((regno_first_uid[REGNO (v->dest_reg)] != INSN_UID (v->insn)
+         && ((REGNO_FIRST_UID (REGNO (v->dest_reg)) != INSN_UID (v->insn)
               /* Check for the case where the pseudo is set by a shift/add
                  sequence, in which case the first insn setting the pseudo
                  is the first insn of the shift/add sequence.  */
               && (! (tem = find_reg_note (v->insn, REG_RETVAL, NULL_RTX))
-                  || (regno_first_uid[REGNO (v->dest_reg)]
+                  || (REGNO_FIRST_UID (REGNO (v->dest_reg))
                       != INSN_UID (XEXP (tem, 0)))))
              /* Line above always fails if INSN was moved by loop opt.  */
-             || (uid_luid[regno_last_uid[REGNO (v->dest_reg)]]
+             || (uid_luid[REGNO_LAST_UID (REGNO (v->dest_reg))]
                  >= INSN_LUID (loop_end)))
          && ! (final_value = v->final_value))
        continue;