Commit 6f5c1520 by Richard Sandiford Committed by Richard Sandiford

df.h (df_mw_hardreg): Remove "loc" field.

gcc/
	* df.h (df_mw_hardreg): Remove "loc" field.
	* df-scan.c (df_ref_record): Don't set it.  Remove redundant
	local variable.
	* df-problems.c (df_whole_mw_reg_unused_p): New function,
	split out from df_set_unused_notes_for_mw.  Return false for
	partial references.  Assert that mw_reg is a REG when returning true.
	(df_set_unused_notes_for_mw): Use it.  Use mw_reg instead of *loc.
	(df_whole_mw_reg_dead_p): New function, split out from
	df_set_dead_notes_for_mw.  Return false for partial references.
	Assert that mw_reg is a REG when returning true.
	(df_set_dead_notes_for_mw): Use it.  Use mw_reg instead of *loc.
	Remove redundant bitmap check.

From-SVN: r126970
parent 23815ffe
2007-07-27 Richard Sandiford <rsandifo@nildram.co.uk>
* df.h (df_mw_hardreg): Remove "loc" field.
* df-scan.c (df_ref_record): Don't set it. Remove redundant
local variable.
* df-problems.c (df_whole_mw_reg_unused_p): New function,
split out from df_set_unused_notes_for_mw. Return false for
partial references. Assert that mw_reg is a REG when returning true.
(df_set_unused_notes_for_mw): Use it. Use mw_reg instead of *loc.
(df_whole_mw_reg_dead_p): New function, split out from
df_set_dead_notes_for_mw. Return false for partial references.
Assert that mw_reg is a REG when returning true.
(df_set_dead_notes_for_mw): Use it. Use mw_reg instead of *loc.
Remove redundant bitmap check.
2007-07-26 H.J. Lu <hongjiu.lu@intel.com> 2007-07-26 H.J. Lu <hongjiu.lu@intel.com>
* config/ia64/t-ia64 ($(T)crtbegin.o): Removed. * config/ia64/t-ia64 ($(T)crtbegin.o): Removed.
......
...@@ -3716,6 +3716,32 @@ df_set_note (enum reg_note note_type, rtx insn, rtx old, rtx reg) ...@@ -3716,6 +3716,32 @@ df_set_note (enum reg_note note_type, rtx insn, rtx old, rtx reg)
return old; return old;
} }
/* A subroutine of df_set_unused_notes_for_mw, with a selection of its
arguments. Return true if the register value described by MWS's
mw_reg is known to be completely unused, and if mw_reg can therefore
be used in a REG_UNUSED note. */
static bool
df_whole_mw_reg_unused_p (struct df_mw_hardreg *mws,
bitmap live, bitmap artificial_uses)
{
unsigned int r;
/* If MWS describes a partial reference, create REG_UNUSED notes for
individual hard registers. */
if (mws->flags & DF_REF_PARTIAL)
return false;
/* Likewise if some part of the register is used. */
for (r = mws->start_regno; r <= mws->end_regno; r++)
if (bitmap_bit_p (live, r)
|| bitmap_bit_p (artificial_uses, r))
return false;
gcc_assert (REG_P (mws->mw_reg));
return true;
}
/* Set the REG_UNUSED notes for the multiword hardreg defs in INSN /* Set the REG_UNUSED notes for the multiword hardreg defs in INSN
based on the bits in LIVE. Do not generate notes for registers in based on the bits in LIVE. Do not generate notes for registers in
artificial uses. DO_NOT_GEN is updated so that REG_DEAD notes are artificial uses. DO_NOT_GEN is updated so that REG_DEAD notes are
...@@ -3728,7 +3754,6 @@ df_set_unused_notes_for_mw (rtx insn, rtx old, struct df_mw_hardreg *mws, ...@@ -3728,7 +3754,6 @@ df_set_unused_notes_for_mw (rtx insn, rtx old, struct df_mw_hardreg *mws,
bitmap live, bitmap do_not_gen, bitmap live, bitmap do_not_gen,
bitmap artificial_uses) bitmap artificial_uses)
{ {
bool all_dead = true;
unsigned int r; unsigned int r;
#ifdef REG_DEAD_DEBUGGING #ifdef REG_DEAD_DEBUGGING
...@@ -3736,18 +3761,11 @@ df_set_unused_notes_for_mw (rtx insn, rtx old, struct df_mw_hardreg *mws, ...@@ -3736,18 +3761,11 @@ df_set_unused_notes_for_mw (rtx insn, rtx old, struct df_mw_hardreg *mws,
fprintf (dump_file, "mw_set_unused looking at mws[%d..%d]\n", fprintf (dump_file, "mw_set_unused looking at mws[%d..%d]\n",
mws->start_regno, mws->end_regno); mws->start_regno, mws->end_regno);
#endif #endif
for (r=mws->start_regno; r <= mws->end_regno; r++)
if ((bitmap_bit_p (live, r)) if (df_whole_mw_reg_unused_p (mws, live, artificial_uses))
|| bitmap_bit_p (artificial_uses, r))
{
all_dead = false;
break;
}
if (all_dead)
{ {
unsigned int regno = mws->start_regno; unsigned int regno = mws->start_regno;
old = df_set_note (REG_UNUSED, insn, old, *(mws->loc)); old = df_set_note (REG_UNUSED, insn, old, mws->mw_reg);
#ifdef REG_DEAD_DEBUGGING #ifdef REG_DEAD_DEBUGGING
df_print_note ("adding 1: ", insn, REG_NOTES (insn)); df_print_note ("adding 1: ", insn, REG_NOTES (insn));
...@@ -3772,6 +3790,34 @@ df_set_unused_notes_for_mw (rtx insn, rtx old, struct df_mw_hardreg *mws, ...@@ -3772,6 +3790,34 @@ df_set_unused_notes_for_mw (rtx insn, rtx old, struct df_mw_hardreg *mws,
} }
/* A subroutine of df_set_dead_notes_for_mw, with a selection of its
arguments. Return true if the register value described by MWS's
mw_reg is known to be completely dead, and if mw_reg can therefore
be used in a REG_DEAD note. */
static bool
df_whole_mw_reg_dead_p (struct df_mw_hardreg *mws,
bitmap live, bitmap artificial_uses,
bitmap do_not_gen)
{
unsigned int r;
/* If MWS describes a partial reference, create REG_DEAD notes for
individual hard registers. */
if (mws->flags & DF_REF_PARTIAL)
return false;
/* Likewise if some part of the register is not dead. */
for (r = mws->start_regno; r <= mws->end_regno; r++)
if (bitmap_bit_p (live, r)
|| bitmap_bit_p (artificial_uses, r)
|| bitmap_bit_p (do_not_gen, r))
return false;
gcc_assert (REG_P (mws->mw_reg));
return true;
}
/* Set the REG_DEAD notes for the multiword hardreg use in INSN based /* Set the REG_DEAD notes for the multiword hardreg use in INSN based
on the bits in LIVE. DO_NOT_GEN is used to keep REG_DEAD notes on the bits in LIVE. DO_NOT_GEN is used to keep REG_DEAD notes
from being set if the instruction both reads and writes the from being set if the instruction both reads and writes the
...@@ -3782,7 +3828,6 @@ df_set_dead_notes_for_mw (rtx insn, rtx old, struct df_mw_hardreg *mws, ...@@ -3782,7 +3828,6 @@ df_set_dead_notes_for_mw (rtx insn, rtx old, struct df_mw_hardreg *mws,
bitmap live, bitmap do_not_gen, bitmap live, bitmap do_not_gen,
bitmap artificial_uses) bitmap artificial_uses)
{ {
bool all_dead = true;
unsigned int r; unsigned int r;
#ifdef REG_DEAD_DEBUGGING #ifdef REG_DEAD_DEBUGGING
...@@ -3798,25 +3843,13 @@ df_set_dead_notes_for_mw (rtx insn, rtx old, struct df_mw_hardreg *mws, ...@@ -3798,25 +3843,13 @@ df_set_dead_notes_for_mw (rtx insn, rtx old, struct df_mw_hardreg *mws,
} }
#endif #endif
for (r = mws->start_regno; r <= mws->end_regno; r++) if (df_whole_mw_reg_dead_p (mws, live, artificial_uses, do_not_gen))
if ((bitmap_bit_p (live, r))
|| bitmap_bit_p (artificial_uses, r)
|| bitmap_bit_p (do_not_gen, r))
{
all_dead = false;
break;
}
if (all_dead)
{ {
if (!bitmap_bit_p (do_not_gen, mws->start_regno)) /* Add a dead note for the entire multi word register. */
{ old = df_set_note (REG_DEAD, insn, old, mws->mw_reg);
/* Add a dead note for the entire multi word register. */
old = df_set_note (REG_DEAD, insn, old, *(mws->loc));
#ifdef REG_DEAD_DEBUGGING #ifdef REG_DEAD_DEBUGGING
df_print_note ("adding 1: ", insn, REG_NOTES (insn)); df_print_note ("adding 1: ", insn, REG_NOTES (insn));
#endif #endif
}
} }
else else
{ {
......
...@@ -2625,7 +2625,6 @@ df_ref_record (struct df_collection_rec *collection_rec, ...@@ -2625,7 +2625,6 @@ df_ref_record (struct df_collection_rec *collection_rec,
enum df_ref_type ref_type, enum df_ref_type ref_type,
enum df_ref_flags ref_flags) enum df_ref_flags ref_flags)
{ {
rtx oldreg = reg;
unsigned int regno; unsigned int regno;
gcc_assert (REG_P (reg) || GET_CODE (reg) == SUBREG); gcc_assert (REG_P (reg) || GET_CODE (reg) == SUBREG);
...@@ -2656,7 +2655,7 @@ df_ref_record (struct df_collection_rec *collection_rec, ...@@ -2656,7 +2655,7 @@ df_ref_record (struct df_collection_rec *collection_rec,
{ {
/* Sets to a subreg of a multiword register are partial. /* Sets to a subreg of a multiword register are partial.
Sets to a non-subreg of a multiword register are not. */ Sets to a non-subreg of a multiword register are not. */
if (GET_CODE (oldreg) == SUBREG) if (GET_CODE (reg) == SUBREG)
ref_flags |= DF_REF_PARTIAL; ref_flags |= DF_REF_PARTIAL;
ref_flags |= DF_REF_MW_HARDREG; ref_flags |= DF_REF_MW_HARDREG;
...@@ -2664,7 +2663,6 @@ df_ref_record (struct df_collection_rec *collection_rec, ...@@ -2664,7 +2663,6 @@ df_ref_record (struct df_collection_rec *collection_rec,
hardreg->type = ref_type; hardreg->type = ref_type;
hardreg->flags = ref_flags; hardreg->flags = ref_flags;
hardreg->mw_reg = reg; hardreg->mw_reg = reg;
hardreg->loc = loc;
hardreg->start_regno = regno; hardreg->start_regno = regno;
hardreg->end_regno = endregno - 1; hardreg->end_regno = endregno - 1;
hardreg->mw_order = df->ref_order++; hardreg->mw_order = df->ref_order++;
......
...@@ -311,7 +311,6 @@ struct dataflow ...@@ -311,7 +311,6 @@ struct dataflow
struct df_mw_hardreg struct df_mw_hardreg
{ {
rtx mw_reg; /* The multiword hardreg. */ rtx mw_reg; /* The multiword hardreg. */
rtx *loc; /* The location of the reg. */
enum df_ref_type type; /* Used to see if the ref is read or write. */ enum df_ref_type type; /* Used to see if the ref is read or write. */
enum df_ref_flags flags; /* Various flags. */ enum df_ref_flags flags; /* Various flags. */
unsigned int start_regno; /* First word of the multi word subreg. */ unsigned int start_regno; /* First word of the multi word subreg. */
......
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