Commit 812f2051 by J"orn Rennecke Committed by Joern Rennecke

regclass.c (record_reg_classes): '?' increases cost by two.

	* regclass.c (record_reg_classes): '?' increases cost by two.
	* reload.c (find_reloads): Double previous costs.  Output
	reloads cost one unit extra.
	* reload1.c (eliminate_regs): Delete LOAD_EXTENDED_OP code that
	boiled down to && ! 0.
	* reload.c (find_equiv_reg): Also consider a goal offset from the
	frame pointer to be constant.

From-SVN: r18842
parent 49bf0d6f
Thu Mar 26 18:34:13 1998 J"orn Rennecke <amylaar@cygnus.co.uk>
* regclass.c (record_reg_classes): '?' increases cost by two.
* reload.c (find_reloads): Double previous costs. Output
reloads cost one unit extra.
* reload1.c (eliminate_regs): Delete LOAD_EXTENDED_OP code that
boiled down to && ! 0.
* reload.c (find_equiv_reg): Also consider a goal offset from the
frame pointer to be constant.
Thu Mar 26 17:34:46 1998 J"orn Rennecke <amylaar@cygnus.co.uk> Thu Mar 26 17:34:46 1998 J"orn Rennecke <amylaar@cygnus.co.uk>
* sh.h (OPTIMIZATION_OPTIONS): Define. * sh.h (OPTIMIZATION_OPTIONS): Define.
......
...@@ -1189,8 +1189,10 @@ record_reg_classes (n_alts, n_ops, ops, modes, constraints, insn) ...@@ -1189,8 +1189,10 @@ record_reg_classes (n_alts, n_ops, ops, modes, constraints, insn)
p++; p++;
break; break;
case '?':
alt_cost += 2;
case '%': case '%':
case '?': case '!': case '#': case '!': case '#':
case '&': case '&':
case '0': case '1': case '2': case '3': case '4': case '0': case '1': case '2': case '3': case '4':
case 'p': case 'p':
......
...@@ -2670,7 +2670,7 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p) ...@@ -2670,7 +2670,7 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p)
or got the wrong kind of hard reg. For this, we must consider or got the wrong kind of hard reg. For this, we must consider
all the operands together against the register constraints. */ all the operands together against the register constraints. */
best = MAX_RECOG_OPERANDS + 300; best = MAX_RECOG_OPERANDS * 2 + 600;
swapped = 0; swapped = 0;
goal_alternative_swapped = 0; goal_alternative_swapped = 0;
...@@ -2836,11 +2836,11 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p) ...@@ -2836,11 +2836,11 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p)
break; break;
case '?': case '?':
reject += 3; reject += 6;
break; break;
case '!': case '!':
reject = 300; reject = 600;
break; break;
case '#': case '#':
...@@ -3227,6 +3227,11 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p) ...@@ -3227,6 +3227,11 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p)
&& REGNO (operand) >= FIRST_PSEUDO_REGISTER) && REGNO (operand) >= FIRST_PSEUDO_REGISTER)
&& GET_CODE (operand) != SCRATCH && GET_CODE (operand) != SCRATCH
&& ! (const_to_mem && constmemok)) && ! (const_to_mem && constmemok))
reject += 2;
/* Input reloads can be inherited more often than output
reloads can be removed, so penalize output reloads. */
if (operand_type[i] != RELOAD_FOR_INPUT)
reject++; reject++;
} }
...@@ -3267,7 +3272,7 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p) ...@@ -3267,7 +3272,7 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p)
this_alternative[i])) this_alternative[i]))
this_alternative[i] = (int) preferred_class[i]; this_alternative[i] = (int) preferred_class[i];
else else
reject += (1 + pref_or_nothing[i]); reject += (2 + 2 * pref_or_nothing[i]);
} }
} }
} }
...@@ -3374,9 +3379,9 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p) ...@@ -3374,9 +3379,9 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p)
/* REJECT, set by the ! and ? constraint characters and when a register /* REJECT, set by the ! and ? constraint characters and when a register
would be reloaded into a non-preferred class, discourages the use of would be reloaded into a non-preferred class, discourages the use of
this alternative for a reload goal. REJECT is incremented by three this alternative for a reload goal. REJECT is incremented by six
for each ? and one for each non-preferred class. */ for each ? and two for each non-preferred class. */
losers = losers * 3 + reject; losers = losers * 6 + reject;
/* If this alternative can be made to work by reloading, /* If this alternative can be made to work by reloading,
and it needs less reloading than the others checked so far, and it needs less reloading than the others checked so far,
...@@ -5705,6 +5710,10 @@ find_equiv_reg (goal, insn, class, other, reload_reg_p, goalreg, mode) ...@@ -5705,6 +5710,10 @@ find_equiv_reg (goal, insn, class, other, reload_reg_p, goalreg, mode)
&& XEXP (goal, 0) == stack_pointer_rtx && XEXP (goal, 0) == stack_pointer_rtx
&& CONSTANT_P (XEXP (goal, 1))) && CONSTANT_P (XEXP (goal, 1)))
goal_const = need_stable_sp = 1; goal_const = need_stable_sp = 1;
else if (GET_CODE (goal) == PLUS
&& XEXP (goal, 0) == frame_pointer_rtx
&& CONSTANT_P (XEXP (goal, 1)))
goal_const = 1;
else else
return 0; return 0;
......
...@@ -3133,18 +3133,6 @@ eliminate_regs (x, mem_mode, insn) ...@@ -3133,18 +3133,6 @@ eliminate_regs (x, mem_mode, insn)
#endif #endif
) )
|| (x_size == new_size)) || (x_size == new_size))
#ifdef LOAD_EXTEND_OP
/* On these machines we will be reloading what is
inside the SUBREG if it originally was a pseudo and
the inner and outer modes are both a word or
smaller. So leave the SUBREG then. */
&& ! (GET_CODE (SUBREG_REG (x)) == REG
&& x_size <= UNITS_PER_WORD
&& new_size <= UNITS_PER_WORD
&& x_size > new_size
&& INTEGRAL_MODE_P (GET_MODE (new))
&& LOAD_EXTEND_OP (GET_MODE (new)) != NIL)
#endif
) )
{ {
int offset = SUBREG_WORD (x) * UNITS_PER_WORD; int offset = SUBREG_WORD (x) * UNITS_PER_WORD;
......
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