aboutsummaryrefslogtreecommitdiff
path: root/gcc/reload.c
diff options
context:
space:
mode:
authorRichard Sandiford <richard.sandiford@linaro.org>2017-09-12 13:28:08 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2017-09-12 13:28:08 +0000
commit462a99aa98416135d2675d07d32f7ce234287983 (patch)
tree6a0d7b2184713f09474d42070b1f6e4fa7670a38 /gcc/reload.c
parente0bd6c9f0aa67d88bbb20019362a4572fc5fac3c (diff)
downloadgcc-462a99aa98416135d2675d07d32f7ce234287983.zip
gcc-462a99aa98416135d2675d07d32f7ce234287983.tar.gz
gcc-462a99aa98416135d2675d07d32f7ce234287983.tar.bz2
Make more use of REG_NREGS
An upcoming patch will convert hard_regno_nregs into an inline function, which in turn allows hard_regno_nregs to be used as the name of a targetm field. This patch rewrites uses that are more easily (and efficiently) written as REG_NREGS. 2017-09-12 Richard Sandiford <richard.sandiford@linaro.org> gcc/ * caller-save.c (add_used_regs): Use REG_NREGS instead of hard_regno_nregs. * config/aarch64/aarch64.c (aarch64_split_combinev16qi): Likewise. * config/arm/arm.c (output_move_neon): Likewise. (arm_attr_length_move_neon): Likewise. (neon_split_vcombine): Likewise. * config/c6x/c6x.c (c6x_mark_reg_read): Likewise. (c6x_mark_reg_written): Likewise. (c6x_dwarf_register_span): Likewise. * config/i386/i386.c (ix86_save_reg): Likewise. * config/ia64/ia64.c (mark_reg_gr_used_mask): Likewise. (rws_access_reg): Likewise. * config/s390/s390.c (s390_call_saved_register_used): Likewise. * mode-switching.c (create_pre_exit): Likewise. * ree.c (combine_reaching_defs): Likewise. (add_removable_extension): Likewise. * regcprop.c (find_oldest_value_reg): Likewise. (copyprop_hardreg_forward_1): Likewise. * reload.c (reload_inner_reg_of_subreg): Likewise. (push_reload): Likewise. (combine_reloads): Likewise. (find_dummy_reload): Likewise. (reload_adjust_reg_for_mode): Likewise. * reload1.c (find_reload_regs): Likewise. (forget_old_reloads_1): Likewise. (reload_reg_free_for_value_p): Likewise. (reload_adjust_reg_for_temp): Likewise. (emit_reload_insns): Likewise. (delete_output_reload): Likewise. * sel-sched.c (choose_best_reg_1): Likewise. (choose_best_pseudo_reg): Likewise. From-SVN: r252010
Diffstat (limited to 'gcc/reload.c')
-rw-r--r--gcc/reload.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/gcc/reload.c b/gcc/reload.c
index 9d96700..eb67db6 100644
--- a/gcc/reload.c
+++ b/gcc/reload.c
@@ -862,7 +862,7 @@ reload_inner_reg_of_subreg (rtx x, machine_mode mode, bool output)
&& GET_MODE_SIZE (mode) <= UNITS_PER_WORD
&& GET_MODE_SIZE (GET_MODE (inner)) > UNITS_PER_WORD
&& ((GET_MODE_SIZE (GET_MODE (inner)) / UNITS_PER_WORD)
- != (int) hard_regno_nregs[REGNO (inner)][GET_MODE (inner)]));
+ != REG_NREGS (inner)));
}
/* Return nonzero if IN can be reloaded into REGNO with mode MODE without
@@ -1086,8 +1086,7 @@ push_reload (rtx in, rtx out, rtx *inloc, rtx *outloc,
> UNITS_PER_WORD)
&& ((GET_MODE_SIZE (GET_MODE (SUBREG_REG (in)))
/ UNITS_PER_WORD)
- != (int) hard_regno_nregs[REGNO (SUBREG_REG (in))]
- [GET_MODE (SUBREG_REG (in))]))
+ != REG_NREGS (SUBREG_REG (in))))
|| !targetm.hard_regno_mode_ok (subreg_regno (in), inmode)))
|| (secondary_reload_class (1, rclass, inmode, in) != NO_REGS
&& (secondary_reload_class (1, rclass, GET_MODE (SUBREG_REG (in)),
@@ -1597,7 +1596,7 @@ push_reload (rtx in, rtx out, rtx *inloc, rtx *outloc,
&& (ORIGINAL_REGNO (XEXP (note, 0)) < FIRST_PSEUDO_REGISTER
|| (! bitmap_bit_p (DF_LR_OUT (ENTRY_BLOCK_PTR_FOR_FN (cfun)),
ORIGINAL_REGNO (XEXP (note, 0)))
- && hard_regno_nregs[regno][GET_MODE (XEXP (note, 0))] == 1))
+ && REG_NREGS (XEXP (note, 0)) == 1))
&& ! refers_to_regno_for_reload_p (regno,
end_hard_regno (rel_mode,
regno),
@@ -1907,7 +1906,7 @@ combine_reloads (void)
&& TEST_HARD_REG_BIT (reg_class_contents[(int) rld[output_reload].rclass],
regno)
&& (hard_regno_nregs[regno][rld[output_reload].outmode]
- <= hard_regno_nregs[regno][GET_MODE (XEXP (note, 0))])
+ <= REG_NREGS (XEXP (note, 0)))
/* Ensure that a secondary or tertiary reload for this output
won't want this register. */
&& ((secondary_out = rld[output_reload].secondary_out_reload) == -1
@@ -1922,7 +1921,7 @@ combine_reloads (void)
&& (ORIGINAL_REGNO (XEXP (note, 0)) < FIRST_PSEUDO_REGISTER
|| (!bitmap_bit_p (DF_LR_OUT (ENTRY_BLOCK_PTR_FOR_FN (cfun)),
ORIGINAL_REGNO (XEXP (note, 0)))
- && hard_regno_nregs[regno][GET_MODE (XEXP (note, 0))] == 1)))
+ && REG_NREGS (XEXP (note, 0)) == 1)))
{
rld[output_reload].reg_rtx
= gen_rtx_REG (rld[output_reload].outmode, regno);
@@ -2088,7 +2087,7 @@ find_dummy_reload (rtx real_in, rtx real_out, rtx *inloc, rtx *outloc,
because only another subword of the hardreg is actually
used in the insn. This cannot happen if the pseudo has
been assigned exactly one hardreg. See PR 33732. */
- && hard_regno_nregs[REGNO (in)][GET_MODE (in)] == 1)))
+ && REG_NREGS (in) == 1)))
{
unsigned int regno = REGNO (in) + in_offset;
unsigned int nwords = hard_regno_nregs[regno][inmode];
@@ -7254,8 +7253,7 @@ reload_adjust_reg_for_mode (rtx reloadreg, machine_mode mode)
regno = REGNO (reloadreg);
if (REG_WORDS_BIG_ENDIAN)
- regno += (int) hard_regno_nregs[regno][GET_MODE (reloadreg)]
- - (int) hard_regno_nregs[regno][mode];
+ regno += (int) REG_NREGS (reloadreg) - (int) hard_regno_nregs[regno][mode];
return gen_rtx_REG (mode, regno);
}