Commit dc782dcd by Kazu Hirata Committed by Kazu Hirata

rtlanal.c (replace_reg): Remove.

	* rtlanal.c (replace_reg): Remove.
	* rtl.h: Remove the prototype for replace_reg.

From-SVN: r111730
parent 3c491cab
2006-03-05 Kazu Hirata <kazu@codesourcery.com>
* rtlanal.c (replace_reg): Remove.
* rtl.h: Remove the prototype for replace_reg.
2006-03-05 Kazu Hirata <kazu@codesourcery.com>
* regclass.c (reg_scan_update): Remove.
(reg_scan_mark_refs): Remove the last argument.
* rtl.h: Remove the prototype for reg_scan_update.
......
......@@ -1723,7 +1723,6 @@ extern int may_trap_after_code_motion_p (rtx);
extern int may_trap_or_fault_p (rtx);
extern int inequality_comparisons_p (rtx);
extern rtx replace_rtx (rtx, rtx, rtx);
extern rtx replace_regs (rtx, rtx *, unsigned int, int);
extern int replace_label (rtx *, void *);
extern int rtx_referenced_p (rtx, rtx);
extern bool tablejump_p (rtx, rtx *, rtx *);
......
......@@ -2371,106 +2371,6 @@ replace_rtx (rtx x, rtx from, rtx to)
return x;
}
/* Throughout the rtx X, replace many registers according to REG_MAP.
Return the replacement for X (which may be X with altered contents).
REG_MAP[R] is the replacement for register R, or 0 for don't replace.
NREGS is the length of REG_MAP; regs >= NREGS are not mapped.
We only support REG_MAP entries of REG or SUBREG. Also, hard registers
should not be mapped to pseudos or vice versa since validate_change
is not called.
If REPLACE_DEST is 1, replacements are also done in destinations;
otherwise, only sources are replaced. */
rtx
replace_regs (rtx x, rtx *reg_map, unsigned int nregs, int replace_dest)
{
enum rtx_code code;
int i;
const char *fmt;
if (x == 0)
return x;
code = GET_CODE (x);
switch (code)
{
case SCRATCH:
case PC:
case CC0:
case CONST_INT:
case CONST_DOUBLE:
case CONST_VECTOR:
case CONST:
case SYMBOL_REF:
case LABEL_REF:
return x;
case REG:
/* Verify that the register has an entry before trying to access it. */
if (REGNO (x) < nregs && reg_map[REGNO (x)] != 0)
{
/* SUBREGs can't be shared. Always return a copy to ensure that if
this replacement occurs more than once then each instance will
get distinct rtx. */
if (GET_CODE (reg_map[REGNO (x)]) == SUBREG)
return copy_rtx (reg_map[REGNO (x)]);
return reg_map[REGNO (x)];
}
return x;
case SUBREG:
/* Prevent making nested SUBREGs. */
if (REG_P (SUBREG_REG (x)) && REGNO (SUBREG_REG (x)) < nregs
&& reg_map[REGNO (SUBREG_REG (x))] != 0
&& GET_CODE (reg_map[REGNO (SUBREG_REG (x))]) == SUBREG)
{
rtx map_val = reg_map[REGNO (SUBREG_REG (x))];
return simplify_gen_subreg (GET_MODE (x), map_val,
GET_MODE (SUBREG_REG (x)),
SUBREG_BYTE (x));
}
break;
case SET:
if (replace_dest)
SET_DEST (x) = replace_regs (SET_DEST (x), reg_map, nregs, 0);
else if (MEM_P (SET_DEST (x))
|| GET_CODE (SET_DEST (x)) == STRICT_LOW_PART)
/* Even if we are not to replace destinations, replace register if it
is CONTAINED in destination (destination is memory or
STRICT_LOW_PART). */
XEXP (SET_DEST (x), 0) = replace_regs (XEXP (SET_DEST (x), 0),
reg_map, nregs, 0);
else if (GET_CODE (SET_DEST (x)) == ZERO_EXTRACT)
/* Similarly, for ZERO_EXTRACT we replace all operands. */
break;
SET_SRC (x) = replace_regs (SET_SRC (x), reg_map, nregs, 0);
return x;
default:
break;
}
fmt = GET_RTX_FORMAT (code);
for (i = GET_RTX_LENGTH (code) - 1; i >= 0; i--)
{
if (fmt[i] == 'e')
XEXP (x, i) = replace_regs (XEXP (x, i), reg_map, nregs, replace_dest);
else if (fmt[i] == 'E')
{
int j;
for (j = 0; j < XVECLEN (x, i); j++)
XVECEXP (x, i, j) = replace_regs (XVECEXP (x, i, j), reg_map,
nregs, replace_dest);
}
}
return x;
}
/* Replace occurrences of the old label in *X with the new one.
DATA is a REPLACE_LABEL_DATA containing the old and new labels. */
......
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