reload.c (SMALL_REGISTER_CLASS_P): New.
* reload.c (SMALL_REGISTER_CLASS_P): New. (push_secondary_reload, find_reusable_reload, find_reloads): Use it instead of testing only the class size. From-SVN: r92221
This commit is contained in:
parent
e243549854
commit
e9840398cd
2 changed files with 21 additions and 7 deletions
|
@ -1,3 +1,9 @@
|
|||
2004-12-15 Alexandre Oliva <aoliva@redhat.com>
|
||||
|
||||
* reload.c (SMALL_REGISTER_CLASS_P): New.
|
||||
(push_secondary_reload, find_reusable_reload, find_reloads): Use
|
||||
it instead of testing only the class size.
|
||||
|
||||
2004-12-15 Eric Botcazou <ebotcazou@libertysurf.fr>
|
||||
|
||||
PR c++/17972
|
||||
|
|
22
gcc/reload.c
22
gcc/reload.c
|
@ -113,6 +113,13 @@ a register with any other reload. */
|
|||
(CONSTANT_P (X) \
|
||||
&& GET_CODE (X) != HIGH \
|
||||
&& !targetm.cannot_force_const_mem (X))
|
||||
|
||||
/* True if C is a non-empty register class that has too few registers
|
||||
to be safely used as a reload target class. */
|
||||
#define SMALL_REGISTER_CLASS_P(C) \
|
||||
(reg_class_size [(C)] == 1 \
|
||||
|| (reg_class_size [(C)] >= 1 && CLASS_LIKELY_SPILLED_P (C)))
|
||||
|
||||
|
||||
/* All reloads of the current insn are recorded here. See reload.h for
|
||||
comments. */
|
||||
|
@ -443,7 +450,7 @@ push_secondary_reload (int in_p, rtx x, int opnum, int optional,
|
|||
== CODE_FOR_nothing))
|
||||
|| (! in_p &&(rld[t_reload].secondary_out_icode
|
||||
== CODE_FOR_nothing)))
|
||||
&& (reg_class_size[(int) t_class] == 1 || SMALL_REGISTER_CLASSES)
|
||||
&& (SMALL_REGISTER_CLASS_P (t_class) || SMALL_REGISTER_CLASSES)
|
||||
&& MERGABLE_RELOADS (secondary_type,
|
||||
rld[t_reload].when_needed,
|
||||
opnum, rld[t_reload].opnum))
|
||||
|
@ -501,7 +508,7 @@ push_secondary_reload (int in_p, rtx x, int opnum, int optional,
|
|||
|| (! in_p && rld[s_reload].secondary_out_reload == t_reload))
|
||||
&& ((in_p && rld[s_reload].secondary_in_icode == t_icode)
|
||||
|| (! in_p && rld[s_reload].secondary_out_icode == t_icode))
|
||||
&& (reg_class_size[(int) class] == 1 || SMALL_REGISTER_CLASSES)
|
||||
&& (SMALL_REGISTER_CLASS_P (class) || SMALL_REGISTER_CLASSES)
|
||||
&& MERGABLE_RELOADS (secondary_type, rld[s_reload].when_needed,
|
||||
opnum, rld[s_reload].opnum))
|
||||
{
|
||||
|
@ -755,7 +762,7 @@ find_reusable_reload (rtx *p_in, rtx out, enum reg_class class,
|
|||
|| (out != 0 && MATCHES (rld[i].out, out)
|
||||
&& (in == 0 || rld[i].in == 0 || MATCHES (rld[i].in, in))))
|
||||
&& (rld[i].out == 0 || ! earlyclobber_operand_p (rld[i].out))
|
||||
&& (reg_class_size[(int) class] == 1 || SMALL_REGISTER_CLASSES)
|
||||
&& (SMALL_REGISTER_CLASS_P (class) || SMALL_REGISTER_CLASSES)
|
||||
&& MERGABLE_RELOADS (type, rld[i].when_needed, opnum, rld[i].opnum))
|
||||
return i;
|
||||
|
||||
|
@ -780,7 +787,7 @@ find_reusable_reload (rtx *p_in, rtx out, enum reg_class class,
|
|||
&& GET_RTX_CLASS (GET_CODE (in)) == RTX_AUTOINC
|
||||
&& MATCHES (XEXP (in, 0), rld[i].in)))
|
||||
&& (rld[i].out == 0 || ! earlyclobber_operand_p (rld[i].out))
|
||||
&& (reg_class_size[(int) class] == 1 || SMALL_REGISTER_CLASSES)
|
||||
&& (SMALL_REGISTER_CLASS_P (class) || SMALL_REGISTER_CLASSES)
|
||||
&& MERGABLE_RELOADS (type, rld[i].when_needed,
|
||||
opnum, rld[i].opnum))
|
||||
{
|
||||
|
@ -3484,7 +3491,8 @@ find_reloads (rtx insn, int replace, int ind_levels, int live_known,
|
|||
if (! win && ! did_match
|
||||
&& this_alternative[i] != (int) NO_REGS
|
||||
&& GET_MODE_SIZE (operand_mode[i]) <= UNITS_PER_WORD
|
||||
&& reg_class_size[(int) preferred_class[i]] > 1)
|
||||
&& reg_class_size [(int) preferred_class[i]] > 0
|
||||
&& ! SMALL_REGISTER_CLASS_P (preferred_class[i]))
|
||||
{
|
||||
if (! reg_class_subset_p (this_alternative[i],
|
||||
preferred_class[i]))
|
||||
|
@ -3540,9 +3548,9 @@ find_reloads (rtx insn, int replace, int ind_levels, int live_known,
|
|||
&& !immune_p (recog_data.operand[j], recog_data.operand[i],
|
||||
early_data))
|
||||
{
|
||||
/* If the output is in a single-reg class,
|
||||
/* If the output is in a non-empty few-regs class,
|
||||
it's costly to reload it, so reload the input instead. */
|
||||
if (reg_class_size[this_alternative[i]] == 1
|
||||
if (SMALL_REGISTER_CLASS_P (this_alternative[i])
|
||||
&& (REG_P (recog_data.operand[j])
|
||||
|| GET_CODE (recog_data.operand[j]) == SUBREG))
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue