Commit 50e94c7e by Steven Bosscher

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
parent 00bb81c1
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> 2008-06-17 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
* configure: Regenerate. * configure: Regenerate.
......
...@@ -154,12 +154,10 @@ deletable_insn_p (rtx insn, bool fast) ...@@ -154,12 +154,10 @@ deletable_insn_p (rtx insn, bool fast)
static inline int static inline int
marked_insn_p (rtx insn) marked_insn_p (rtx insn)
{ {
if (insn) /* Artificial defs are always needed and they do not have an insn.
return TEST_BIT (marked, INSN_UID (insn)); We should never see them here. */
else gcc_assert (insn);
/* Artificial defs are always needed and they do not have an return TEST_BIT (marked, INSN_UID (insn));
insn. */
return true;
} }
...@@ -339,7 +337,8 @@ mark_artificial_uses (void) ...@@ -339,7 +337,8 @@ mark_artificial_uses (void)
for (use_rec = df_get_artificial_uses (bb->index); for (use_rec = df_get_artificial_uses (bb->index);
*use_rec; use_rec++) *use_rec; use_rec++)
for (defs = DF_REF_CHAIN (*use_rec); defs; defs = defs->next) 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) ...@@ -362,7 +361,8 @@ mark_reg_dependencies (rtx insn)
fprintf (dump_file, " in insn %d:\n", INSN_UID (insn)); fprintf (dump_file, " in insn %d:\n", INSN_UID (insn));
} }
for (defs = DF_REF_CHAIN (use); defs; defs = defs->next) 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) ...@@ -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 deps when broken. If the first_def reaches the USE then
there is such a dep. */ there is such a dep. */
ddg_node_ptr first_def_node = get_node_of_insn (g, ddg_node_ptr first_def_node = get_node_of_insn (g,
first_def->insn); DF_REF_INSN (first_def));
gcc_assert (first_def_node); gcc_assert (first_def_node);
...@@ -314,7 +314,7 @@ add_cross_iteration_register_deps (ddg_ptr g, struct df_ref *last_def) ...@@ -314,7 +314,7 @@ add_cross_iteration_register_deps (ddg_ptr g, struct df_ref *last_def)
if (last_def->id == first_def->id) if (last_def->id == first_def->id)
return; 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); gcc_assert (dest_node);
create_ddg_dep_no_link (g, last_def_node, dest_node, create_ddg_dep_no_link (g, last_def_node, dest_node,
OUTPUT_DEP, REG_DEP, 1); OUTPUT_DEP, REG_DEP, 1);
......
...@@ -268,25 +268,29 @@ pseudos and long for the hard registers. ...@@ -268,25 +268,29 @@ pseudos and long for the hard registers.
ACCESSING INSNS: ACCESSING INSNS:
1) The df insn information is kept in the insns array. This array is 1) The df insn information is kept in an array of DF_INSN_INFO objects.
indexed by insn uid. 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 2) Each insn has three sets of refs, which are linked into one of three
DF_INSN_UID_DEFS macros), the insn's uses list (accessed by the lists: The insn's defs list (accessed by the DF_INSN_INFO_DEFS,
DF_INSN_USES or DF_INSN_UID_USES macros) or the insn's eq_uses list DF_INSN_DEFS, or DF_INSN_UID_DEFS macros), the insn's uses list
(accessed by the DF_INSN_EQ_USES or DF_INSN_UID_EQ_USES macros). (accessed by the DF_INSN_INFO_USES, DF_INSN_USES, or
The latter list are the list of references in REG_EQUAL or DF_INSN_UID_USES macros) or the insn's eq_uses list (accessed by the
REG_EQUIV notes. These macros produce a ref (or NULL), the rest of DF_INSN_INFO_EQ_USES, DF_INSN_EQ_USES or DF_INSN_UID_EQ_USES macros).
the list can be obtained by traversal of the NEXT_REF field The latter list are the list of references in REG_EQUAL or REG_EQUIV
(accessed by the DF_REF_NEXT_REF macro.) There is no significance notes. These macros produce a ref (or NULL), the rest of the list
to the ordering of the uses or refs in an instruction. 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
3) Each insn has a logical uid field (LUID). When properly set, this the uses or refs in an instruction.
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 3) Each insn has a logical uid field (LUID) which is stored in the
df_analyse. They will rot after insns are added deleted or moved DF_INSN_INFO object for the insn. The LUID field is accessed by
around. 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: ACCESSING REFS:
...@@ -2152,17 +2156,18 @@ df_insn_debug (rtx insn, bool follow_chain, FILE *file) ...@@ -2152,17 +2156,18 @@ df_insn_debug (rtx insn, bool follow_chain, FILE *file)
void void
df_insn_debug_regno (rtx insn, FILE *file) 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 ", fprintf (file, "insn %d bb %d luid %d defs ",
uid, BLOCK_FOR_INSN (insn)->index, DF_INSN_LUID (insn)); INSN_UID (insn), BLOCK_FOR_INSN (insn)->index,
df_refs_chain_dump (DF_INSN_UID_DEFS (uid), false, file); DF_INSN_INFO_LUID (insn_info));
df_refs_chain_dump (DF_INSN_INFO_DEFS (insn_info), false, file);
fprintf (file, " uses "); 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 "); 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"); fprintf (file, "\n");
} }
...@@ -2188,7 +2193,7 @@ df_ref_debug (struct df_ref *ref, FILE *file) ...@@ -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 ", fprintf (file, "reg %d bb %d insn %d flag 0x%x type 0x%x ",
DF_REF_REGNO (ref), DF_REF_REGNO (ref),
DF_REF_BBNO (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_FLAGS (ref),
DF_REF_TYPE (ref)); DF_REF_TYPE (ref));
if (DF_REF_LOC (ref)) if (DF_REF_LOC (ref))
......
...@@ -129,7 +129,7 @@ df_chain_dump (struct df_link *link, FILE *file) ...@@ -129,7 +129,7 @@ df_chain_dump (struct df_link *link, FILE *file)
DF_REF_REG_DEF_P (link->ref) ? 'd' : 'u', DF_REF_REG_DEF_P (link->ref) ? 'd' : 'u',
DF_REF_ID (link->ref), DF_REF_ID (link->ref),
DF_REF_BBNO (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, "}"); fprintf (file, "}");
} }
...@@ -1429,15 +1429,15 @@ df_live_bb_local_compute (unsigned int bb_index) ...@@ -1429,15 +1429,15 @@ df_live_bb_local_compute (unsigned int bb_index)
if (!insn_info) if (!insn_info)
{ {
gcc_assert (!INSN_P (insn)); 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)) if (!INSN_P (insn))
continue; continue;
luid++; 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; struct df_ref *def = *def_rec;
unsigned int regno = DF_REF_REGNO (def); unsigned int regno = DF_REF_REGNO (def);
...@@ -2201,14 +2201,14 @@ df_chain_top_dump (basic_block bb, FILE *file) ...@@ -2201,14 +2201,14 @@ df_chain_top_dump (basic_block bb, FILE *file)
FOR_BB_INSNS (bb, insn) FOR_BB_INSNS (bb, insn)
{ {
unsigned int uid = INSN_UID (insn);
if (INSN_P (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) if (*def_rec)
{ {
fprintf (file, ";; DU chains for insn luid %d uid %d\n", 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) while (*def_rec)
{ {
...@@ -2250,15 +2250,15 @@ df_chain_bottom_dump (basic_block bb, FILE *file) ...@@ -2250,15 +2250,15 @@ df_chain_bottom_dump (basic_block bb, FILE *file)
FOR_BB_INSNS (bb, insn) FOR_BB_INSNS (bb, insn)
{ {
unsigned int uid = INSN_UID (insn);
if (INSN_P (insn)) if (INSN_P (insn))
{ {
struct df_ref **eq_use_rec = DF_INSN_UID_EQ_USES (uid); struct df_insn_info *insn_info = DF_INSN_INFO_GET (insn);
use_rec = DF_INSN_UID_USES (uid); 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) if (*use_rec || *eq_use_rec)
{ {
fprintf (file, ";; UD chains for insn luid %d uid %d\n", 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) while (*use_rec)
{ {
...@@ -2515,8 +2515,9 @@ df_byte_lr_alloc (bitmap all_blocks ATTRIBUTE_UNUSED) ...@@ -2515,8 +2515,9 @@ df_byte_lr_alloc (bitmap all_blocks ATTRIBUTE_UNUSED)
{ {
if (INSN_P (insn)) if (INSN_P (insn))
{ {
df_byte_lr_check_regs (DF_INSN_DEFS (insn)); struct df_insn_info *insn_info = DF_INSN_INFO_GET (insn);
df_byte_lr_check_regs (DF_INSN_USES (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); bitmap_set_bit (df_byte_lr->out_of_date_transfer_functions, bb->index);
......
...@@ -370,9 +370,10 @@ struct df_ref ...@@ -370,9 +370,10 @@ struct df_ref
rtx reg; /* The register referenced. */ rtx reg; /* The register referenced. */
basic_block bb; /* Basic block containing the instruction. */ basic_block bb; /* Basic block containing the instruction. */
/* Insn containing ref. This will be null if this is an artificial /* Insn info for the insn containing ref. This will be null if this is
reference. */ an artificial reference. */
rtx insn; struct df_insn_info *insn_info;
rtx *loc; /* The location of the reg. */ rtx *loc; /* The location of the reg. */
struct df_link *chain; /* Head of def-use, use-def. */ struct df_link *chain; /* Head of def-use, use-def. */
/* Location in the ref table. This is only valid after a call to /* Location in the ref table. This is only valid after a call to
...@@ -612,8 +613,9 @@ struct df ...@@ -612,8 +613,9 @@ struct df
#define DF_REF_LOC(REF) ((REF)->loc) #define DF_REF_LOC(REF) ((REF)->loc)
#define DF_REF_BB(REF) ((REF)->bb) #define DF_REF_BB(REF) ((REF)->bb)
#define DF_REF_BBNO(REF) (DF_REF_BB (REF)->index) #define DF_REF_BBNO(REF) (DF_REF_BB (REF)->index)
#define DF_REF_INSN(REF) ((REF)->insn) #define DF_REF_INSN_INFO(REF) ((REF)->insn_info)
#define DF_REF_INSN_UID(REF) (INSN_UID ((REF)->insn)) #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_TYPE(REF) ((REF)->type)
#define DF_REF_CHAIN(REF) ((REF)->chain) #define DF_REF_CHAIN(REF) ((REF)->chain)
#define DF_REF_ID(REF) ((REF)->id) #define DF_REF_ID(REF) ((REF)->id)
...@@ -626,7 +628,7 @@ struct df ...@@ -626,7 +628,7 @@ struct df
but an artificial one created to model but an artificial one created to model
always live registers, eh uses, etc. always live registers, eh uses, etc.
ARTIFICIAL refs has NULL insn. */ 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_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_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)) #define DF_REF_IS_REG_MARKED(REF) (DF_REF_FLAGS_IS_SET ((REF),DF_REF_REG_MARKER))
...@@ -691,12 +693,17 @@ struct df ...@@ -691,12 +693,17 @@ struct df
/* Macros to access the elements within the insn_info structure table. */ /* Macros to access the elements within the insn_info structure table. */
#define DF_INSN_SIZE() ((df)->insns_size) #define DF_INSN_SIZE() ((df)->insns_size)
#define DF_INSN_GET(INSN) (df->insns[(INSN_UID(INSN))]) #define DF_INSN_INFO_GET(INSN) (df->insns[(INSN_UID(INSN))])
#define DF_INSN_SET(INSN,VAL) (df->insns[(INSN_UID (INSN))]=(VAL)) #define DF_INSN_INFO_SET(INSN,VAL) (df->insns[(INSN_UID (INSN))]=(VAL))
#define DF_INSN_LUID(INSN) (DF_INSN_GET(INSN)->luid) #define DF_INSN_INFO_LUID(II) ((II)->luid)
#define DF_INSN_DEFS(INSN) (DF_INSN_GET(INSN)->defs) #define DF_INSN_INFO_DEFS(II) ((II)->defs)
#define DF_INSN_USES(INSN) (DF_INSN_GET(INSN)->uses) #define DF_INSN_INFO_USES(II) ((II)->uses)
#define DF_INSN_EQ_USES(INSN) (DF_INSN_GET(INSN)->eq_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_GET(UID) (df->insns[(UID)])
#define DF_INSN_UID_SET(UID,VAL) (df->insns[(UID)]=(VAL)) #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 ...@@ -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 other memories. Thus it may be used as a memory barrier in epilogue
stack deallocation patterns. 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 @findex concat
@item (concat@var{m} @var{rtx} @var{rtx}) @item (concat@var{m} @var{rtx} @var{rtx})
This RTX represents the concatenation of two other RTXs. This is used This RTX represents the concatenation of two other RTXs. This is used
......
...@@ -546,13 +546,13 @@ use_killed_between (struct df_ref *use, rtx def_insn, rtx target_insn) ...@@ -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 /* See if USE is killed between DEF_INSN and the last insn in the
basic block containing DEF_INSN. */ basic block containing DEF_INSN. */
x = df_bb_regno_last_def_find (def_bb, regno); 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; return true;
/* See if USE is killed between TARGET_INSN and the first insn in the /* See if USE is killed between TARGET_INSN and the first insn in the
basic block containing TARGET_INSN. */ basic block containing TARGET_INSN. */
x = df_bb_regno_first_def_find (target_bb, regno); 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 true;
return false; return false;
...@@ -570,6 +570,7 @@ static bool ...@@ -570,6 +570,7 @@ static bool
all_uses_available_at (rtx def_insn, rtx target_insn) all_uses_available_at (rtx def_insn, rtx target_insn)
{ {
struct df_ref **use_rec; struct df_ref **use_rec;
struct df_insn_info *insn_info = DF_INSN_INFO_GET (def_insn);
rtx def_set = single_set (def_insn); rtx def_set = single_set (def_insn);
gcc_assert (def_set); gcc_assert (def_set);
...@@ -583,13 +584,13 @@ all_uses_available_at (rtx def_insn, rtx target_insn) ...@@ -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 /* If the insn uses the reg that it defines, the substitution is
invalid. */ 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; struct df_ref *use = *use_rec;
if (rtx_equal_p (DF_REF_REG (use), def_reg)) if (rtx_equal_p (DF_REF_REG (use), def_reg))
return false; 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; struct df_ref *use = *use_rec;
if (rtx_equal_p (use->reg, def_reg)) if (rtx_equal_p (use->reg, def_reg))
...@@ -600,13 +601,13 @@ all_uses_available_at (rtx def_insn, rtx target_insn) ...@@ -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 /* Look at all the uses of DEF_INSN, and see if they are not
killed between DEF_INSN and TARGET_INSN. */ 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; struct df_ref *use = *use_rec;
if (use_killed_between (use, def_insn, target_insn)) if (use_killed_between (use, def_insn, target_insn))
return false; 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; struct df_ref *use = *use_rec;
if (use_killed_between (use, def_insn, target_insn)) 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_ ...@@ -767,8 +768,9 @@ try_fwprop_subst (struct df_ref *use, rtx *loc, rtx new, rtx def_insn, bool set_
df_ref_remove (use); df_ref_remove (use);
if (!CONSTANT_P (new)) if (!CONSTANT_P (new))
{ {
update_df (insn, loc, DF_INSN_USES (def_insn), type, flags); struct df_insn_info *insn_info = DF_INSN_INFO_GET (def_insn);
update_df (insn, loc, DF_INSN_EQ_USES (def_insn), type, flags); 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 else
...@@ -788,9 +790,10 @@ try_fwprop_subst (struct df_ref *use, rtx *loc, rtx new, rtx def_insn, bool set_ ...@@ -788,9 +790,10 @@ try_fwprop_subst (struct df_ref *use, rtx *loc, rtx new, rtx def_insn, bool set_
set_unique_reg_note? */ set_unique_reg_note? */
if (!CONSTANT_P (new)) 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); 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); type, DF_REF_IN_NOTE);
} }
} }
......
...@@ -248,7 +248,7 @@ invariant_for_use (struct df_ref *use) ...@@ -248,7 +248,7 @@ invariant_for_use (struct df_ref *use)
{ {
struct df_link *defs; struct df_link *defs;
struct df_ref *def; 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) if (use->flags & DF_REF_READ_WRITE)
return NULL; return NULL;
...@@ -768,13 +768,14 @@ check_dependency (basic_block bb, struct df_ref *use, bitmap depends_on) ...@@ -768,13 +768,14 @@ check_dependency (basic_block bb, struct df_ref *use, bitmap depends_on)
static bool static bool
check_dependencies (rtx insn, bitmap depends_on) check_dependencies (rtx insn, bitmap depends_on)
{ {
struct df_insn_info *insn_info = DF_INSN_INFO_GET (insn);
struct df_ref **use_rec; struct df_ref **use_rec;
basic_block bb = BLOCK_FOR_INSN (insn); 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)) if (!check_dependency (bb, *use_rec, depends_on))
return false; 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)) if (!check_dependency (bb, *use_rec, depends_on))
return false; return false;
...@@ -850,17 +851,18 @@ find_invariant_insn (rtx insn, bool always_reached, bool always_executed) ...@@ -850,17 +851,18 @@ find_invariant_insn (rtx insn, bool always_reached, bool always_executed)
static void static void
record_uses (rtx insn) record_uses (rtx insn)
{ {
struct df_insn_info *insn_info = DF_INSN_INFO_GET (insn);
struct df_ref **use_rec; struct df_ref **use_rec;
struct invariant *inv; 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; struct df_ref *use = *use_rec;
inv = invariant_for_use (use); inv = invariant_for_use (use);
if (inv) if (inv)
record_use (inv->def, DF_REF_REAL_LOC (use), DF_REF_INSN (use)); 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; struct df_ref *use = *use_rec;
inv = invariant_for_use (use); inv = invariant_for_use (use);
......
...@@ -105,22 +105,24 @@ union_defs (struct df_ref *use, struct web_entry *def_entry, ...@@ -105,22 +105,24 @@ union_defs (struct df_ref *use, struct web_entry *def_entry,
struct web_entry *use_entry, struct web_entry *use_entry,
bool (*fun) (struct web_entry *, struct web_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_link *link = DF_REF_CHAIN (use);
struct df_ref **use_link; struct df_ref **use_link;
struct df_ref **eq_use_link; struct df_ref **eq_use_link;
struct df_ref **def_link; struct df_ref **def_link;
rtx set; rtx set;
if (insn) if (insn_info)
{ {
use_link = DF_INSN_USES (insn); rtx insn = insn_info->insn;
eq_use_link = DF_INSN_EQ_USES (insn); use_link = DF_INSN_INFO_USES (insn_info);
def_link = DF_INSN_DEFS (insn); eq_use_link = DF_INSN_INFO_EQ_USES (insn_info);
def_link = DF_INSN_INFO_DEFS (insn_info);
set = single_set (insn); set = single_set (insn);
} }
else else
{ {
/* An artificial use. It links up with nothing. */
use_link = NULL; use_link = NULL;
eq_use_link = NULL; eq_use_link = NULL;
def_link = NULL; def_link = NULL;
...@@ -180,8 +182,8 @@ union_defs (struct df_ref *use, struct web_entry *def_entry, ...@@ -180,8 +182,8 @@ union_defs (struct df_ref *use, struct web_entry *def_entry,
{ {
struct df_ref **link; struct df_ref **link;
if (DF_REF_INSN (use)) if (insn_info)
link = DF_INSN_DEFS (DF_REF_INSN (use)); link = DF_INSN_INFO_DEFS (insn_info);
else else
link = NULL; link = NULL;
......
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