regs.h (END_HARD_REGNO): Delete.

gcc/
	* regs.h (END_HARD_REGNO): Delete.
	(END_REGNO): Move to...
	* rtl.h: ...here.
	* bt-load.c (note_btr_set): Use END_REGNO instead of END_HARD_REGNO.
	* caller-save.c (mark_set_regs): Likewise.
	* combine.c (move_deaths, distribute_notes): Likewise.
	* cse.c (invalidate, invalidate_for_call): Likewise.
	* df-scan.c (df_ref_record): Likewise.
	* postreload-gcse.c (reg_changed_after_insn_p): Likewise.
	(record_last_reg_set_info): Likewise.
	* reg-stack.c (convert_regs_exit): Likewise.
	* reload.c (reg_overlap_mentioned_for_reload_p): Likewise.
	* resource.c (update_live_status): Likewise.
	* rtlanal.c (find_reg_fusage, find_regno_fusage): Likewise.

From-SVN: r223343
This commit is contained in:
Richard Sandiford 2015-05-19 07:11:18 +00:00 committed by Richard Sandiford
parent 9188b2863c
commit 72d19505ee
13 changed files with 41 additions and 25 deletions

View File

@ -1,3 +1,20 @@
2015-05-19 Richard Sandiford <richard.sandiford@arm.com>
* regs.h (END_HARD_REGNO): Delete.
(END_REGNO): Move to...
* rtl.h: ...here.
* bt-load.c (note_btr_set): Use END_REGNO instead of END_HARD_REGNO.
* caller-save.c (mark_set_regs): Likewise.
* combine.c (move_deaths, distribute_notes): Likewise.
* cse.c (invalidate, invalidate_for_call): Likewise.
* df-scan.c (df_ref_record): Likewise.
* postreload-gcse.c (reg_changed_after_insn_p): Likewise.
(record_last_reg_set_info): Likewise.
* reg-stack.c (convert_regs_exit): Likewise.
* reload.c (reg_overlap_mentioned_for_reload_p): Likewise.
* resource.c (update_live_status): Likewise.
* rtlanal.c (find_reg_fusage, find_regno_fusage): Likewise.
2015-05-19 Richard Sandiford <richard.sandiford@arm.com> 2015-05-19 Richard Sandiford <richard.sandiford@arm.com>
* rtl.h (reg_info): Add an nregs field. * rtl.h (reg_info): Add an nregs field.

View File

@ -443,7 +443,7 @@ note_btr_set (rtx dest, const_rtx set ATTRIBUTE_UNUSED, void *data)
if (!REG_P (dest)) if (!REG_P (dest))
return; return;
regno = REGNO (dest); regno = REGNO (dest);
end_regno = END_HARD_REGNO (dest); end_regno = END_REGNO (dest);
for (; regno < end_regno; regno++) for (; regno < end_regno; regno++)
if (TEST_HARD_REG_BIT (all_btrs, regno)) if (TEST_HARD_REG_BIT (all_btrs, regno))
{ {

View File

@ -992,7 +992,7 @@ mark_set_regs (rtx reg, const_rtx setter ATTRIBUTE_UNUSED, void *data)
&& REGNO (reg) < FIRST_PSEUDO_REGISTER) && REGNO (reg) < FIRST_PSEUDO_REGISTER)
{ {
regno = REGNO (reg); regno = REGNO (reg);
endregno = END_HARD_REGNO (reg); endregno = END_REGNO (reg);
} }
else else
return; return;

View File

@ -13454,8 +13454,8 @@ move_deaths (rtx x, rtx maybe_kill_insn, int from_luid, rtx_insn *to_insn,
> GET_MODE_SIZE (GET_MODE (x)))) > GET_MODE_SIZE (GET_MODE (x))))
{ {
unsigned int deadregno = REGNO (XEXP (note, 0)); unsigned int deadregno = REGNO (XEXP (note, 0));
unsigned int deadend = END_HARD_REGNO (XEXP (note, 0)); unsigned int deadend = END_REGNO (XEXP (note, 0));
unsigned int ourend = END_HARD_REGNO (x); unsigned int ourend = END_REGNO (x);
unsigned int i; unsigned int i;
for (i = deadregno; i < deadend; i++) for (i = deadregno; i < deadend; i++)
@ -13475,7 +13475,7 @@ move_deaths (rtx x, rtx maybe_kill_insn, int from_luid, rtx_insn *to_insn,
&& regno < FIRST_PSEUDO_REGISTER && regno < FIRST_PSEUDO_REGISTER
&& REG_NREGS (x) > 1) && REG_NREGS (x) > 1)
{ {
unsigned int ourend = END_HARD_REGNO (x); unsigned int ourend = END_REGNO (x);
unsigned int i, offset; unsigned int i, offset;
rtx oldnotes = 0; rtx oldnotes = 0;
@ -14070,7 +14070,7 @@ distribute_notes (rtx notes, rtx_insn *from_insn, rtx_insn *i3, rtx_insn *i2,
if (place && REG_NREGS (XEXP (note, 0)) > 1) if (place && REG_NREGS (XEXP (note, 0)) > 1)
{ {
unsigned int endregno = END_HARD_REGNO (XEXP (note, 0)); unsigned int endregno = END_REGNO (XEXP (note, 0));
bool all_used = true; bool all_used = true;
unsigned int i; unsigned int i;

View File

@ -1894,7 +1894,7 @@ invalidate (rtx x, machine_mode full_mode)
{ {
HOST_WIDE_INT in_table HOST_WIDE_INT in_table
= TEST_HARD_REG_BIT (hard_regs_in_table, regno); = TEST_HARD_REG_BIT (hard_regs_in_table, regno);
unsigned int endregno = END_HARD_REGNO (x); unsigned int endregno = END_REGNO (x);
unsigned int tregno, tendregno, rn; unsigned int tregno, tendregno, rn;
struct table_elt *p, *next; struct table_elt *p, *next;
@ -1920,7 +1920,7 @@ invalidate (rtx x, machine_mode full_mode)
continue; continue;
tregno = REGNO (p->exp); tregno = REGNO (p->exp);
tendregno = END_HARD_REGNO (p->exp); tendregno = END_REGNO (p->exp);
if (tendregno > regno && tregno < endregno) if (tendregno > regno && tregno < endregno)
remove_from_table (p, hash); remove_from_table (p, hash);
} }
@ -2139,7 +2139,7 @@ invalidate_for_call (void)
continue; continue;
regno = REGNO (p->exp); regno = REGNO (p->exp);
endregno = END_HARD_REGNO (p->exp); endregno = END_REGNO (p->exp);
for (i = regno; i < endregno; i++) for (i = regno; i < endregno; i++)
if (TEST_HARD_REG_BIT (regs_invalidated_by_call, i)) if (TEST_HARD_REG_BIT (regs_invalidated_by_call, i))

View File

@ -2624,7 +2624,7 @@ df_ref_record (enum df_ref_class cl,
endregno = regno + subreg_nregs (reg); endregno = regno + subreg_nregs (reg);
} }
else else
endregno = END_HARD_REGNO (reg); endregno = END_REGNO (reg);
/* If this is a multiword hardreg, we create some extra /* If this is a multiword hardreg, we create some extra
datastructures that will enable us to easily build REG_DEAD datastructures that will enable us to easily build REG_DEAD

View File

@ -551,7 +551,7 @@ reg_changed_after_insn_p (rtx x, int cuid)
unsigned int regno, end_regno; unsigned int regno, end_regno;
regno = REGNO (x); regno = REGNO (x);
end_regno = END_HARD_REGNO (x); end_regno = END_REGNO (x);
do do
if (reg_avail_info[regno] > cuid) if (reg_avail_info[regno] > cuid)
return true; return true;
@ -720,7 +720,7 @@ record_last_reg_set_info (rtx_insn *insn, rtx reg)
unsigned int regno, end_regno; unsigned int regno, end_regno;
regno = REGNO (reg); regno = REGNO (reg);
end_regno = END_HARD_REGNO (reg); end_regno = END_REGNO (reg);
do do
reg_avail_info[regno] = INSN_CUID (insn); reg_avail_info[regno] = INSN_CUID (insn);
while (++regno < end_regno); while (++regno < end_regno);

View File

@ -2677,7 +2677,7 @@ convert_regs_exit (void)
if (retvalue) if (retvalue)
{ {
value_reg_low = REGNO (retvalue); value_reg_low = REGNO (retvalue);
value_reg_high = END_HARD_REGNO (retvalue) - 1; value_reg_high = END_REGNO (retvalue) - 1;
} }
output_stack = &BLOCK_INFO (EXIT_BLOCK_PTR_FOR_FN (cfun))->stack_in; output_stack = &BLOCK_INFO (EXIT_BLOCK_PTR_FOR_FN (cfun))->stack_in;

View File

@ -286,14 +286,6 @@ end_hard_regno (machine_mode mode, unsigned int regno)
return regno + hard_regno_nregs[regno][(int) mode]; return regno + hard_regno_nregs[regno][(int) mode];
} }
/* Likewise for hard register X. */
#define END_HARD_REGNO(X) END_REGNO (X)
/* Likewise for hard or pseudo register X. */
#define END_REGNO(X) (REGNO (X) + REG_NREGS (X))
/* Add to REGS all the registers required to store a value of mode MODE /* Add to REGS all the registers required to store a value of mode MODE
in register REGNO. */ in register REGNO. */

View File

@ -6590,7 +6590,7 @@ reg_overlap_mentioned_for_reload_p (rtx x, rtx in)
return 0; return 0;
} }
endregno = END_HARD_REGNO (x); endregno = END_REGNO (x);
return refers_to_regno_for_reload_p (regno, endregno, in, (rtx*) 0); return refers_to_regno_for_reload_p (regno, endregno, in, (rtx*) 0);
} }

View File

@ -115,7 +115,7 @@ update_live_status (rtx dest, const_rtx x, void *data ATTRIBUTE_UNUSED)
else else
{ {
first_regno = REGNO (dest); first_regno = REGNO (dest);
last_regno = END_HARD_REGNO (dest); last_regno = END_REGNO (dest);
} }
if (GET_CODE (x) == CLOBBER) if (GET_CODE (x) == CLOBBER)

View File

@ -1733,6 +1733,13 @@ rhs_regno (const_rtx x)
return REG_CHECK (x)->regno; return REG_CHECK (x)->regno;
} }
/* Return the final register in REG X plus one. */
static inline unsigned int
END_REGNO (const_rtx x)
{
return REGNO (x) + REG_NREGS (x);
}
/* Change the REGNO and REG_NREGS of REG X to the specified values, /* Change the REGNO and REG_NREGS of REG X to the specified values,
bypassing the df machinery. */ bypassing the df machinery. */
static inline void static inline void

View File

@ -2018,7 +2018,7 @@ find_reg_fusage (const_rtx insn, enum rtx_code code, const_rtx datum)
if (regno < FIRST_PSEUDO_REGISTER) if (regno < FIRST_PSEUDO_REGISTER)
{ {
unsigned int end_regno = END_HARD_REGNO (datum); unsigned int end_regno = END_REGNO (datum);
unsigned int i; unsigned int i;
for (i = regno; i < end_regno; i++) for (i = regno; i < end_regno; i++)
@ -2052,7 +2052,7 @@ find_regno_fusage (const_rtx insn, enum rtx_code code, unsigned int regno)
if (GET_CODE (op = XEXP (link, 0)) == code if (GET_CODE (op = XEXP (link, 0)) == code
&& REG_P (reg = XEXP (op, 0)) && REG_P (reg = XEXP (op, 0))
&& REGNO (reg) <= regno && REGNO (reg) <= regno
&& END_HARD_REGNO (reg) > regno) && END_REGNO (reg) > regno)
return 1; return 1;
} }