Commit b1f21e0a by Michael Meissner

Use accessor macros to access arrays based on regno; move many of the arrays…

Use accessor macros to access arrays based on regno; move many of the arrays into a single structure.

From-SVN: r14140
parent e00737d2
......@@ -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)
......@@ -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
......
......@@ -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));
......
......@@ -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
......
......@@ -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)))
......
......@@ -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;
......
......@@ -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);
}
/* 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;
}
......
......@@ -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 */
/* 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;
}
/* 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
......
......@@ -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));
......@@ -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;
......
......@@ -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];
}
}
}
......
......@@ -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;
......
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment