df.h (struct df_ref): Replace 'insn' field with 'insn_info' field.
* df.h (struct df_ref): Replace 'insn' field with 'insn_info' field. (DF_REF_INSN_INFO): New. (DF_REF_INSN, DF_REF_INSN_UID): Rewrite macros using DF_REF_INSN_INFO. (DF_REF_IS_ARTIFICIAL): Artificial refs are now identified as refs with a NULL DF_REF_INSN_INFO. (DF_INSN_INFO_GET, DF_INSN_INFO_SET): Renamed from DF_INSN_GET and DF_INSN_SET. (DF_INSN_INFO_LUID, DF_INSN_INFO_DEFS, DF_INSN_INFO_USES, DF_INSN_INFO_EQ_USES): New. (DF_INSN_LUID, DF_INSN_DEFS, DF_INSN_USES, DF_INSN_EQ_USES, DF_INSN_UID_LUID, DF_INSN_UID_DEFS, DF_INSN_UID_USES, DF_INSN_UID_EQ_USES): Rewrite using DF_INSN_INFO_* macros. * df-core.c: Update comment for above changes. (df_insn_debug_regno): Use DF_INSN_INFO_GET instead of INSN_UID and DF_INSN_UID_* macros. (df_ref_debug): Check for NULL DF_REF_INSN_INFO. * df-scan.c (df_ref_record): Take a df_insn_info instead of an insn rtx. Update all callers. (df_def_record_1, df_defs_record, df_uses_record, df_get_call_refs, df_ref_create_structure, df_insn_refs_collect): Likewise. (df_ref_equal_p): Compare DF_REF_INSN_INFO pointers for the refs. * df-problems.c (df_chain_dump): Test for non-NULL DF_REF_INSN_INFO. (df_live_bb_local_compute): Retrieve DF_INSN_INFO, use DF_INSN_INFO_* macros to access the insn refs. (df_chain_top_dump, df_chain_bottom_dump, df_byte_lr_alloc): Likewise. * fwprop.c (use_killed_between): Use DF_REF_INSN accessor macro. (all_uses_available): Retrieve DF_INSN_INFO for def_insn, and use it for accessing the refs. (try_fwprop_subst): Likewise. * ddg.c (add_cross_iteration_register_deps): Use DF_REF_INSN macro. * web.c (union_defs): Retrieve DF_INSN_INFO for def_insn, and use it for accessing the refs. * loop-invariant.c (invariant_for_use): Use DF_REF_BB macro. (check_dependencies): Use DF_INSN_INFO_GET, use DF_INSN_INFO_* macros to look at the insn refs. (record_uses): Likewise. * dce.c (deletable_insn_p): Don't tolerate artificial DEFs in this function anymore. (mark_artificial_uses): Don't mark_insn for artificial refs. (mark_reg_rependencies): Likewise. * doc/rtl.texi: Remove documentation of ADDRESSOF. From-SVN: r136885
This commit is contained in:
parent
00bb81c15b
commit
50e94c7e58
11 changed files with 238 additions and 174 deletions
|
@ -1,3 +1,48 @@
|
|||
2008-06-18 Steven Bosscher <steven@gcc.gnu.org>
|
||||
|
||||
* df.h (struct df_ref): Replace 'insn' field with 'insn_info' field.
|
||||
(DF_REF_INSN_INFO): New.
|
||||
(DF_REF_INSN, DF_REF_INSN_UID): Rewrite macros using DF_REF_INSN_INFO.
|
||||
(DF_REF_IS_ARTIFICIAL): Artificial refs are now identified as refs
|
||||
with a NULL DF_REF_INSN_INFO.
|
||||
(DF_INSN_INFO_GET, DF_INSN_INFO_SET): Renamed from DF_INSN_GET and
|
||||
DF_INSN_SET.
|
||||
(DF_INSN_INFO_LUID, DF_INSN_INFO_DEFS, DF_INSN_INFO_USES,
|
||||
DF_INSN_INFO_EQ_USES): New.
|
||||
(DF_INSN_LUID, DF_INSN_DEFS, DF_INSN_USES, DF_INSN_EQ_USES,
|
||||
DF_INSN_UID_LUID, DF_INSN_UID_DEFS, DF_INSN_UID_USES,
|
||||
DF_INSN_UID_EQ_USES): Rewrite using DF_INSN_INFO_* macros.
|
||||
* df-core.c: Update comment for above changes.
|
||||
(df_insn_debug_regno): Use DF_INSN_INFO_GET instead of INSN_UID and
|
||||
DF_INSN_UID_* macros.
|
||||
(df_ref_debug): Check for NULL DF_REF_INSN_INFO.
|
||||
* df-scan.c (df_ref_record): Take a df_insn_info instead of an
|
||||
insn rtx. Update all callers.
|
||||
(df_def_record_1, df_defs_record, df_uses_record, df_get_call_refs,
|
||||
df_ref_create_structure, df_insn_refs_collect): Likewise.
|
||||
(df_ref_equal_p): Compare DF_REF_INSN_INFO pointers for the refs.
|
||||
* df-problems.c (df_chain_dump): Test for non-NULL DF_REF_INSN_INFO.
|
||||
(df_live_bb_local_compute): Retrieve DF_INSN_INFO, use DF_INSN_INFO_*
|
||||
macros to access the insn refs.
|
||||
(df_chain_top_dump, df_chain_bottom_dump, df_byte_lr_alloc): Likewise.
|
||||
* fwprop.c (use_killed_between): Use DF_REF_INSN accessor macro.
|
||||
(all_uses_available): Retrieve DF_INSN_INFO for def_insn, and use it
|
||||
for accessing the refs.
|
||||
(try_fwprop_subst): Likewise.
|
||||
* ddg.c (add_cross_iteration_register_deps): Use DF_REF_INSN macro.
|
||||
* web.c (union_defs): Retrieve DF_INSN_INFO for def_insn, and use it
|
||||
for accessing the refs.
|
||||
* loop-invariant.c (invariant_for_use): Use DF_REF_BB macro.
|
||||
(check_dependencies): Use DF_INSN_INFO_GET, use DF_INSN_INFO_* macros
|
||||
to look at the insn refs.
|
||||
(record_uses): Likewise.
|
||||
* dce.c (deletable_insn_p): Don't tolerate artificial DEFs in this
|
||||
function anymore.
|
||||
(mark_artificial_uses): Don't mark_insn for artificial refs.
|
||||
(mark_reg_rependencies): Likewise.
|
||||
|
||||
* doc/rtl.texi: Remove documentation of ADDRESSOF.
|
||||
|
||||
2008-06-17 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
|
||||
|
||||
* configure: Regenerate.
|
||||
|
|
16
gcc/dce.c
16
gcc/dce.c
|
@ -154,12 +154,10 @@ deletable_insn_p (rtx insn, bool fast)
|
|||
static inline int
|
||||
marked_insn_p (rtx insn)
|
||||
{
|
||||
if (insn)
|
||||
return TEST_BIT (marked, INSN_UID (insn));
|
||||
else
|
||||
/* Artificial defs are always needed and they do not have an
|
||||
insn. */
|
||||
return true;
|
||||
/* Artificial defs are always needed and they do not have an insn.
|
||||
We should never see them here. */
|
||||
gcc_assert (insn);
|
||||
return TEST_BIT (marked, INSN_UID (insn));
|
||||
}
|
||||
|
||||
|
||||
|
@ -339,7 +337,8 @@ mark_artificial_uses (void)
|
|||
for (use_rec = df_get_artificial_uses (bb->index);
|
||||
*use_rec; use_rec++)
|
||||
for (defs = DF_REF_CHAIN (*use_rec); defs; defs = defs->next)
|
||||
mark_insn (DF_REF_INSN (defs->ref), false);
|
||||
if (! DF_REF_IS_ARTIFICIAL (defs->ref))
|
||||
mark_insn (DF_REF_INSN (defs->ref), false);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -362,7 +361,8 @@ mark_reg_dependencies (rtx insn)
|
|||
fprintf (dump_file, " in insn %d:\n", INSN_UID (insn));
|
||||
}
|
||||
for (defs = DF_REF_CHAIN (use); defs; defs = defs->next)
|
||||
mark_insn (DF_REF_INSN (defs->ref), false);
|
||||
if (! DF_REF_IS_ARTIFICIAL (defs->ref))
|
||||
mark_insn (DF_REF_INSN (defs->ref), false);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -289,7 +289,7 @@ add_cross_iteration_register_deps (ddg_ptr g, struct df_ref *last_def)
|
|||
deps when broken. If the first_def reaches the USE then
|
||||
there is such a dep. */
|
||||
ddg_node_ptr first_def_node = get_node_of_insn (g,
|
||||
first_def->insn);
|
||||
DF_REF_INSN (first_def));
|
||||
|
||||
gcc_assert (first_def_node);
|
||||
|
||||
|
@ -314,7 +314,7 @@ add_cross_iteration_register_deps (ddg_ptr g, struct df_ref *last_def)
|
|||
if (last_def->id == first_def->id)
|
||||
return;
|
||||
|
||||
dest_node = get_node_of_insn (g, first_def->insn);
|
||||
dest_node = get_node_of_insn (g, DF_REF_INSN (first_def));
|
||||
gcc_assert (dest_node);
|
||||
create_ddg_dep_no_link (g, last_def_node, dest_node,
|
||||
OUTPUT_DEP, REG_DEP, 1);
|
||||
|
|
|
@ -268,25 +268,29 @@ pseudos and long for the hard registers.
|
|||
|
||||
ACCESSING INSNS:
|
||||
|
||||
1) The df insn information is kept in the insns array. This array is
|
||||
indexed by insn uid.
|
||||
1) The df insn information is kept in an array of DF_INSN_INFO objects.
|
||||
The array is indexed by insn uid, and every DF_REF points to the
|
||||
DF_INSN_INFO object of the insn that contains the reference.
|
||||
|
||||
2) Each insn has three sets of refs: They are linked into one of three
|
||||
lists: the insn's defs list (accessed by the DF_INSN_DEFS or
|
||||
DF_INSN_UID_DEFS macros), the insn's uses list (accessed by the
|
||||
DF_INSN_USES or DF_INSN_UID_USES macros) or the insn's eq_uses list
|
||||
(accessed by the DF_INSN_EQ_USES or DF_INSN_UID_EQ_USES macros).
|
||||
The latter list are the list of references in REG_EQUAL or
|
||||
REG_EQUIV notes. These macros produce a ref (or NULL), the rest of
|
||||
the list can be obtained by traversal of the NEXT_REF field
|
||||
(accessed by the DF_REF_NEXT_REF macro.) There is no significance
|
||||
to the ordering of the uses or refs in an instruction.
|
||||
2) Each insn has three sets of refs, which are linked into one of three
|
||||
lists: The insn's defs list (accessed by the DF_INSN_INFO_DEFS,
|
||||
DF_INSN_DEFS, or DF_INSN_UID_DEFS macros), the insn's uses list
|
||||
(accessed by the DF_INSN_INFO_USES, DF_INSN_USES, or
|
||||
DF_INSN_UID_USES macros) or the insn's eq_uses list (accessed by the
|
||||
DF_INSN_INFO_EQ_USES, DF_INSN_EQ_USES or DF_INSN_UID_EQ_USES macros).
|
||||
The latter list are the list of references in REG_EQUAL or REG_EQUIV
|
||||
notes. These macros produce a ref (or NULL), the rest of the list
|
||||
can be obtained by traversal of the NEXT_REF field (accessed by the
|
||||
DF_REF_NEXT_REF macro.) There is no significance to the ordering of
|
||||
the uses or refs in an instruction.
|
||||
|
||||
3) Each insn has a logical uid field (LUID). When properly set, this
|
||||
is an integer that numbers each insn in the basic block, in order from
|
||||
the start of the block. The numbers are only correct after a call to
|
||||
df_analyse. They will rot after insns are added deleted or moved
|
||||
around.
|
||||
3) Each insn has a logical uid field (LUID) which is stored in the
|
||||
DF_INSN_INFO object for the insn. The LUID field is accessed by
|
||||
the DF_INSN_INFO_LUID, DF_INSN_LUID, and DF_INSN_UID_LUID macros.
|
||||
When properly set, the LUID is an integer that numbers each insn in
|
||||
the basic block, in order from the start of the block.
|
||||
The numbers are only correct after a call to df_analyze. They will
|
||||
rot after insns are added deleted or moved round.
|
||||
|
||||
ACCESSING REFS:
|
||||
|
||||
|
@ -2152,17 +2156,18 @@ df_insn_debug (rtx insn, bool follow_chain, FILE *file)
|
|||
void
|
||||
df_insn_debug_regno (rtx insn, FILE *file)
|
||||
{
|
||||
unsigned int uid = INSN_UID(insn);
|
||||
struct df_insn_info *insn_info = DF_INSN_INFO_GET (insn);
|
||||
|
||||
fprintf (file, "insn %d bb %d luid %d defs ",
|
||||
uid, BLOCK_FOR_INSN (insn)->index, DF_INSN_LUID (insn));
|
||||
df_refs_chain_dump (DF_INSN_UID_DEFS (uid), false, file);
|
||||
INSN_UID (insn), BLOCK_FOR_INSN (insn)->index,
|
||||
DF_INSN_INFO_LUID (insn_info));
|
||||
df_refs_chain_dump (DF_INSN_INFO_DEFS (insn_info), false, file);
|
||||
|
||||
fprintf (file, " uses ");
|
||||
df_refs_chain_dump (DF_INSN_UID_USES (uid), false, file);
|
||||
df_refs_chain_dump (DF_INSN_INFO_USES (insn_info), false, file);
|
||||
|
||||
fprintf (file, " eq_uses ");
|
||||
df_refs_chain_dump (DF_INSN_UID_EQ_USES (uid), false, file);
|
||||
df_refs_chain_dump (DF_INSN_INFO_EQ_USES (insn_info), false, file);
|
||||
fprintf (file, "\n");
|
||||
}
|
||||
|
||||
|
@ -2188,7 +2193,7 @@ df_ref_debug (struct df_ref *ref, FILE *file)
|
|||
fprintf (file, "reg %d bb %d insn %d flag 0x%x type 0x%x ",
|
||||
DF_REF_REGNO (ref),
|
||||
DF_REF_BBNO (ref),
|
||||
DF_REF_INSN (ref) ? INSN_UID (DF_REF_INSN (ref)) : -1,
|
||||
DF_REF_INSN_INFO (ref) ? INSN_UID (DF_REF_INSN (ref)) : -1,
|
||||
DF_REF_FLAGS (ref),
|
||||
DF_REF_TYPE (ref));
|
||||
if (DF_REF_LOC (ref))
|
||||
|
|
|
@ -129,7 +129,7 @@ df_chain_dump (struct df_link *link, FILE *file)
|
|||
DF_REF_REG_DEF_P (link->ref) ? 'd' : 'u',
|
||||
DF_REF_ID (link->ref),
|
||||
DF_REF_BBNO (link->ref),
|
||||
DF_REF_INSN (link->ref) ? DF_REF_INSN_UID (link->ref) : -1);
|
||||
DF_REF_INSN_INFO (link->ref) ? DF_REF_INSN_UID (link->ref) : -1);
|
||||
}
|
||||
fprintf (file, "}");
|
||||
}
|
||||
|
@ -1429,15 +1429,15 @@ df_live_bb_local_compute (unsigned int bb_index)
|
|||
if (!insn_info)
|
||||
{
|
||||
gcc_assert (!INSN_P (insn));
|
||||
df_insn_create_insn_record (insn);
|
||||
insn_info = df_insn_create_insn_record (insn);
|
||||
}
|
||||
|
||||
DF_INSN_LUID (insn) = luid;
|
||||
DF_INSN_INFO_LUID (insn_info) = luid;
|
||||
if (!INSN_P (insn))
|
||||
continue;
|
||||
|
||||
luid++;
|
||||
for (def_rec = DF_INSN_UID_DEFS (uid); *def_rec; def_rec++)
|
||||
for (def_rec = DF_INSN_INFO_DEFS (insn_info); *def_rec; def_rec++)
|
||||
{
|
||||
struct df_ref *def = *def_rec;
|
||||
unsigned int regno = DF_REF_REGNO (def);
|
||||
|
@ -2201,14 +2201,14 @@ df_chain_top_dump (basic_block bb, FILE *file)
|
|||
|
||||
FOR_BB_INSNS (bb, insn)
|
||||
{
|
||||
unsigned int uid = INSN_UID (insn);
|
||||
if (INSN_P (insn))
|
||||
{
|
||||
def_rec = DF_INSN_UID_DEFS (uid);
|
||||
struct df_insn_info *insn_info = DF_INSN_INFO_GET (insn);
|
||||
def_rec = DF_INSN_INFO_DEFS (insn_info);
|
||||
if (*def_rec)
|
||||
{
|
||||
fprintf (file, ";; DU chains for insn luid %d uid %d\n",
|
||||
DF_INSN_LUID (insn), uid);
|
||||
DF_INSN_INFO_LUID (insn_info), INSN_UID (insn));
|
||||
|
||||
while (*def_rec)
|
||||
{
|
||||
|
@ -2250,15 +2250,15 @@ df_chain_bottom_dump (basic_block bb, FILE *file)
|
|||
|
||||
FOR_BB_INSNS (bb, insn)
|
||||
{
|
||||
unsigned int uid = INSN_UID (insn);
|
||||
if (INSN_P (insn))
|
||||
{
|
||||
struct df_ref **eq_use_rec = DF_INSN_UID_EQ_USES (uid);
|
||||
use_rec = DF_INSN_UID_USES (uid);
|
||||
struct df_insn_info *insn_info = DF_INSN_INFO_GET (insn);
|
||||
struct df_ref **eq_use_rec = DF_INSN_INFO_EQ_USES (insn_info);
|
||||
use_rec = DF_INSN_INFO_USES (insn_info);
|
||||
if (*use_rec || *eq_use_rec)
|
||||
{
|
||||
fprintf (file, ";; UD chains for insn luid %d uid %d\n",
|
||||
DF_INSN_LUID (insn), uid);
|
||||
DF_INSN_INFO_LUID (insn_info), INSN_UID (insn));
|
||||
|
||||
while (*use_rec)
|
||||
{
|
||||
|
@ -2515,8 +2515,9 @@ df_byte_lr_alloc (bitmap all_blocks ATTRIBUTE_UNUSED)
|
|||
{
|
||||
if (INSN_P (insn))
|
||||
{
|
||||
df_byte_lr_check_regs (DF_INSN_DEFS (insn));
|
||||
df_byte_lr_check_regs (DF_INSN_USES (insn));
|
||||
struct df_insn_info *insn_info = DF_INSN_INFO_GET (insn);
|
||||
df_byte_lr_check_regs (DF_INSN_INFO_DEFS (insn_info));
|
||||
df_byte_lr_check_regs (DF_INSN_INFO_USES (insn_info));
|
||||
}
|
||||
}
|
||||
bitmap_set_bit (df_byte_lr->out_of_date_transfer_functions, bb->index);
|
||||
|
|
179
gcc/df-scan.c
179
gcc/df-scan.c
|
@ -94,26 +94,28 @@ static struct df_mw_hardreg * df_null_mw_rec[1];
|
|||
|
||||
static void df_ref_record (struct df_collection_rec *,
|
||||
rtx, rtx *,
|
||||
basic_block, rtx, enum df_ref_type,
|
||||
enum df_ref_flags, int, int, enum machine_mode);
|
||||
static void df_def_record_1 (struct df_collection_rec *,
|
||||
rtx, basic_block, rtx,
|
||||
basic_block, struct df_insn_info *,
|
||||
enum df_ref_type, enum df_ref_flags,
|
||||
int, int, enum machine_mode);
|
||||
static void df_def_record_1 (struct df_collection_rec *, rtx,
|
||||
basic_block, struct df_insn_info *,
|
||||
enum df_ref_flags);
|
||||
static void df_defs_record (struct df_collection_rec *,
|
||||
rtx, basic_block, rtx,
|
||||
static void df_defs_record (struct df_collection_rec *, rtx,
|
||||
basic_block, struct df_insn_info *,
|
||||
enum df_ref_flags);
|
||||
static void df_uses_record (struct df_collection_rec *,
|
||||
rtx *, enum df_ref_type,
|
||||
basic_block, rtx, enum df_ref_flags,
|
||||
basic_block, struct df_insn_info *,
|
||||
enum df_ref_flags,
|
||||
int, int, enum machine_mode);
|
||||
|
||||
static struct df_ref *df_ref_create_structure (struct df_collection_rec *, rtx, rtx *,
|
||||
basic_block, rtx, enum df_ref_type,
|
||||
enum df_ref_flags,
|
||||
basic_block, struct df_insn_info *,
|
||||
enum df_ref_type, enum df_ref_flags,
|
||||
int, int, enum machine_mode);
|
||||
|
||||
static void df_insn_refs_collect (struct df_collection_rec*,
|
||||
basic_block, rtx);
|
||||
basic_block, struct df_insn_info *);
|
||||
static void df_canonize_collection_rec (struct df_collection_rec *);
|
||||
|
||||
static void df_get_regular_block_artificial_uses (bitmap);
|
||||
|
@ -636,7 +638,7 @@ df_ref_create (rtx reg, rtx *loc, rtx insn,
|
|||
|
||||
/* You cannot hack artificial refs. */
|
||||
gcc_assert (insn);
|
||||
ref = df_ref_create_structure (NULL, reg, loc, bb, insn,
|
||||
ref = df_ref_create_structure (NULL, reg, loc, bb, DF_INSN_INFO_GET (insn),
|
||||
ref_type, ref_flags,
|
||||
width, offset, mode);
|
||||
|
||||
|
@ -924,11 +926,11 @@ df_insn_create_insn_record (rtx insn)
|
|||
struct df_insn_info *insn_rec;
|
||||
|
||||
df_grow_insn_info ();
|
||||
insn_rec = DF_INSN_GET (insn);
|
||||
insn_rec = DF_INSN_INFO_GET (insn);
|
||||
if (!insn_rec)
|
||||
{
|
||||
insn_rec = pool_alloc (problem_data->insn_pool);
|
||||
DF_INSN_SET (insn, insn_rec);
|
||||
DF_INSN_INFO_SET (insn, insn_rec);
|
||||
}
|
||||
memset (insn_rec, 0, sizeof (struct df_insn_info));
|
||||
insn_rec->insn = insn;
|
||||
|
@ -1166,8 +1168,8 @@ df_insn_rescan (rtx insn)
|
|||
}
|
||||
else
|
||||
{
|
||||
df_insn_create_insn_record (insn);
|
||||
df_insn_refs_collect (&collection_rec, bb, insn);
|
||||
struct df_insn_info *insn_info = df_insn_create_insn_record (insn);
|
||||
df_insn_refs_collect (&collection_rec, bb, insn_info);
|
||||
if (dump_file)
|
||||
fprintf (dump_file, "scanning new insn with uid = %d.\n", uid);
|
||||
}
|
||||
|
@ -1893,8 +1895,7 @@ df_ref_change_reg_with_loc_1 (struct df_reg_info *old, struct df_reg_info *new,
|
|||
}
|
||||
else
|
||||
{
|
||||
struct df_insn_info *insn_info
|
||||
= DF_INSN_GET (DF_REF_INSN (the_ref));
|
||||
struct df_insn_info *insn_info = DF_REF_INSN_INFO (the_ref);
|
||||
if (DF_REF_FLAGS (the_ref) & DF_REF_IN_NOTE)
|
||||
ref_vec = insn_info->eq_uses;
|
||||
else
|
||||
|
@ -2064,7 +2065,7 @@ df_notes_rescan (rtx insn)
|
|||
case REG_EQUAL:
|
||||
df_uses_record (&collection_rec,
|
||||
&XEXP (note, 0), DF_REF_REG_USE,
|
||||
bb, insn, DF_REF_IN_NOTE, -1, -1, 0);
|
||||
bb, insn_info, DF_REF_IN_NOTE, -1, -1, 0);
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
@ -2149,7 +2150,7 @@ df_ref_equal_p (struct df_ref *ref1, struct df_ref *ref2)
|
|||
(DF_REF_REG (ref1) == DF_REF_REG (ref2)
|
||||
&& DF_REF_REGNO (ref1) == DF_REF_REGNO (ref2)
|
||||
&& DF_REF_LOC (ref1) == DF_REF_LOC (ref2)
|
||||
&& DF_REF_INSN (ref1) == DF_REF_INSN (ref2)
|
||||
&& DF_REF_INSN_INFO (ref1) == DF_REF_INSN_INFO (ref2)
|
||||
&& DF_REF_TYPE (ref1) == DF_REF_TYPE (ref2)
|
||||
&& ((DF_REF_FLAGS (ref1) & ~(DF_REF_REG_MARKER + DF_REF_MW_HARDREG))
|
||||
== (DF_REF_FLAGS (ref2) & ~(DF_REF_REG_MARKER + DF_REF_MW_HARDREG)))
|
||||
|
@ -2516,7 +2517,7 @@ df_refs_add_to_chains (struct df_collection_rec *collection_rec,
|
|||
{
|
||||
if (insn)
|
||||
{
|
||||
struct df_insn_info *insn_rec = DF_INSN_GET (insn);
|
||||
struct df_insn_info *insn_rec = DF_INSN_INFO_GET (insn);
|
||||
/* If there is a vector in the collection rec, add it to the
|
||||
insn. A null rec is a signal that the caller will handle the
|
||||
chain specially. */
|
||||
|
@ -2591,7 +2592,7 @@ df_refs_add_to_chains (struct df_collection_rec *collection_rec,
|
|||
static struct df_ref *
|
||||
df_ref_create_structure (struct df_collection_rec *collection_rec,
|
||||
rtx reg, rtx *loc,
|
||||
basic_block bb, rtx insn,
|
||||
basic_block bb, struct df_insn_info *info,
|
||||
enum df_ref_type ref_type,
|
||||
enum df_ref_flags ref_flags,
|
||||
int width, int offset, enum machine_mode mode)
|
||||
|
@ -2614,7 +2615,7 @@ df_ref_create_structure (struct df_collection_rec *collection_rec,
|
|||
DF_REF_REG (this_ref) = reg;
|
||||
DF_REF_REGNO (this_ref) = regno;
|
||||
DF_REF_LOC (this_ref) = loc;
|
||||
DF_REF_INSN (this_ref) = insn;
|
||||
DF_REF_INSN_INFO (this_ref) = info;
|
||||
DF_REF_CHAIN (this_ref) = NULL;
|
||||
DF_REF_TYPE (this_ref) = ref_type;
|
||||
DF_REF_FLAGS (this_ref) = ref_flags;
|
||||
|
@ -2669,7 +2670,7 @@ df_ref_create_structure (struct df_collection_rec *collection_rec,
|
|||
static void
|
||||
df_ref_record (struct df_collection_rec *collection_rec,
|
||||
rtx reg, rtx *loc,
|
||||
basic_block bb, rtx insn,
|
||||
basic_block bb, struct df_insn_info *insn_info,
|
||||
enum df_ref_type ref_type,
|
||||
enum df_ref_flags ref_flags,
|
||||
int width, int offset, enum machine_mode mode)
|
||||
|
@ -2700,7 +2701,7 @@ df_ref_record (struct df_collection_rec *collection_rec,
|
|||
/* If this is a multiword hardreg, we create some extra
|
||||
datastructures that will enable us to easily build REG_DEAD
|
||||
and REG_UNUSED notes. */
|
||||
if ((endregno != regno + 1) && insn)
|
||||
if ((endregno != regno + 1) && insn_info)
|
||||
{
|
||||
/* Sets to a subreg of a multiword register are partial.
|
||||
Sets to a non-subreg of a multiword register are not. */
|
||||
|
@ -2721,7 +2722,7 @@ df_ref_record (struct df_collection_rec *collection_rec,
|
|||
for (i = regno; i < endregno; i++)
|
||||
{
|
||||
ref = df_ref_create_structure (collection_rec, regno_reg_rtx[i], loc,
|
||||
bb, insn, ref_type, ref_flags,
|
||||
bb, insn_info, ref_type, ref_flags,
|
||||
width, offset, mode);
|
||||
|
||||
gcc_assert (ORIGINAL_REGNO (DF_REF_REG (ref)) == i);
|
||||
|
@ -2730,7 +2731,7 @@ df_ref_record (struct df_collection_rec *collection_rec,
|
|||
else
|
||||
{
|
||||
struct df_ref *ref;
|
||||
ref = df_ref_create_structure (collection_rec, reg, loc, bb, insn,
|
||||
ref = df_ref_create_structure (collection_rec, reg, loc, bb, insn_info,
|
||||
ref_type, ref_flags, width, offset, mode);
|
||||
}
|
||||
}
|
||||
|
@ -2760,7 +2761,7 @@ df_read_modify_subreg_p (rtx x)
|
|||
|
||||
static void
|
||||
df_def_record_1 (struct df_collection_rec *collection_rec,
|
||||
rtx x, basic_block bb, rtx insn,
|
||||
rtx x, basic_block bb, struct df_insn_info *insn_info,
|
||||
enum df_ref_flags flags)
|
||||
{
|
||||
rtx *loc;
|
||||
|
@ -2788,7 +2789,7 @@ df_def_record_1 (struct df_collection_rec *collection_rec,
|
|||
if (GET_CODE (temp) == EXPR_LIST || GET_CODE (temp) == CLOBBER
|
||||
|| GET_CODE (temp) == SET)
|
||||
df_def_record_1 (collection_rec,
|
||||
temp, bb, insn,
|
||||
temp, bb, insn_info,
|
||||
GET_CODE (temp) == CLOBBER
|
||||
? flags | DF_REF_MUST_CLOBBER : flags);
|
||||
}
|
||||
|
@ -2823,14 +2824,14 @@ df_def_record_1 (struct df_collection_rec *collection_rec,
|
|||
if (REG_P (dst))
|
||||
{
|
||||
df_ref_record (collection_rec,
|
||||
dst, loc, bb, insn, DF_REF_REG_DEF, flags,
|
||||
dst, loc, bb, insn_info, DF_REF_REG_DEF, flags,
|
||||
width, offset, mode);
|
||||
|
||||
/* We want to keep sp alive everywhere - by making all
|
||||
writes to sp also use of sp. */
|
||||
if (REGNO (dst) == STACK_POINTER_REGNUM)
|
||||
df_ref_record (collection_rec,
|
||||
dst, NULL, bb, insn, DF_REF_REG_USE, flags,
|
||||
dst, NULL, bb, insn_info, DF_REF_REG_USE, flags,
|
||||
width, offset, mode);
|
||||
}
|
||||
else if (GET_CODE (dst) == SUBREG && REG_P (SUBREG_REG (dst)))
|
||||
|
@ -2841,7 +2842,7 @@ df_def_record_1 (struct df_collection_rec *collection_rec,
|
|||
flags |= DF_REF_SUBREG;
|
||||
|
||||
df_ref_record (collection_rec,
|
||||
dst, loc, bb, insn, DF_REF_REG_DEF, flags,
|
||||
dst, loc, bb, insn_info, DF_REF_REG_DEF, flags,
|
||||
width, offset, mode);
|
||||
}
|
||||
}
|
||||
|
@ -2851,7 +2852,8 @@ df_def_record_1 (struct df_collection_rec *collection_rec,
|
|||
|
||||
static void
|
||||
df_defs_record (struct df_collection_rec *collection_rec,
|
||||
rtx x, basic_block bb, rtx insn, enum df_ref_flags flags)
|
||||
rtx x, basic_block bb, struct df_insn_info *insn_info,
|
||||
enum df_ref_flags flags)
|
||||
{
|
||||
RTX_CODE code = GET_CODE (x);
|
||||
|
||||
|
@ -2860,12 +2862,12 @@ df_defs_record (struct df_collection_rec *collection_rec,
|
|||
/* Mark the single def within the pattern. */
|
||||
enum df_ref_flags clobber_flags = flags;
|
||||
clobber_flags |= (code == CLOBBER) ? DF_REF_MUST_CLOBBER : 0;
|
||||
df_def_record_1 (collection_rec, x, bb, insn, clobber_flags);
|
||||
df_def_record_1 (collection_rec, x, bb, insn_info, clobber_flags);
|
||||
}
|
||||
else if (code == COND_EXEC)
|
||||
{
|
||||
df_defs_record (collection_rec, COND_EXEC_CODE (x),
|
||||
bb, insn, DF_REF_CONDITIONAL);
|
||||
bb, insn_info, DF_REF_CONDITIONAL);
|
||||
}
|
||||
else if (code == PARALLEL)
|
||||
{
|
||||
|
@ -2873,7 +2875,7 @@ df_defs_record (struct df_collection_rec *collection_rec,
|
|||
|
||||
/* Mark the multiple defs within the pattern. */
|
||||
for (i = XVECLEN (x, 0) - 1; i >= 0; i--)
|
||||
df_defs_record (collection_rec, XVECEXP (x, 0, i), bb, insn, flags);
|
||||
df_defs_record (collection_rec, XVECEXP (x, 0, i), bb, insn_info, flags);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2888,7 +2890,8 @@ df_defs_record (struct df_collection_rec *collection_rec,
|
|||
static void
|
||||
df_uses_record (struct df_collection_rec *collection_rec,
|
||||
rtx *loc, enum df_ref_type ref_type,
|
||||
basic_block bb, rtx insn, enum df_ref_flags flags,
|
||||
basic_block bb, struct df_insn_info *insn_info,
|
||||
enum df_ref_flags flags,
|
||||
int width, int offset, enum machine_mode mode)
|
||||
{
|
||||
RTX_CODE code;
|
||||
|
@ -2920,8 +2923,9 @@ df_uses_record (struct df_collection_rec *collection_rec,
|
|||
if (MEM_P (XEXP (x, 0)))
|
||||
df_uses_record (collection_rec,
|
||||
&XEXP (XEXP (x, 0), 0),
|
||||
DF_REF_REG_MEM_STORE, bb, insn, flags,
|
||||
width, offset, mode);
|
||||
DF_REF_REG_MEM_STORE,
|
||||
bb, insn_info,
|
||||
flags, width, offset, mode);
|
||||
|
||||
/* If we're clobbering a REG then we have a def so ignore. */
|
||||
return;
|
||||
|
@ -2929,7 +2933,7 @@ df_uses_record (struct df_collection_rec *collection_rec,
|
|||
case MEM:
|
||||
df_uses_record (collection_rec,
|
||||
&XEXP (x, 0), DF_REF_REG_MEM_LOAD,
|
||||
bb, insn, flags & DF_REF_IN_NOTE,
|
||||
bb, insn_info, flags & DF_REF_IN_NOTE,
|
||||
width, offset, mode);
|
||||
return;
|
||||
|
||||
|
@ -2940,7 +2944,7 @@ df_uses_record (struct df_collection_rec *collection_rec,
|
|||
if (!REG_P (SUBREG_REG (x)))
|
||||
{
|
||||
loc = &SUBREG_REG (x);
|
||||
df_uses_record (collection_rec, loc, ref_type, bb, insn, flags,
|
||||
df_uses_record (collection_rec, loc, ref_type, bb, insn_info, flags,
|
||||
width, offset, mode);
|
||||
return;
|
||||
}
|
||||
|
@ -2948,7 +2952,8 @@ df_uses_record (struct df_collection_rec *collection_rec,
|
|||
|
||||
case REG:
|
||||
df_ref_record (collection_rec,
|
||||
x, loc, bb, insn, ref_type, flags,
|
||||
x, loc, bb, insn_info,
|
||||
ref_type, flags,
|
||||
width, offset, mode);
|
||||
return;
|
||||
|
||||
|
@ -2971,7 +2976,7 @@ df_uses_record (struct df_collection_rec *collection_rec,
|
|||
flags |= DF_REF_SIGN_EXTRACT;
|
||||
|
||||
df_uses_record (collection_rec,
|
||||
&XEXP (x, 0), ref_type, bb, insn, flags,
|
||||
&XEXP (x, 0), ref_type, bb, insn_info, flags,
|
||||
width, offset, mode);
|
||||
return;
|
||||
}
|
||||
|
@ -2983,7 +2988,7 @@ df_uses_record (struct df_collection_rec *collection_rec,
|
|||
rtx dst = SET_DEST (x);
|
||||
gcc_assert (!(flags & DF_REF_IN_NOTE));
|
||||
df_uses_record (collection_rec,
|
||||
&SET_SRC (x), DF_REF_REG_USE, bb, insn, flags,
|
||||
&SET_SRC (x), DF_REF_REG_USE, bb, insn_info, flags,
|
||||
width, offset, mode);
|
||||
|
||||
switch (GET_CODE (dst))
|
||||
|
@ -2992,7 +2997,7 @@ df_uses_record (struct df_collection_rec *collection_rec,
|
|||
if (df_read_modify_subreg_p (dst))
|
||||
{
|
||||
df_uses_record (collection_rec, &SUBREG_REG (dst),
|
||||
DF_REF_REG_USE, bb, insn,
|
||||
DF_REF_REG_USE, bb, insn_info,
|
||||
flags | DF_REF_READ_WRITE | DF_REF_SUBREG,
|
||||
width, offset, mode);
|
||||
break;
|
||||
|
@ -3006,7 +3011,7 @@ df_uses_record (struct df_collection_rec *collection_rec,
|
|||
break;
|
||||
case MEM:
|
||||
df_uses_record (collection_rec, &XEXP (dst, 0),
|
||||
DF_REF_REG_MEM_STORE, bb, insn, flags,
|
||||
DF_REF_REG_MEM_STORE, bb, insn_info, flags,
|
||||
width, offset, mode);
|
||||
break;
|
||||
case STRICT_LOW_PART:
|
||||
|
@ -3017,7 +3022,7 @@ df_uses_record (struct df_collection_rec *collection_rec,
|
|||
dst = XEXP (dst, 0);
|
||||
df_uses_record (collection_rec,
|
||||
(GET_CODE (dst) == SUBREG) ? &SUBREG_REG (dst) : temp,
|
||||
DF_REF_REG_USE, bb, insn,
|
||||
DF_REF_REG_USE, bb, insn_info,
|
||||
DF_REF_READ_WRITE | DF_REF_STRICT_LOW_PART,
|
||||
width, offset, mode);
|
||||
}
|
||||
|
@ -3034,15 +3039,15 @@ df_uses_record (struct df_collection_rec *collection_rec,
|
|||
else
|
||||
{
|
||||
df_uses_record (collection_rec, &XEXP (dst, 1),
|
||||
DF_REF_REG_USE, bb, insn, flags,
|
||||
DF_REF_REG_USE, bb, insn_info, flags,
|
||||
width, offset, mode);
|
||||
df_uses_record (collection_rec, &XEXP (dst, 2),
|
||||
DF_REF_REG_USE, bb, insn, flags,
|
||||
DF_REF_REG_USE, bb, insn_info, flags,
|
||||
width, offset, mode);
|
||||
}
|
||||
|
||||
df_uses_record (collection_rec, &XEXP (dst, 0),
|
||||
DF_REF_REG_USE, bb, insn,
|
||||
DF_REF_REG_USE, bb, insn_info,
|
||||
DF_REF_READ_WRITE | DF_REF_ZERO_EXTRACT,
|
||||
width, offset, mode);
|
||||
}
|
||||
|
@ -3094,7 +3099,7 @@ df_uses_record (struct df_collection_rec *collection_rec,
|
|||
|
||||
for (j = 0; j < ASM_OPERANDS_INPUT_LENGTH (x); j++)
|
||||
df_uses_record (collection_rec, &ASM_OPERANDS_INPUT (x, j),
|
||||
DF_REF_REG_USE, bb, insn, flags,
|
||||
DF_REF_REG_USE, bb, insn_info, flags,
|
||||
width, offset, mode);
|
||||
return;
|
||||
}
|
||||
|
@ -3108,7 +3113,8 @@ df_uses_record (struct df_collection_rec *collection_rec,
|
|||
case PRE_MODIFY:
|
||||
case POST_MODIFY:
|
||||
/* Catch the def of the register being modified. */
|
||||
df_ref_record (collection_rec, XEXP (x, 0), &XEXP (x, 0), bb, insn,
|
||||
df_ref_record (collection_rec, XEXP (x, 0), &XEXP (x, 0),
|
||||
bb, insn_info,
|
||||
DF_REF_REG_DEF,
|
||||
flags | DF_REF_READ_WRITE | DF_REF_PRE_POST_MODIFY,
|
||||
width, offset, mode);
|
||||
|
@ -3135,7 +3141,7 @@ df_uses_record (struct df_collection_rec *collection_rec,
|
|||
goto retry;
|
||||
}
|
||||
df_uses_record (collection_rec, &XEXP (x, i), ref_type,
|
||||
bb, insn, flags,
|
||||
bb, insn_info, flags,
|
||||
width, offset, mode);
|
||||
}
|
||||
else if (fmt[i] == 'E')
|
||||
|
@ -3144,7 +3150,7 @@ df_uses_record (struct df_collection_rec *collection_rec,
|
|||
for (j = 0; j < XVECLEN (x, i); j++)
|
||||
df_uses_record (collection_rec,
|
||||
&XVECEXP (x, i, j), ref_type,
|
||||
bb, insn, flags,
|
||||
bb, insn_info, flags,
|
||||
width, offset, mode);
|
||||
}
|
||||
}
|
||||
|
@ -3179,7 +3185,7 @@ df_get_conditional_uses (struct df_collection_rec *collection_rec)
|
|||
|
||||
use = df_ref_create_structure (collection_rec, DF_REF_REG (ref),
|
||||
DF_REF_LOC (ref), DF_REF_BB (ref),
|
||||
DF_REF_INSN (ref), DF_REF_REG_USE,
|
||||
DF_REF_INSN_INFO (ref), DF_REF_REG_USE,
|
||||
DF_REF_FLAGS (ref) & ~DF_REF_CONDITIONAL,
|
||||
width, offset, mode);
|
||||
DF_REF_REGNO (use) = DF_REF_REGNO (ref);
|
||||
|
@ -3193,7 +3199,7 @@ df_get_conditional_uses (struct df_collection_rec *collection_rec)
|
|||
static void
|
||||
df_get_call_refs (struct df_collection_rec * collection_rec,
|
||||
basic_block bb,
|
||||
rtx insn,
|
||||
struct df_insn_info *insn_info,
|
||||
enum df_ref_flags flags)
|
||||
{
|
||||
rtx note;
|
||||
|
@ -3214,12 +3220,12 @@ df_get_call_refs (struct df_collection_rec * collection_rec,
|
|||
|
||||
/* Record the registers used to pass arguments, and explicitly
|
||||
noted as clobbered. */
|
||||
for (note = CALL_INSN_FUNCTION_USAGE (insn); note;
|
||||
for (note = CALL_INSN_FUNCTION_USAGE (insn_info->insn); note;
|
||||
note = XEXP (note, 1))
|
||||
{
|
||||
if (GET_CODE (XEXP (note, 0)) == USE)
|
||||
df_uses_record (collection_rec, &XEXP (XEXP (note, 0), 0),
|
||||
DF_REF_REG_USE, bb, insn, flags, -1, -1, 0);
|
||||
DF_REF_REG_USE, bb, insn_info, flags, -1, -1, 0);
|
||||
else if (GET_CODE (XEXP (note, 0)) == CLOBBER)
|
||||
{
|
||||
if (REG_P (XEXP (XEXP (note, 0), 0)))
|
||||
|
@ -3227,17 +3233,18 @@ df_get_call_refs (struct df_collection_rec * collection_rec,
|
|||
unsigned int regno = REGNO (XEXP (XEXP (note, 0), 0));
|
||||
if (!bitmap_bit_p (defs_generated, regno))
|
||||
df_defs_record (collection_rec, XEXP (note, 0), bb,
|
||||
insn, flags);
|
||||
insn_info, flags);
|
||||
}
|
||||
else
|
||||
df_uses_record (collection_rec, &XEXP (note, 0),
|
||||
DF_REF_REG_USE, bb, insn, flags, -1, -1, 0);
|
||||
DF_REF_REG_USE, bb, insn_info, flags, -1, -1, 0);
|
||||
}
|
||||
}
|
||||
|
||||
/* The stack ptr is used (honorarily) by a CALL insn. */
|
||||
df_ref_record (collection_rec, regno_reg_rtx[STACK_POINTER_REGNUM],
|
||||
NULL, bb, insn, DF_REF_REG_USE, DF_REF_CALL_STACK_USAGE | flags,
|
||||
NULL, bb, insn_info, DF_REF_REG_USE,
|
||||
DF_REF_CALL_STACK_USAGE | flags,
|
||||
-1, -1, 0);
|
||||
|
||||
/* Calls may also reference any of the global registers,
|
||||
|
@ -3246,12 +3253,12 @@ df_get_call_refs (struct df_collection_rec * collection_rec,
|
|||
if (global_regs[i])
|
||||
{
|
||||
df_ref_record (collection_rec, regno_reg_rtx[i],
|
||||
NULL, bb, insn, DF_REF_REG_USE, flags, -1, -1, 0);
|
||||
NULL, bb, insn_info, DF_REF_REG_USE, flags, -1, -1, 0);
|
||||
df_ref_record (collection_rec, regno_reg_rtx[i],
|
||||
NULL, bb, insn, DF_REF_REG_DEF, flags, -1, -1, 0);
|
||||
NULL, bb, insn_info, DF_REF_REG_DEF, flags, -1, -1, 0);
|
||||
}
|
||||
|
||||
is_sibling_call = SIBLING_CALL_P (insn);
|
||||
is_sibling_call = SIBLING_CALL_P (insn_info->insn);
|
||||
EXECUTE_IF_SET_IN_BITMAP (df_invalidated_by_call, 0, ui, bi)
|
||||
{
|
||||
if (!global_regs[ui]
|
||||
|
@ -3261,7 +3268,8 @@ df_get_call_refs (struct df_collection_rec * collection_rec,
|
|||
|| refers_to_regno_p (ui, ui+1,
|
||||
crtl->return_rtx, NULL)))
|
||||
df_ref_record (collection_rec, regno_reg_rtx[ui],
|
||||
NULL, bb, insn, DF_REF_REG_DEF, DF_REF_MAY_CLOBBER | flags,
|
||||
NULL, bb, insn_info, DF_REF_REG_DEF,
|
||||
DF_REF_MAY_CLOBBER | flags,
|
||||
-1, -1, 0);
|
||||
}
|
||||
|
||||
|
@ -3276,10 +3284,10 @@ df_get_call_refs (struct df_collection_rec * collection_rec,
|
|||
|
||||
static void
|
||||
df_insn_refs_collect (struct df_collection_rec* collection_rec,
|
||||
basic_block bb, rtx insn)
|
||||
basic_block bb, struct df_insn_info *insn_info)
|
||||
{
|
||||
rtx note;
|
||||
bool is_cond_exec = (GET_CODE (PATTERN (insn)) == COND_EXEC);
|
||||
bool is_cond_exec = (GET_CODE (PATTERN (insn_info->insn)) == COND_EXEC);
|
||||
|
||||
/* Clear out the collection record. */
|
||||
collection_rec->next_def = 0;
|
||||
|
@ -3288,10 +3296,10 @@ df_insn_refs_collect (struct df_collection_rec* collection_rec,
|
|||
collection_rec->next_mw = 0;
|
||||
|
||||
/* Record register defs. */
|
||||
df_defs_record (collection_rec, PATTERN (insn), bb, insn, 0);
|
||||
df_defs_record (collection_rec, PATTERN (insn_info->insn), bb, insn_info, 0);
|
||||
|
||||
/* Process REG_EQUIV/REG_EQUAL notes */
|
||||
for (note = REG_NOTES (insn); note;
|
||||
/* Process REG_EQUIV/REG_EQUAL notes. */
|
||||
for (note = REG_NOTES (insn_info->insn); note;
|
||||
note = XEXP (note, 1))
|
||||
{
|
||||
switch (REG_NOTE_KIND (note))
|
||||
|
@ -3300,20 +3308,18 @@ df_insn_refs_collect (struct df_collection_rec* collection_rec,
|
|||
case REG_EQUAL:
|
||||
df_uses_record (collection_rec,
|
||||
&XEXP (note, 0), DF_REF_REG_USE,
|
||||
bb, insn, DF_REF_IN_NOTE, -1, -1, 0);
|
||||
bb, insn_info, DF_REF_IN_NOTE, -1, -1, 0);
|
||||
break;
|
||||
case REG_NON_LOCAL_GOTO:
|
||||
/* The frame ptr is used by a non-local goto. */
|
||||
df_ref_record (collection_rec,
|
||||
regno_reg_rtx[FRAME_POINTER_REGNUM],
|
||||
NULL,
|
||||
bb, insn,
|
||||
NULL, bb, insn_info,
|
||||
DF_REF_REG_USE, 0, -1, -1, 0);
|
||||
#if FRAME_POINTER_REGNUM != HARD_FRAME_POINTER_REGNUM
|
||||
df_ref_record (collection_rec,
|
||||
regno_reg_rtx[HARD_FRAME_POINTER_REGNUM],
|
||||
NULL,
|
||||
bb, insn,
|
||||
NULL, bb, insn_info,
|
||||
DF_REF_REG_USE, 0, -1, -1, 0);
|
||||
#endif
|
||||
break;
|
||||
|
@ -3322,13 +3328,13 @@ df_insn_refs_collect (struct df_collection_rec* collection_rec,
|
|||
}
|
||||
}
|
||||
|
||||
if (CALL_P (insn))
|
||||
df_get_call_refs (collection_rec, bb, insn,
|
||||
if (CALL_P (insn_info->insn))
|
||||
df_get_call_refs (collection_rec, bb, insn_info,
|
||||
(is_cond_exec) ? DF_REF_CONDITIONAL : 0);
|
||||
|
||||
/* Record the register uses. */
|
||||
df_uses_record (collection_rec,
|
||||
&PATTERN (insn), DF_REF_REG_USE, bb, insn, 0,
|
||||
&PATTERN (insn_info->insn), DF_REF_REG_USE, bb, insn_info, 0,
|
||||
-1, -1, 0);
|
||||
|
||||
/* DF_REF_CONDITIONAL needs corresponding USES. */
|
||||
|
@ -3351,16 +3357,16 @@ df_recompute_luids (basic_block bb)
|
|||
/* Scan the block an insn at a time from beginning to end. */
|
||||
FOR_BB_INSNS (bb, insn)
|
||||
{
|
||||
struct df_insn_info *insn_info = DF_INSN_GET (insn);
|
||||
struct df_insn_info *insn_info = DF_INSN_INFO_GET (insn);
|
||||
/* Inserting labels does not always trigger the incremental
|
||||
rescanning. */
|
||||
if (!insn_info)
|
||||
{
|
||||
gcc_assert (!INSN_P (insn));
|
||||
df_insn_create_insn_record (insn);
|
||||
insn_info = df_insn_create_insn_record (insn);
|
||||
}
|
||||
|
||||
DF_INSN_LUID (insn) = luid;
|
||||
DF_INSN_INFO_LUID (insn_info) = luid;
|
||||
if (INSN_P (insn))
|
||||
luid++;
|
||||
}
|
||||
|
@ -3499,18 +3505,18 @@ df_bb_refs_record (int bb_index, bool scan_insns)
|
|||
/* Scan the block an insn at a time from beginning to end. */
|
||||
FOR_BB_INSNS (bb, insn)
|
||||
{
|
||||
struct df_insn_info *insn_info = DF_INSN_GET (insn);
|
||||
struct df_insn_info *insn_info = DF_INSN_INFO_GET (insn);
|
||||
gcc_assert (!insn_info);
|
||||
|
||||
df_insn_create_insn_record (insn);
|
||||
insn_info = df_insn_create_insn_record (insn);
|
||||
if (INSN_P (insn))
|
||||
{
|
||||
/* Record refs within INSN. */
|
||||
DF_INSN_LUID (insn) = luid++;
|
||||
df_insn_refs_collect (&collection_rec, bb, insn);
|
||||
DF_INSN_INFO_LUID (insn_info) = luid++;
|
||||
df_insn_refs_collect (&collection_rec, bb, DF_INSN_INFO_GET (insn));
|
||||
df_refs_add_to_chains (&collection_rec, bb, insn);
|
||||
}
|
||||
DF_INSN_LUID (insn) = luid;
|
||||
DF_INSN_INFO_LUID (insn_info) = luid;
|
||||
}
|
||||
|
||||
/* Other block level artificial refs */
|
||||
|
@ -4272,8 +4278,9 @@ df_insn_refs_verify (struct df_collection_rec *collection_rec,
|
|||
{
|
||||
bool ret1, ret2, ret3, ret4;
|
||||
unsigned int uid = INSN_UID (insn);
|
||||
struct df_insn_info *insn_info = DF_INSN_INFO_GET (insn);
|
||||
|
||||
df_insn_refs_collect (collection_rec, bb, insn);
|
||||
df_insn_refs_collect (collection_rec, bb, insn_info);
|
||||
|
||||
if (!DF_INSN_UID_DEFS (uid))
|
||||
{
|
||||
|
|
31
gcc/df.h
31
gcc/df.h
|
@ -370,9 +370,10 @@ struct df_ref
|
|||
rtx reg; /* The register referenced. */
|
||||
basic_block bb; /* Basic block containing the instruction. */
|
||||
|
||||
/* Insn containing ref. This will be null if this is an artificial
|
||||
reference. */
|
||||
rtx insn;
|
||||
/* Insn info for the insn containing ref. This will be null if this is
|
||||
an artificial reference. */
|
||||
struct df_insn_info *insn_info;
|
||||
|
||||
rtx *loc; /* The location of the reg. */
|
||||
struct df_link *chain; /* Head of def-use, use-def. */
|
||||
/* Location in the ref table. This is only valid after a call to
|
||||
|
@ -612,8 +613,9 @@ struct df
|
|||
#define DF_REF_LOC(REF) ((REF)->loc)
|
||||
#define DF_REF_BB(REF) ((REF)->bb)
|
||||
#define DF_REF_BBNO(REF) (DF_REF_BB (REF)->index)
|
||||
#define DF_REF_INSN(REF) ((REF)->insn)
|
||||
#define DF_REF_INSN_UID(REF) (INSN_UID ((REF)->insn))
|
||||
#define DF_REF_INSN_INFO(REF) ((REF)->insn_info)
|
||||
#define DF_REF_INSN(REF) ((REF)->insn_info->insn)
|
||||
#define DF_REF_INSN_UID(REF) (INSN_UID (DF_REF_INSN(REF)))
|
||||
#define DF_REF_TYPE(REF) ((REF)->type)
|
||||
#define DF_REF_CHAIN(REF) ((REF)->chain)
|
||||
#define DF_REF_ID(REF) ((REF)->id)
|
||||
|
@ -626,7 +628,7 @@ struct df
|
|||
but an artificial one created to model
|
||||
always live registers, eh uses, etc.
|
||||
ARTIFICIAL refs has NULL insn. */
|
||||
#define DF_REF_IS_ARTIFICIAL(REF) ((REF)->insn == NULL)
|
||||
#define DF_REF_IS_ARTIFICIAL(REF) ((REF)->insn_info == NULL)
|
||||
#define DF_REF_REG_MARK(REF) (DF_REF_FLAGS_SET ((REF),DF_REF_REG_MARKER))
|
||||
#define DF_REF_REG_UNMARK(REF) (DF_REF_FLAGS_CLEAR ((REF),DF_REF_REG_MARKER))
|
||||
#define DF_REF_IS_REG_MARKED(REF) (DF_REF_FLAGS_IS_SET ((REF),DF_REF_REG_MARKER))
|
||||
|
@ -691,12 +693,17 @@ struct df
|
|||
/* Macros to access the elements within the insn_info structure table. */
|
||||
|
||||
#define DF_INSN_SIZE() ((df)->insns_size)
|
||||
#define DF_INSN_GET(INSN) (df->insns[(INSN_UID(INSN))])
|
||||
#define DF_INSN_SET(INSN,VAL) (df->insns[(INSN_UID (INSN))]=(VAL))
|
||||
#define DF_INSN_LUID(INSN) (DF_INSN_GET(INSN)->luid)
|
||||
#define DF_INSN_DEFS(INSN) (DF_INSN_GET(INSN)->defs)
|
||||
#define DF_INSN_USES(INSN) (DF_INSN_GET(INSN)->uses)
|
||||
#define DF_INSN_EQ_USES(INSN) (DF_INSN_GET(INSN)->eq_uses)
|
||||
#define DF_INSN_INFO_GET(INSN) (df->insns[(INSN_UID(INSN))])
|
||||
#define DF_INSN_INFO_SET(INSN,VAL) (df->insns[(INSN_UID (INSN))]=(VAL))
|
||||
#define DF_INSN_INFO_LUID(II) ((II)->luid)
|
||||
#define DF_INSN_INFO_DEFS(II) ((II)->defs)
|
||||
#define DF_INSN_INFO_USES(II) ((II)->uses)
|
||||
#define DF_INSN_INFO_EQ_USES(II) ((II)->eq_uses)
|
||||
|
||||
#define DF_INSN_LUID(INSN) (DF_INSN_INFO_LUID (DF_INSN_INFO_GET(INSN)))
|
||||
#define DF_INSN_DEFS(INSN) (DF_INSN_INFO_DEFS (DF_INSN_INFO_GET(INSN)))
|
||||
#define DF_INSN_USES(INSN) (DF_INSN_INFO_USES (DF_INSN_INFO_GET(INSN)))
|
||||
#define DF_INSN_EQ_USES(INSN) (DF_INSN_INFO_EQ_USES (DF_INSN_INFO_GET(INSN)))
|
||||
|
||||
#define DF_INSN_UID_GET(UID) (df->insns[(UID)])
|
||||
#define DF_INSN_UID_SET(UID,VAL) (df->insns[(UID)]=(VAL))
|
||||
|
|
|
@ -2018,14 +2018,6 @@ The construct @code{(mem:BLK (scratch))} is considered to alias all
|
|||
other memories. Thus it may be used as a memory barrier in epilogue
|
||||
stack deallocation patterns.
|
||||
|
||||
@findex addressof
|
||||
@item (addressof:@var{m} @var{reg})
|
||||
This RTX represents a request for the address of register @var{reg}. Its mode
|
||||
is always @code{Pmode}. If there are any @code{addressof}
|
||||
expressions left in the function after CSE, @var{reg} is forced into the
|
||||
stack and the @code{addressof} expression is replaced with a @code{plus}
|
||||
expression for the address of its stack slot.
|
||||
|
||||
@findex concat
|
||||
@item (concat@var{m} @var{rtx} @var{rtx})
|
||||
This RTX represents the concatenation of two other RTXs. This is used
|
||||
|
|
23
gcc/fwprop.c
23
gcc/fwprop.c
|
@ -546,13 +546,13 @@ use_killed_between (struct df_ref *use, rtx def_insn, rtx target_insn)
|
|||
/* See if USE is killed between DEF_INSN and the last insn in the
|
||||
basic block containing DEF_INSN. */
|
||||
x = df_bb_regno_last_def_find (def_bb, regno);
|
||||
if (x && DF_INSN_LUID (x->insn) >= DF_INSN_LUID (def_insn))
|
||||
if (x && DF_INSN_LUID (DF_REF_INSN (x)) >= DF_INSN_LUID (def_insn))
|
||||
return true;
|
||||
|
||||
/* See if USE is killed between TARGET_INSN and the first insn in the
|
||||
basic block containing TARGET_INSN. */
|
||||
x = df_bb_regno_first_def_find (target_bb, regno);
|
||||
if (x && DF_INSN_LUID (x->insn) < DF_INSN_LUID (target_insn))
|
||||
if (x && DF_INSN_LUID (DF_REF_INSN (x)) < DF_INSN_LUID (target_insn))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
|
@ -570,6 +570,7 @@ static bool
|
|||
all_uses_available_at (rtx def_insn, rtx target_insn)
|
||||
{
|
||||
struct df_ref **use_rec;
|
||||
struct df_insn_info *insn_info = DF_INSN_INFO_GET (def_insn);
|
||||
rtx def_set = single_set (def_insn);
|
||||
|
||||
gcc_assert (def_set);
|
||||
|
@ -583,13 +584,13 @@ all_uses_available_at (rtx def_insn, rtx target_insn)
|
|||
|
||||
/* If the insn uses the reg that it defines, the substitution is
|
||||
invalid. */
|
||||
for (use_rec = DF_INSN_USES (def_insn); *use_rec; use_rec++)
|
||||
for (use_rec = DF_INSN_INFO_USES (insn_info); *use_rec; use_rec++)
|
||||
{
|
||||
struct df_ref *use = *use_rec;
|
||||
if (rtx_equal_p (DF_REF_REG (use), def_reg))
|
||||
return false;
|
||||
}
|
||||
for (use_rec = DF_INSN_EQ_USES (def_insn); *use_rec; use_rec++)
|
||||
for (use_rec = DF_INSN_INFO_EQ_USES (insn_info); *use_rec; use_rec++)
|
||||
{
|
||||
struct df_ref *use = *use_rec;
|
||||
if (rtx_equal_p (use->reg, def_reg))
|
||||
|
@ -600,13 +601,13 @@ all_uses_available_at (rtx def_insn, rtx target_insn)
|
|||
{
|
||||
/* Look at all the uses of DEF_INSN, and see if they are not
|
||||
killed between DEF_INSN and TARGET_INSN. */
|
||||
for (use_rec = DF_INSN_USES (def_insn); *use_rec; use_rec++)
|
||||
for (use_rec = DF_INSN_INFO_USES (insn_info); *use_rec; use_rec++)
|
||||
{
|
||||
struct df_ref *use = *use_rec;
|
||||
if (use_killed_between (use, def_insn, target_insn))
|
||||
return false;
|
||||
}
|
||||
for (use_rec = DF_INSN_EQ_USES (def_insn); *use_rec; use_rec++)
|
||||
for (use_rec = DF_INSN_INFO_EQ_USES (insn_info); *use_rec; use_rec++)
|
||||
{
|
||||
struct df_ref *use = *use_rec;
|
||||
if (use_killed_between (use, def_insn, target_insn))
|
||||
|
@ -767,8 +768,9 @@ try_fwprop_subst (struct df_ref *use, rtx *loc, rtx new, rtx def_insn, bool set_
|
|||
df_ref_remove (use);
|
||||
if (!CONSTANT_P (new))
|
||||
{
|
||||
update_df (insn, loc, DF_INSN_USES (def_insn), type, flags);
|
||||
update_df (insn, loc, DF_INSN_EQ_USES (def_insn), type, flags);
|
||||
struct df_insn_info *insn_info = DF_INSN_INFO_GET (def_insn);
|
||||
update_df (insn, loc, DF_INSN_INFO_USES (insn_info), type, flags);
|
||||
update_df (insn, loc, DF_INSN_INFO_EQ_USES (insn_info), type, flags);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -788,9 +790,10 @@ try_fwprop_subst (struct df_ref *use, rtx *loc, rtx new, rtx def_insn, bool set_
|
|||
set_unique_reg_note? */
|
||||
if (!CONSTANT_P (new))
|
||||
{
|
||||
update_df (insn, loc, DF_INSN_USES (def_insn),
|
||||
struct df_insn_info *insn_info = DF_INSN_INFO_GET (def_insn);
|
||||
update_df (insn, loc, DF_INSN_INFO_USES (insn_info),
|
||||
type, DF_REF_IN_NOTE);
|
||||
update_df (insn, loc, DF_INSN_EQ_USES (def_insn),
|
||||
update_df (insn, loc, DF_INSN_INFO_EQ_USES (insn_info),
|
||||
type, DF_REF_IN_NOTE);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -248,7 +248,7 @@ invariant_for_use (struct df_ref *use)
|
|||
{
|
||||
struct df_link *defs;
|
||||
struct df_ref *def;
|
||||
basic_block bb = BLOCK_FOR_INSN (use->insn), def_bb;
|
||||
basic_block bb = DF_REF_BB (use), def_bb;
|
||||
|
||||
if (use->flags & DF_REF_READ_WRITE)
|
||||
return NULL;
|
||||
|
@ -768,13 +768,14 @@ check_dependency (basic_block bb, struct df_ref *use, bitmap depends_on)
|
|||
static bool
|
||||
check_dependencies (rtx insn, bitmap depends_on)
|
||||
{
|
||||
struct df_insn_info *insn_info = DF_INSN_INFO_GET (insn);
|
||||
struct df_ref **use_rec;
|
||||
basic_block bb = BLOCK_FOR_INSN (insn);
|
||||
|
||||
for (use_rec = DF_INSN_USES (insn); *use_rec; use_rec++)
|
||||
for (use_rec = DF_INSN_INFO_USES (insn_info); *use_rec; use_rec++)
|
||||
if (!check_dependency (bb, *use_rec, depends_on))
|
||||
return false;
|
||||
for (use_rec = DF_INSN_EQ_USES (insn); *use_rec; use_rec++)
|
||||
for (use_rec = DF_INSN_INFO_EQ_USES (insn_info); *use_rec; use_rec++)
|
||||
if (!check_dependency (bb, *use_rec, depends_on))
|
||||
return false;
|
||||
|
||||
|
@ -850,17 +851,18 @@ find_invariant_insn (rtx insn, bool always_reached, bool always_executed)
|
|||
static void
|
||||
record_uses (rtx insn)
|
||||
{
|
||||
struct df_insn_info *insn_info = DF_INSN_INFO_GET (insn);
|
||||
struct df_ref **use_rec;
|
||||
struct invariant *inv;
|
||||
|
||||
for (use_rec = DF_INSN_USES (insn); *use_rec; use_rec++)
|
||||
for (use_rec = DF_INSN_INFO_USES (insn_info); *use_rec; use_rec++)
|
||||
{
|
||||
struct df_ref *use = *use_rec;
|
||||
inv = invariant_for_use (use);
|
||||
if (inv)
|
||||
record_use (inv->def, DF_REF_REAL_LOC (use), DF_REF_INSN (use));
|
||||
}
|
||||
for (use_rec = DF_INSN_EQ_USES (insn); *use_rec; use_rec++)
|
||||
for (use_rec = DF_INSN_INFO_EQ_USES (insn_info); *use_rec; use_rec++)
|
||||
{
|
||||
struct df_ref *use = *use_rec;
|
||||
inv = invariant_for_use (use);
|
||||
|
|
16
gcc/web.c
16
gcc/web.c
|
@ -105,22 +105,24 @@ union_defs (struct df_ref *use, struct web_entry *def_entry,
|
|||
struct web_entry *use_entry,
|
||||
bool (*fun) (struct web_entry *, struct web_entry *))
|
||||
{
|
||||
rtx insn = DF_REF_INSN (use);
|
||||
struct df_insn_info *insn_info = DF_REF_INSN_INFO (use);
|
||||
struct df_link *link = DF_REF_CHAIN (use);
|
||||
struct df_ref **use_link;
|
||||
struct df_ref **eq_use_link;
|
||||
struct df_ref **def_link;
|
||||
rtx set;
|
||||
|
||||
if (insn)
|
||||
if (insn_info)
|
||||
{
|
||||
use_link = DF_INSN_USES (insn);
|
||||
eq_use_link = DF_INSN_EQ_USES (insn);
|
||||
def_link = DF_INSN_DEFS (insn);
|
||||
rtx insn = insn_info->insn;
|
||||
use_link = DF_INSN_INFO_USES (insn_info);
|
||||
eq_use_link = DF_INSN_INFO_EQ_USES (insn_info);
|
||||
def_link = DF_INSN_INFO_DEFS (insn_info);
|
||||
set = single_set (insn);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* An artificial use. It links up with nothing. */
|
||||
use_link = NULL;
|
||||
eq_use_link = NULL;
|
||||
def_link = NULL;
|
||||
|
@ -180,8 +182,8 @@ union_defs (struct df_ref *use, struct web_entry *def_entry,
|
|||
{
|
||||
struct df_ref **link;
|
||||
|
||||
if (DF_REF_INSN (use))
|
||||
link = DF_INSN_DEFS (DF_REF_INSN (use));
|
||||
if (insn_info)
|
||||
link = DF_INSN_INFO_DEFS (insn_info);
|
||||
else
|
||||
link = NULL;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue