summaryrefslogtreecommitdiff
path: root/gcc/reload.c
diff options
context:
space:
mode:
authoraesok <aesok@138bc75d-0d04-0410-961f-82ee72b054a4>2010-09-02 14:29:37 +0000
committeraesok <aesok@138bc75d-0d04-0410-961f-82ee72b054a4>2010-09-02 14:29:37 +0000
commit24dd066854c04dc78c5624f8097da0816d6b532c (patch)
tree8800ae6420f6689c40bea9995085ad6bf47c0f65 /gcc/reload.c
parentdbd6de328ae1bdb74aa9ad274035c2e5a25ff99c (diff)
downloadgcc-24dd066854c04dc78c5624f8097da0816d6b532c.tar.gz
* target.def (class_likely_spilled_p): New hook.
* doc/tm.texi.in (TARGET_CLASS_LIKELY_SPILLED_P): Document. * doc/tm.texi: Regenerate. * targhooks.c (default_class_likely_spilled_p): New function. * targhooks.h (default_class_likely_spilled_p): Declare. * regs.h (CLASS_LIKELY_SPILLED_P): Remove. * combine.c: (cant_combine_insn_p, likely_spilled_retval_p): Use TARGET_CLASS_LIKELY_SPILLED_P target hook. Use HARD_REGISTER_P macro. Use fixed_reg_set instead of fixed_regs. * cse.c (hash_rtx_cb): Use TARGET_CLASS_LIKELY_SPILLED_P target hook. * calls.c (avoid_likely_spilled_reg): Ditto. * ira-conflicts.c: (ira_build_conflicts): Ditto. * ira.c (update_equiv_regs): Ditto. * mode-switching.c (create_pre_exit): Ditto. * regmove.c (find_matches): Ditto. (regclass_compatible_p): Use TARGET_CLASS_LIKELY_SPILLED_P target hook. * reload.c (SMALL_REGISTER_CLASS_P): Remove macro. (small_register_class_p): New inline function. (push_secondary_reload, find_reusable_reload, find_reloads): Use small_register_class_p instead of SMALL_REGISTER_CLASS_P. * config/i386/i386.h (CLASS_LIKELY_SPILLED_P): Remove. * config/i386/i386.c (ix86_class_likely_spilled_p): New. (TARGET_CLASS_LIKELY_SPILLED_P): Define. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@163779 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/reload.c')
-rw-r--r--gcc/reload.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/gcc/reload.c b/gcc/reload.c
index 75fb000647b..2df18a1dc59 100644
--- a/gcc/reload.c
+++ b/gcc/reload.c
@@ -121,9 +121,14 @@ a register with any other reload. */
/* 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)))
+
+static inline bool
+small_register_class_p (reg_class_t rclass)
+{
+ return (reg_class_size [(int) rclass] == 1
+ || (reg_class_size [(int) rclass] >= 1
+ && targetm.class_likely_spilled_p (rclass)));
+}
/* All reloads of the current insn are recorded here. See reload.h for
@@ -438,7 +443,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))
- && (SMALL_REGISTER_CLASS_P (rclass)
+ && (small_register_class_p (rclass)
|| targetm.small_register_classes_for_mode_p (VOIDmode))
&& MERGABLE_RELOADS (secondary_type, rld[s_reload].when_needed,
opnum, rld[s_reload].opnum))
@@ -749,7 +754,7 @@ find_reusable_reload (rtx *p_in, rtx out, enum reg_class rclass,
|| (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))
- && (SMALL_REGISTER_CLASS_P (rclass)
+ && (small_register_class_p (rclass)
|| targetm.small_register_classes_for_mode_p (VOIDmode))
&& MERGABLE_RELOADS (type, rld[i].when_needed, opnum, rld[i].opnum))
return i;
@@ -775,7 +780,7 @@ find_reusable_reload (rtx *p_in, rtx out, enum reg_class rclass,
&& 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))
- && (SMALL_REGISTER_CLASS_P (rclass)
+ && (small_register_class_p (rclass)
|| targetm.small_register_classes_for_mode_p (VOIDmode))
&& MERGABLE_RELOADS (type, rld[i].when_needed,
opnum, rld[i].opnum))
@@ -3588,7 +3593,7 @@ find_reloads (rtx insn, int replace, int ind_levels, int live_known,
&& this_alternative[i] != NO_REGS
&& GET_MODE_SIZE (operand_mode[i]) <= UNITS_PER_WORD
&& reg_class_size [(int) preferred_class[i]] > 0
- && ! SMALL_REGISTER_CLASS_P (preferred_class[i]))
+ && ! small_register_class_p (preferred_class[i]))
{
if (! reg_class_subset_p (this_alternative[i],
preferred_class[i]))
@@ -3646,7 +3651,7 @@ find_reloads (rtx insn, int replace, int ind_levels, int live_known,
{
/* If the output is in a non-empty few-regs class,
it's costly to reload it, so reload the input instead. */
- if (SMALL_REGISTER_CLASS_P (this_alternative[i])
+ if (small_register_class_p (this_alternative[i])
&& (REG_P (recog_data.operand[j])
|| GET_CODE (recog_data.operand[j]) == SUBREG))
{