diff options
author | steven <steven@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-06-18 05:42:23 +0000 |
---|---|---|
committer | steven <steven@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-06-18 05:42:23 +0000 |
commit | 158b6cc9bfed6b3b97b121d8ce7f4e62c2382651 (patch) | |
tree | 0c8c1622859a712e7e554f00afbc548652bc9317 /gcc/df-core.c | |
parent | 594fa6a7f0bfd36eb2f23d88f7832856d517d1e4 (diff) | |
download | gcc-158b6cc9bfed6b3b97b121d8ce7f4e62c2382651.tar.gz |
* 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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@136885 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/df-core.c')
-rw-r--r-- | gcc/df-core.c | 55 |
1 files changed, 30 insertions, 25 deletions
diff --git a/gcc/df-core.c b/gcc/df-core.c index 95932909ebb..9e23c759469 100644 --- a/gcc/df-core.c +++ b/gcc/df-core.c @@ -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. - -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. - -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. +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, 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) 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)) |