Commit d64d5e80 by Daniel Jacobowitz Committed by Daniel Jacobowitz

regrename.c (kill_value_one_regno): Renamed from kill_value_regno.

	* regrename.c (kill_value_one_regno): Renamed from kill_value_regno.
	(kill_value_regno): New function, derived from kill_value.
	(kill_value): Update.
	(copyprop_hardreg_forward_1): Update call to kill_value_regno.

From-SVN: r86332
parent af75a7ea
2004-08-20 Daniel Jacobowitz <dan@debian.org>
* regrename.c (kill_value_one_regno): Renamed from kill_value_regno.
(kill_value_regno): New function, derived from kill_value.
(kill_value): Update.
(copyprop_hardreg_forward_1): Update call to kill_value_regno.
2004-08-20 Daniel Berlin <dberlin@dberlin.org>
Fix PR tree-optimization/17111
......
......@@ -1010,7 +1010,8 @@ struct value_data
unsigned int max_value_regs;
};
static void kill_value_regno (unsigned, struct value_data *);
static void kill_value_one_regno (unsigned, struct value_data *);
static void kill_value_regno (unsigned, unsigned, struct value_data *);
static void kill_value (rtx, struct value_data *);
static void set_value_regno (unsigned, enum machine_mode, struct value_data *);
static void init_value_data (struct value_data *);
......@@ -1035,11 +1036,13 @@ extern void debug_value_data (struct value_data *);
static void validate_value_data (struct value_data *);
#endif
/* Kill register REGNO. This involves removing it from any value lists,
and resetting the value mode to VOIDmode. */
/* Kill register REGNO. This involves removing it from any value
lists, and resetting the value mode to VOIDmode. This is only a
helper function; it does not handle any hard registers overlapping
with REGNO. */
static void
kill_value_regno (unsigned int regno, struct value_data *vd)
kill_value_one_regno (unsigned int regno, struct value_data *vd)
{
unsigned int i, next;
......@@ -1066,29 +1069,20 @@ kill_value_regno (unsigned int regno, struct value_data *vd)
#endif
}
/* Kill X. This is a convenience function for kill_value_regno
so that we mind the mode the register is in. */
/* Kill the value in register REGNO for NREGS, and any other registers
whose values overlap. */
static void
kill_value (rtx x, struct value_data *vd)
kill_value_regno (regno, nregs, vd)
unsigned int regno;
unsigned int nregs;
struct value_data *vd;
{
/* SUBREGS are supposed to have been eliminated by now. But some
ports, e.g. i386 sse, use them to smuggle vector type information
through to instruction selection. Each such SUBREG should simplify,
so if we get a NULL we've done something wrong elsewhere. */
if (GET_CODE (x) == SUBREG)
x = simplify_subreg (GET_MODE (x), SUBREG_REG (x),
GET_MODE (SUBREG_REG (x)), SUBREG_BYTE (x));
if (REG_P (x))
{
unsigned int regno = REGNO (x);
unsigned int n = hard_regno_nregs[regno][GET_MODE (x)];
unsigned int i, j;
unsigned int j;
/* Kill the value we're told to kill. */
for (i = 0; i < n; ++i)
kill_value_regno (regno + i, vd);
for (j = 0; j < nregs; ++j)
kill_value_one_regno (regno + j, vd);
/* Kill everything that overlapped what we're told to kill. */
if (regno < vd->max_value_regs)
......@@ -1097,13 +1091,36 @@ kill_value (rtx x, struct value_data *vd)
j = regno - vd->max_value_regs;
for (; j < regno; ++j)
{
unsigned int i, n;
if (vd->e[j].mode == VOIDmode)
continue;
n = hard_regno_nregs[j][vd->e[j].mode];
if (j + n > regno)
for (i = 0; i < n; ++i)
kill_value_regno (j + i, vd);
kill_value_one_regno (j + i, vd);
}
}
/* Kill X. This is a convenience function wrapping kill_value_regno
so that we mind the mode the register is in. */
static void
kill_value (rtx x, struct value_data *vd)
{
/* SUBREGS are supposed to have been eliminated by now. But some
ports, e.g. i386 sse, use them to smuggle vector type information
through to instruction selection. Each such SUBREG should simplify,
so if we get a NULL we've done something wrong elsewhere. */
if (GET_CODE (x) == SUBREG)
x = simplify_subreg (GET_MODE (x), SUBREG_REG (x),
GET_MODE (SUBREG_REG (x)), SUBREG_BYTE (x));
if (REG_P (x))
{
unsigned int regno = REGNO (x);
unsigned int n = hard_regno_nregs[regno][GET_MODE (x)];
kill_value_regno (regno, n, vd);
}
}
......@@ -1703,7 +1720,7 @@ copyprop_hardreg_forward_1 (basic_block bb, struct value_data *vd)
if (CALL_P (insn))
for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
if (TEST_HARD_REG_BIT (regs_invalidated_by_call, i))
kill_value_regno (i, vd);
kill_value_regno (i, 1, vd);
/* Notice stores. */
note_stores (PATTERN (insn), kill_set_value, vd);
......
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