Commit 8e2f6e35 by Bernd Schmidt Committed by Jeff Law

combine.c (recog_for_combine): Lose PADDED_SCRATCHES arg.

	* combine.c (recog_for_combine): Lose PADDED_SCRATCHES arg.  All
	callers changed.
	(try_combine): Don't update max_scratch.
	* flow.c (max_scratch, num_scratch): Delete variables.
	(life_analysis_1): Don't initialize max_scratch.
	(propagate_block): Don't update max_scratch.
	(mark_set_1): Don't increment num_scratch.
	* regs.h (max_scratch): Delete declaration.

From-SVN: r23172
parent 02bc9733
Mon Oct 19 10:45:40 1998 Bernd Schmidt <crux@pool.informatik.rwth-aachen.de>
* combine.c (recog_for_combine): Lose PADDED_SCRATCHES arg. All
callers changed.
(try_combine): Don't update max_scratch.
* flow.c (max_scratch, num_scratch): Delete variables.
(life_analysis_1): Don't initialize max_scratch.
(propagate_block): Don't update max_scratch.
(mark_set_1): Don't increment num_scratch.
* regs.h (max_scratch): Delete declaration.
Mon Oct 19 10:28:15 1998 Jeffrey A Law (law@cygnus.com) Mon Oct 19 10:28:15 1998 Jeffrey A Law (law@cygnus.com)
* sched.c (update_flow_info): Handle death notes made invalid by * sched.c (update_flow_info): Handle death notes made invalid by
......
...@@ -426,7 +426,7 @@ static int merge_outer_ops PROTO((enum rtx_code *, HOST_WIDE_INT *, ...@@ -426,7 +426,7 @@ static int merge_outer_ops PROTO((enum rtx_code *, HOST_WIDE_INT *,
enum machine_mode, int *)); enum machine_mode, int *));
static rtx simplify_shift_const PROTO((rtx, enum rtx_code, enum machine_mode, static rtx simplify_shift_const PROTO((rtx, enum rtx_code, enum machine_mode,
rtx, int)); rtx, int));
static int recog_for_combine PROTO((rtx *, rtx, rtx *, int *)); static int recog_for_combine PROTO((rtx *, rtx, rtx *));
static rtx gen_lowpart_for_combine PROTO((enum machine_mode, rtx)); static rtx gen_lowpart_for_combine PROTO((enum machine_mode, rtx));
static rtx gen_rtx_combine PVPROTO((enum rtx_code code, enum machine_mode mode, static rtx gen_rtx_combine PVPROTO((enum rtx_code code, enum machine_mode mode,
...)); ...));
...@@ -1356,8 +1356,6 @@ try_combine (i3, i2, i1) ...@@ -1356,8 +1356,6 @@ try_combine (i3, i2, i1)
int i3_subst_into_i2 = 0; int i3_subst_into_i2 = 0;
/* Notes that I1, I2 or I3 is a MULT operation. */ /* Notes that I1, I2 or I3 is a MULT operation. */
int have_mult = 0; int have_mult = 0;
/* Number of clobbers of SCRATCH we had to add. */
int i3_scratches = 0, i2_scratches = 0, other_scratches = 0;
int maxreg; int maxreg;
rtx temp; rtx temp;
...@@ -1834,8 +1832,7 @@ try_combine (i3, i2, i1) ...@@ -1834,8 +1832,7 @@ try_combine (i3, i2, i1)
mark_used_regs_combine (newpat); mark_used_regs_combine (newpat);
/* Is the result of combination a valid instruction? */ /* Is the result of combination a valid instruction? */
insn_code_number insn_code_number = recog_for_combine (&newpat, i3, &new_i3_notes);
= recog_for_combine (&newpat, i3, &new_i3_notes, &i3_scratches);
/* If the result isn't valid, see if it is a PARALLEL of two SETs where /* If the result isn't valid, see if it is a PARALLEL of two SETs where
the second SET's destination is a register that is unused. In that case, the second SET's destination is a register that is unused. In that case,
...@@ -1856,8 +1853,7 @@ try_combine (i3, i2, i1) ...@@ -1856,8 +1853,7 @@ try_combine (i3, i2, i1)
&& asm_noperands (newpat) < 0) && asm_noperands (newpat) < 0)
{ {
newpat = XVECEXP (newpat, 0, 0); newpat = XVECEXP (newpat, 0, 0);
insn_code_number insn_code_number = recog_for_combine (&newpat, i3, &new_i3_notes);
= recog_for_combine (&newpat, i3, &new_i3_notes, &i3_scratches);
} }
else if (insn_code_number < 0 && GET_CODE (newpat) == PARALLEL else if (insn_code_number < 0 && GET_CODE (newpat) == PARALLEL
...@@ -1870,8 +1866,7 @@ try_combine (i3, i2, i1) ...@@ -1870,8 +1866,7 @@ try_combine (i3, i2, i1)
&& asm_noperands (newpat) < 0) && asm_noperands (newpat) < 0)
{ {
newpat = XVECEXP (newpat, 0, 1); newpat = XVECEXP (newpat, 0, 1);
insn_code_number insn_code_number = recog_for_combine (&newpat, i3, &new_i3_notes);
= recog_for_combine (&newpat, i3, &new_i3_notes, &i3_scratches);
} }
/* If we were combining three insns and the result is a simple SET /* If we were combining three insns and the result is a simple SET
...@@ -1940,8 +1935,7 @@ try_combine (i3, i2, i1) ...@@ -1940,8 +1935,7 @@ try_combine (i3, i2, i1)
if (REGNO (i2dest) >= FIRST_PSEUDO_REGISTER) if (REGNO (i2dest) >= FIRST_PSEUDO_REGISTER)
SUBST (regno_reg_rtx[REGNO (i2dest)], ni2dest); SUBST (regno_reg_rtx[REGNO (i2dest)], ni2dest);
i2_code_number = recog_for_combine (&newi2pat, i2, &new_i2_notes, i2_code_number = recog_for_combine (&newi2pat, i2, &new_i2_notes);
&i2_scratches);
/* If I2 or I3 has multiple SETs, we won't know how to track /* If I2 or I3 has multiple SETs, we won't know how to track
register status, so don't use these insns. If I2's destination register status, so don't use these insns. If I2's destination
...@@ -1950,8 +1944,8 @@ try_combine (i3, i2, i1) ...@@ -1950,8 +1944,8 @@ try_combine (i3, i2, i1)
if (i2_code_number >= 0 && i2set && i3set if (i2_code_number >= 0 && i2set && i3set
&& (next_real_insn (i2) == i3 && (next_real_insn (i2) == i3
|| ! reg_used_between_p (SET_DEST (i2set), i2, i3))) || ! reg_used_between_p (SET_DEST (i2set), i2, i3)))
insn_code_number = recog_for_combine (&newi3pat, i3, &new_i3_notes, insn_code_number = recog_for_combine (&newi3pat, i3,
&i3_scratches); &new_i3_notes);
if (insn_code_number >= 0) if (insn_code_number >= 0)
newpat = newi3pat; newpat = newi3pat;
...@@ -2038,14 +2032,12 @@ try_combine (i3, i2, i1) ...@@ -2038,14 +2032,12 @@ try_combine (i3, i2, i1)
newi2pat = gen_rtx_combine (SET, VOIDmode, newdest, *split); newi2pat = gen_rtx_combine (SET, VOIDmode, newdest, *split);
SUBST (*split, newdest); SUBST (*split, newdest);
i2_code_number i2_code_number = recog_for_combine (&newi2pat, i2, &new_i2_notes);
= recog_for_combine (&newi2pat, i2, &new_i2_notes, &i2_scratches);
/* If the split point was a MULT and we didn't have one before, /* If the split point was a MULT and we didn't have one before,
don't use one now. */ don't use one now. */
if (i2_code_number >= 0 && ! (split_code == MULT && ! have_mult)) if (i2_code_number >= 0 && ! (split_code == MULT && ! have_mult))
insn_code_number insn_code_number = recog_for_combine (&newpat, i3, &new_i3_notes);
= recog_for_combine (&newpat, i3, &new_i3_notes, &i3_scratches);
} }
} }
...@@ -2099,12 +2091,10 @@ try_combine (i3, i2, i1) ...@@ -2099,12 +2091,10 @@ try_combine (i3, i2, i1)
newpat = XVECEXP (newpat, 0, 1); newpat = XVECEXP (newpat, 0, 1);
SUBST (SET_SRC (newpat), SUBST (SET_SRC (newpat),
gen_lowpart_for_combine (GET_MODE (SET_SRC (newpat)), ni2dest)); gen_lowpart_for_combine (GET_MODE (SET_SRC (newpat)), ni2dest));
i2_code_number i2_code_number = recog_for_combine (&newi2pat, i2, &new_i2_notes);
= recog_for_combine (&newi2pat, i2, &new_i2_notes, &i2_scratches);
if (i2_code_number >= 0) if (i2_code_number >= 0)
insn_code_number insn_code_number = recog_for_combine (&newpat, i3, &new_i3_notes);
= recog_for_combine (&newpat, i3, &new_i3_notes, &i3_scratches);
if (insn_code_number >= 0) if (insn_code_number >= 0)
{ {
...@@ -2191,12 +2181,10 @@ try_combine (i3, i2, i1) ...@@ -2191,12 +2181,10 @@ try_combine (i3, i2, i1)
newpat = XVECEXP (newpat, 0, 0); newpat = XVECEXP (newpat, 0, 0);
} }
i2_code_number i2_code_number = recog_for_combine (&newi2pat, i2, &new_i2_notes);
= recog_for_combine (&newi2pat, i2, &new_i2_notes, &i2_scratches);
if (i2_code_number >= 0) if (i2_code_number >= 0)
insn_code_number insn_code_number = recog_for_combine (&newpat, i3, &new_i3_notes);
= recog_for_combine (&newpat, i3, &new_i3_notes, &i3_scratches);
} }
/* If it still isn't recognized, fail and change things back the way they /* If it still isn't recognized, fail and change things back the way they
...@@ -2218,9 +2206,8 @@ try_combine (i3, i2, i1) ...@@ -2218,9 +2206,8 @@ try_combine (i3, i2, i1)
CLEAR_HARD_REG_SET (newpat_used_regs); CLEAR_HARD_REG_SET (newpat_used_regs);
other_code_number other_code_number = recog_for_combine (&other_pat, undobuf.other_insn,
= recog_for_combine (&other_pat, undobuf.other_insn, &new_other_notes);
&new_other_notes, &other_scratches);
if (other_code_number < 0 && ! check_asm_operands (other_pat)) if (other_code_number < 0 && ! check_asm_operands (other_pat))
{ {
...@@ -2537,12 +2524,6 @@ try_combine (i3, i2, i1) ...@@ -2537,12 +2524,6 @@ try_combine (i3, i2, i1)
if (newi2pat) if (newi2pat)
note_stores (newi2pat, set_nonzero_bits_and_sign_copies); note_stores (newi2pat, set_nonzero_bits_and_sign_copies);
/* If we added any (clobber (scratch)), add them to the max for a
block. This is a very pessimistic calculation, since we might
have had them already and this might not be the worst block, but
it's not worth doing any better. */
max_scratch += i3_scratches + i2_scratches + other_scratches;
/* If I3 is now an unconditional jump, ensure that it has a /* If I3 is now an unconditional jump, ensure that it has a
BARRIER following it since it may have initially been a BARRIER following it since it may have initially been a
conditional jump. It may also be the last nonnote insn. */ conditional jump. It may also be the last nonnote insn. */
...@@ -4653,7 +4634,7 @@ simplify_set (x) ...@@ -4653,7 +4634,7 @@ simplify_set (x)
rtx pat = PATTERN (other_insn), note = 0; rtx pat = PATTERN (other_insn), note = 0;
int scratches; int scratches;
if ((recog_for_combine (&pat, other_insn, &note, &scratches) < 0 if ((recog_for_combine (&pat, other_insn, &note) < 0
&& ! check_asm_operands (pat))) && ! check_asm_operands (pat)))
{ {
PUT_CODE (*cc_use, old_code); PUT_CODE (*cc_use, old_code);
...@@ -9052,18 +9033,14 @@ simplify_shift_const (x, code, result_mode, varop, count) ...@@ -9052,18 +9033,14 @@ simplify_shift_const (x, code, result_mode, varop, count)
PNOTES is a pointer to a location where any REG_UNUSED notes added for PNOTES is a pointer to a location where any REG_UNUSED notes added for
the CLOBBERs are placed. the CLOBBERs are placed.
PADDED_SCRATCHES is set to the number of (clobber (scratch)) patterns
we had to add.
The value is the final insn code from the pattern ultimately matched, The value is the final insn code from the pattern ultimately matched,
or -1. */ or -1. */
static int static int
recog_for_combine (pnewpat, insn, pnotes, padded_scratches) recog_for_combine (pnewpat, insn, pnotes)
rtx *pnewpat; rtx *pnewpat;
rtx insn; rtx insn;
rtx *pnotes; rtx *pnotes;
int *padded_scratches;
{ {
register rtx pat = *pnewpat; register rtx pat = *pnewpat;
int insn_code_number; int insn_code_number;
...@@ -9071,8 +9048,6 @@ recog_for_combine (pnewpat, insn, pnotes, padded_scratches) ...@@ -9071,8 +9048,6 @@ recog_for_combine (pnewpat, insn, pnotes, padded_scratches)
int i; int i;
rtx notes = 0; rtx notes = 0;
*padded_scratches = 0;
/* If PAT is a PARALLEL, check to see if it contains the CLOBBER /* If PAT is a PARALLEL, check to see if it contains the CLOBBER
we use to indicate that something didn't match. If we find such a we use to indicate that something didn't match. If we find such a
thing, force rejection. */ thing, force rejection. */
...@@ -9134,8 +9109,6 @@ recog_for_combine (pnewpat, insn, pnotes, padded_scratches) ...@@ -9134,8 +9109,6 @@ recog_for_combine (pnewpat, insn, pnotes, padded_scratches)
if (GET_CODE (XEXP (XVECEXP (newpat, 0, i), 0)) == REG if (GET_CODE (XEXP (XVECEXP (newpat, 0, i), 0)) == REG
&& ! reg_dead_at_p (XEXP (XVECEXP (newpat, 0, i), 0), insn)) && ! reg_dead_at_p (XEXP (XVECEXP (newpat, 0, i), 0), insn))
return -1; return -1;
else if (GET_CODE (XEXP (XVECEXP (newpat, 0, i), 0)) == SCRATCH)
(*padded_scratches)++;
notes = gen_rtx_EXPR_LIST (REG_UNUSED, notes = gen_rtx_EXPR_LIST (REG_UNUSED,
XEXP (XVECEXP (newpat, 0, i), 0), notes); XEXP (XVECEXP (newpat, 0, i), 0), notes);
} }
......
...@@ -167,15 +167,6 @@ int n_basic_blocks; ...@@ -167,15 +167,6 @@ int n_basic_blocks;
int max_regno; int max_regno;
/* Maximum number of SCRATCH rtx's used in any basic block of this
function. */
int max_scratch;
/* Number of SCRATCH rtx's in the current block. */
static int num_scratch;
/* Indexed by n, giving various register information */ /* Indexed by n, giving various register information */
varray_type reg_n_info; varray_type reg_n_info;
...@@ -1544,8 +1535,6 @@ life_analysis_1 (f, nregs) ...@@ -1544,8 +1535,6 @@ life_analysis_1 (f, nregs)
basic_block_live_at_start[i]). This is ok now because basic_block_live_at_start[i]). This is ok now because
basic_block_live_at_end[i] is no longer used past this point. */ basic_block_live_at_end[i] is no longer used past this point. */
max_scratch = 0;
for (i = 0; i < n_basic_blocks; i++) for (i = 0; i < n_basic_blocks; i++)
{ {
propagate_block (basic_block_live_at_end[i], propagate_block (basic_block_live_at_end[i],
...@@ -1733,8 +1722,6 @@ propagate_block (old, first, last, final, significant, bnum) ...@@ -1733,8 +1722,6 @@ propagate_block (old, first, last, final, significant, bnum)
{ {
register int i; register int i;
num_scratch = 0;
/* Process the regs live at the end of the block. /* Process the regs live at the end of the block.
Mark them as not local to any one basic block. */ Mark them as not local to any one basic block. */
EXECUTE_IF_SET_IN_REG_SET (old, 0, i, EXECUTE_IF_SET_IN_REG_SET (old, 0, i,
...@@ -1962,9 +1949,6 @@ propagate_block (old, first, last, final, significant, bnum) ...@@ -1962,9 +1949,6 @@ propagate_block (old, first, last, final, significant, bnum)
FREE_REG_SET (dead); FREE_REG_SET (dead);
FREE_REG_SET (live); FREE_REG_SET (live);
if (num_scratch > max_scratch)
max_scratch = num_scratch;
} }
/* Return 1 if X (the body of an insn, or part of it) is just dead stores /* Return 1 if X (the body of an insn, or part of it) is just dead stores
...@@ -2412,7 +2396,6 @@ mark_set_1 (needed, dead, x, insn, significant) ...@@ -2412,7 +2396,6 @@ mark_set_1 (needed, dead, x, insn, significant)
{ {
REG_NOTES (insn) REG_NOTES (insn)
= gen_rtx_EXPR_LIST (REG_UNUSED, reg, REG_NOTES (insn)); = gen_rtx_EXPR_LIST (REG_UNUSED, reg, REG_NOTES (insn));
num_scratch++;
} }
} }
......
...@@ -38,10 +38,6 @@ Boston, MA 02111-1307, USA. */ ...@@ -38,10 +38,6 @@ Boston, MA 02111-1307, USA. */
extern int max_regno; extern int max_regno;
/* Maximum number of SCRATCH rtx's in each block of this function. */
extern int max_scratch;
/* Register information indexed by register number */ /* Register information indexed by register number */
typedef struct reg_info_def { typedef struct reg_info_def {
/* fields set by reg_scan */ /* fields set by reg_scan */
......
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