From: J"orn Rennecke Date: Thu, 26 Mar 1998 10:44:22 +0000 (+0000) Subject: regclass.c (record_reg_classes): '?' increases cost by two. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=812f205146d174f71073ac23f51d362c1bc11575;p=gcc.git 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 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 9087de55509..7ed217f3180 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,16 @@ +Thu Mar 26 18:34:13 1998 J"orn Rennecke + + * 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 * sh.h (OPTIMIZATION_OPTIONS): Define. diff --git a/gcc/regclass.c b/gcc/regclass.c index 1114ba74cc8..396222b7192 100644 --- a/gcc/regclass.c +++ b/gcc/regclass.c @@ -1189,8 +1189,10 @@ record_reg_classes (n_alts, n_ops, ops, modes, constraints, insn) p++; break; + case '?': + alt_cost += 2; case '%': - case '?': case '!': case '#': + case '!': case '#': case '&': case '0': case '1': case '2': case '3': case '4': case 'p': diff --git a/gcc/reload.c b/gcc/reload.c index 2783686fdb8..e89c2515d9e 100644 --- a/gcc/reload.c +++ b/gcc/reload.c @@ -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 all the operands together against the register constraints. */ - best = MAX_RECOG_OPERANDS + 300; + best = MAX_RECOG_OPERANDS * 2 + 600; swapped = 0; goal_alternative_swapped = 0; @@ -2836,11 +2836,11 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p) break; case '?': - reject += 3; + reject += 6; break; case '!': - reject = 300; + reject = 600; break; case '#': @@ -3227,6 +3227,11 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p) && REGNO (operand) >= FIRST_PSEUDO_REGISTER) && GET_CODE (operand) != SCRATCH && ! (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++; } @@ -3267,7 +3272,7 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p) this_alternative[i])) this_alternative[i] = (int) preferred_class[i]; 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) /* REJECT, set by the ! and ? constraint characters and when a register would be reloaded into a non-preferred class, discourages the use of - this alternative for a reload goal. REJECT is incremented by three - for each ? and one for each non-preferred class. */ - losers = losers * 3 + reject; + this alternative for a reload goal. REJECT is incremented by six + for each ? and two for each non-preferred class. */ + losers = losers * 6 + reject; /* If this alternative can be made to work by reloading, 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) && XEXP (goal, 0) == stack_pointer_rtx && CONSTANT_P (XEXP (goal, 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 return 0; diff --git a/gcc/reload1.c b/gcc/reload1.c index 6b2720a1133..aeb2a628b39 100644 --- a/gcc/reload1.c +++ b/gcc/reload1.c @@ -3133,18 +3133,6 @@ eliminate_regs (x, mem_mode, insn) #endif ) || (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;