mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-01-25 07:34:00 +08:00
cselib.c (clear_table): Do not take argument; always clear just used slots.
* cselib.c (clear_table): Do not take argument; always clear just used slots. (cselib_process_insn): Update call of clear_table (cselib_init): Do not call clear_table. (cselib_finish): Clear table. * cse.c (count_reg_usage): Do not check side_effects_p. * rtlanal.c (set_noop_p): Check side_effects_p only when set looks like noop. (find_reg_equal_equiv_note): Do not use find_reg_note. From-SVN: r64369
This commit is contained in:
parent
82c34dcb17
commit
cd648cec5c
@ -1,3 +1,16 @@
|
||||
Thu Mar 13 18:39:42 CET 2003 Jan Hubicka <jh@suse.cz>
|
||||
|
||||
* cselib.c (clear_table): Do not take argument; always clear just
|
||||
used slots.
|
||||
(cselib_process_insn): Update call of clear_table
|
||||
(cselib_init): Do not call clear_table.
|
||||
(cselib_finish): Clear table.
|
||||
|
||||
* cse.c (count_reg_usage): Do not check side_effects_p.
|
||||
* rtlanal.c (set_noop_p): Check side_effects_p only when set looks
|
||||
like noop.
|
||||
(find_reg_equal_equiv_note): Do not use find_reg_note.
|
||||
|
||||
2003-03-14 Richard Henderson <rth@redhat.com>
|
||||
|
||||
PR target/9700
|
||||
|
@ -7494,15 +7494,8 @@ count_reg_usage (x, counts, dest, incr)
|
||||
/* Unless we are setting a REG, count everything in SET_DEST. */
|
||||
if (GET_CODE (SET_DEST (x)) != REG)
|
||||
count_reg_usage (SET_DEST (x), counts, NULL_RTX, incr);
|
||||
|
||||
/* If SRC has side-effects, then we can't delete this insn, so the
|
||||
usage of SET_DEST inside SRC counts.
|
||||
|
||||
??? Strictly-speaking, we might be preserving this insn
|
||||
because some other SET has side-effects, but that's hard
|
||||
to do and can't happen now. */
|
||||
count_reg_usage (SET_SRC (x), counts,
|
||||
side_effects_p (SET_SRC (x)) ? NULL_RTX : SET_DEST (x),
|
||||
SET_DEST (x),
|
||||
incr);
|
||||
return;
|
||||
|
||||
|
19
gcc/cselib.c
19
gcc/cselib.c
@ -49,7 +49,7 @@ static struct elt_loc_list *new_elt_loc_list PARAMS ((struct elt_loc_list *,
|
||||
static void unchain_one_value PARAMS ((cselib_val *));
|
||||
static void unchain_one_elt_list PARAMS ((struct elt_list **));
|
||||
static void unchain_one_elt_loc_list PARAMS ((struct elt_loc_list **));
|
||||
static void clear_table PARAMS ((int));
|
||||
static void clear_table PARAMS ((void));
|
||||
static int discard_useless_locs PARAMS ((void **, void *));
|
||||
static int discard_useless_values PARAMS ((void **, void *));
|
||||
static void remove_useless_values PARAMS ((void));
|
||||
@ -224,17 +224,12 @@ unchain_one_value (v)
|
||||
which are known to have been used. */
|
||||
|
||||
static void
|
||||
clear_table (clear_all)
|
||||
int clear_all;
|
||||
clear_table ()
|
||||
{
|
||||
unsigned int i;
|
||||
|
||||
if (clear_all)
|
||||
for (i = 0; i < cselib_nregs; i++)
|
||||
REG_VALUES (i) = 0;
|
||||
else
|
||||
for (i = 0; i < VARRAY_ACTIVE_SIZE (used_regs); i++)
|
||||
REG_VALUES (VARRAY_UINT (used_regs, i)) = 0;
|
||||
for (i = 0; i < VARRAY_ACTIVE_SIZE (used_regs); i++)
|
||||
REG_VALUES (VARRAY_UINT (used_regs, i)) = 0;
|
||||
|
||||
max_value_regs = 0;
|
||||
|
||||
@ -1359,7 +1354,7 @@ cselib_process_insn (insn)
|
||||
&& GET_CODE (PATTERN (insn)) == ASM_OPERANDS
|
||||
&& MEM_VOLATILE_P (PATTERN (insn))))
|
||||
{
|
||||
clear_table (0);
|
||||
clear_table ();
|
||||
return;
|
||||
}
|
||||
|
||||
@ -1437,8 +1432,6 @@ cselib_init ()
|
||||
{
|
||||
reg_values = reg_values_old;
|
||||
used_regs = used_regs_old;
|
||||
VARRAY_CLEAR (reg_values);
|
||||
VARRAY_CLEAR (used_regs);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1447,7 +1440,6 @@ cselib_init ()
|
||||
}
|
||||
hash_table = htab_create_ggc (31, get_value_hash, entry_and_rtx_equal_p,
|
||||
NULL);
|
||||
clear_table (1);
|
||||
cselib_current_insn_in_libcall = false;
|
||||
}
|
||||
|
||||
@ -1456,6 +1448,7 @@ cselib_init ()
|
||||
void
|
||||
cselib_finish ()
|
||||
{
|
||||
clear_table ();
|
||||
reg_values_old = reg_values;
|
||||
reg_values = 0;
|
||||
used_regs_old = used_regs;
|
||||
|
@ -1327,19 +1327,17 @@ set_noop_p (set)
|
||||
rtx src = SET_SRC (set);
|
||||
rtx dst = SET_DEST (set);
|
||||
|
||||
if (side_effects_p (src) || side_effects_p (dst))
|
||||
return 0;
|
||||
|
||||
if (GET_CODE (dst) == MEM && GET_CODE (src) == MEM)
|
||||
return rtx_equal_p (dst, src);
|
||||
|
||||
if (dst == pc_rtx && src == pc_rtx)
|
||||
return 1;
|
||||
|
||||
if (GET_CODE (dst) == MEM && GET_CODE (src) == MEM)
|
||||
return rtx_equal_p (dst, src) && !side_effects_p (dst);
|
||||
|
||||
if (GET_CODE (dst) == SIGN_EXTRACT
|
||||
|| GET_CODE (dst) == ZERO_EXTRACT)
|
||||
return rtx_equal_p (XEXP (dst, 0), src)
|
||||
&& ! BYTES_BIG_ENDIAN && XEXP (dst, 2) == const0_rtx;
|
||||
&& ! BYTES_BIG_ENDIAN && XEXP (dst, 2) == const0_rtx
|
||||
&& !side_effects_p (src);
|
||||
|
||||
if (GET_CODE (dst) == STRICT_LOW_PART)
|
||||
dst = XEXP (dst, 0);
|
||||
@ -2018,14 +2016,19 @@ rtx
|
||||
find_reg_equal_equiv_note (insn)
|
||||
rtx insn;
|
||||
{
|
||||
rtx note;
|
||||
rtx link;
|
||||
|
||||
if (single_set (insn) == 0)
|
||||
if (!INSN_P (insn))
|
||||
return 0;
|
||||
else if ((note = find_reg_note (insn, REG_EQUIV, NULL_RTX)) != 0)
|
||||
return note;
|
||||
else
|
||||
return find_reg_note (insn, REG_EQUAL, NULL_RTX);
|
||||
for (link = REG_NOTES (insn); link; link = XEXP (link, 1))
|
||||
if (REG_NOTE_KIND (link) == REG_EQUAL
|
||||
|| REG_NOTE_KIND (link) == REG_EQUIV)
|
||||
{
|
||||
if (single_set (insn) == 0)
|
||||
return 0;
|
||||
return link;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* Return true if DATUM, or any overlap of DATUM, of kind CODE is found
|
||||
|
Loading…
Reference in New Issue
Block a user