summaryrefslogtreecommitdiff
path: root/gcc/df.h
diff options
context:
space:
mode:
authorrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>2014-06-15 07:39:30 +0000
committerrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>2014-06-15 07:39:30 +0000
commitddc2d0e33079b5cc3680457882d4dc29c66283e2 (patch)
treec9cc0c7a93ee539a01637eb16e85ac19667e3c9b /gcc/df.h
parent7b416b3fde3b4bf1f86c6e306aed7849366b5444 (diff)
downloadgcc-ddc2d0e33079b5cc3680457882d4dc29c66283e2.tar.gz
gcc/
* df.h (df_mw_hardreg, df_base_ref): Add a link pointer. (df_insn_info): Turn defs, uses, eq_uses and mw_hardregs into linked lists. (df_scan_bb_info): Likewise artificial_defs and artificial_uses. (DF_REF_NEXT_LOC, DF_MWS_NEXT): New macros. (FOR_EACH_INSN_INFO_DEF, FOR_EACH_INSN_INFO_USE) (FOR_EACH_INSN_INFO_EQ_USE, FOR_EACH_INSN_INFO_MW) (FOR_EACH_ARTIFICIAL_USE, FOR_EACH_ARTIFICIAL_DEF) (df_get_artificial_defs, df_get_artificial_uses) (df_single_def, df_single_use): Update accordingly. (df_refs_chain_dump): Take the first element in a linked list as parameter, rather than a pointer to an array of pointers. * df-core.c (df_refs_chain_dump, df_mws_dump): Likewise. * df-problems.c (df_rd_bb_local_compute_process_def): Likewise. (df_chain_create_bb_process_use): Likewise. (df_md_bb_local_compute_process_def): Likewise. * fwprop.c (process_defs, process_uses): Likewise. (register_active_defs, update_uses): Likewise. (forward_propagate_asm): Update for new df_ref linking. * df-scan.c (df_scan_free_ref_vec, df_scan_free_mws_vec): Delete. (df_null_ref_rec, df_null_mw_rec): Likewise. (df_scan_free_internal): Don't free df_ref and df_mw_hardreg lists explicitly. (df_scan_free_bb_info): Remove check for null artificial_defs. (df_install_ref_incremental): Adjust for new df_ref linking. Use a single-element insertion rather than a full sort. (df_ref_chain_delete_du_chain): Take the first element in a linked list as parameter, rather than a pointer to an array of pointers. (df_ref_chain_delete, df_mw_hardreg_chain_delete): Likewise. (df_add_refs_to_table, df_refs_verify, df_mws_verify): Likewise. (df_insn_info_delete): Remove check for null defs and call to df_scan_free_mws_vec. (df_insn_rescan): Initialize df_ref and df_mw_hardreg lists to null rather than df_null_*_rec. (df_insn_rescan_debug_internal): Likewise, and update null checks in the same way. Remove check for null defs. (df_ref_change_reg_with_loc_1): Fix choice of list for defs. Move a single element rather doing a full sort. (df_mw_hardreg_chain_delete_eq_uses): Adjust for new df_mw_hardreg linking. (df_notes_rescan): Likewise. Use a merge rather than a full sort. Initialize df_ref and df_mw_hardreg lists to null rather than df_null_*_rec. (df_ref_compare): Take df_refs as parameter, transferring the old interface to... (df_ref_ptr_compare): ...this new function. (df_sort_and_compress_refs): Update accordingly. (df_mw_compare): Take df_mw_hardregs as parameter, transferring the old interface to... (df_mw_ptr_compare): ...this new function. (df_sort_and_compress_mws): Update accordingly. (df_install_refs, df_install_mws): Return a linked list rather than an array of pointers. (df_refs_add_to_chains): Assert that old lists are empty rather than freeing them. (df_insn_refs_verify): Don't handle null defs speciailly. * web.c (union_match_dups): Update for new df_ref linking. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@211683 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/df.h')
-rw-r--r--gcc/df.h50
1 files changed, 25 insertions, 25 deletions
diff --git a/gcc/df.h b/gcc/df.h
index 0582bf0dcb5..1533949829b 100644
--- a/gcc/df.h
+++ b/gcc/df.h
@@ -339,6 +339,7 @@ struct dataflow
REG_UNUSED notes. */
struct df_mw_hardreg
{
+ df_mw_hardreg *next; /* Next entry for this instruction. */
rtx mw_reg; /* The multiword hardreg. */
/* These two bitfields are intentionally oversized, in the hope that
accesses to 16-bit fields will usually be quicker. */
@@ -365,6 +366,7 @@ struct df_base_ref
int flags : 16; /* Various df_ref_flags. */
unsigned int regno; /* The register number referenced. */
rtx reg; /* The register referenced. */
+ union df_ref_d *next_loc; /* Next ref for same insn or bb. */
struct df_link *chain; /* Head of def-use, use-def. */
/* Pointer to the insn info of the containing instruction. FIXME!
Currently this is NULL for artificial refs but this will be used
@@ -420,11 +422,11 @@ typedef union df_ref_d *df_ref;
struct df_insn_info
{
rtx insn; /* The insn this info comes from. */
- df_ref *defs; /* Head of insn-def chain. */
- df_ref *uses; /* Head of insn-use chain. */
+ df_ref defs; /* Head of insn-def chain. */
+ df_ref uses; /* Head of insn-use chain. */
/* Head of insn-use chain for uses in REG_EQUAL/EQUIV notes. */
- df_ref *eq_uses;
- struct df_mw_hardreg **mw_hardregs;
+ df_ref eq_uses;
+ struct df_mw_hardreg *mw_hardregs;
/* The logical uid of the insn in the basic block. This is valid
after any call to df_analyze but may rot after insns are added,
deleted or moved. */
@@ -665,6 +667,7 @@ struct df_d
#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))
+#define DF_REF_NEXT_LOC(REF) ((REF)->base.next_loc)
#define DF_REF_NEXT_REG(REF) ((REF)->base.next_reg)
#define DF_REF_PREV_REG(REF) ((REF)->base.prev_reg)
/* The following two macros may only be applied if one of
@@ -683,6 +686,7 @@ struct df_d
#define DF_MWS_REG_DEF_P(MREF) (DF_MWS_TYPE (MREF) == DF_REF_REG_DEF)
#define DF_MWS_REG_USE_P(MREF) ((MREF) && !DF_MWS_REG_DEF_P (MREF))
+#define DF_MWS_NEXT(MREF) ((MREF)->next)
#define DF_MWS_TYPE(MREF) ((MREF)->type)
/* Macros to get the refs out of def_info or use_info refs table. If
@@ -755,20 +759,16 @@ struct df_d
#define DF_INSN_UID_MWS(INSN) (DF_INSN_UID_GET (INSN)->mw_hardregs)
#define FOR_EACH_INSN_INFO_DEF(ITER, INSN) \
- for (df_ref *ITER##_ = DF_INSN_INFO_DEFS (INSN); (ITER = *ITER##_); \
- ++ITER##_)
+ for (ITER = DF_INSN_INFO_DEFS (INSN); ITER; ITER = DF_REF_NEXT_LOC (ITER))
#define FOR_EACH_INSN_INFO_USE(ITER, INSN) \
- for (df_ref *ITER##_ = DF_INSN_INFO_USES (INSN); (ITER = *ITER##_); \
- ++ITER##_)
+ for (ITER = DF_INSN_INFO_USES (INSN); ITER; ITER = DF_REF_NEXT_LOC (ITER))
#define FOR_EACH_INSN_INFO_EQ_USE(ITER, INSN) \
- for (df_ref *ITER##_ = DF_INSN_INFO_EQ_USES (INSN); (ITER = *ITER##_); \
- ++ITER##_)
+ for (ITER = DF_INSN_INFO_EQ_USES (INSN); ITER; ITER = DF_REF_NEXT_LOC (ITER))
#define FOR_EACH_INSN_INFO_MW(ITER, INSN) \
- for (df_mw_hardreg **ITER##_ = DF_INSN_INFO_MWS (INSN); (ITER = *ITER##_); \
- ++ITER##_)
+ for (ITER = DF_INSN_INFO_MWS (INSN); ITER; ITER = DF_MWS_NEXT (ITER))
#define FOR_EACH_INSN_DEF(ITER, INSN) \
FOR_EACH_INSN_INFO_DEF(ITER, DF_INSN_INFO_GET (INSN))
@@ -780,12 +780,12 @@ struct df_d
FOR_EACH_INSN_INFO_EQ_USE(ITER, DF_INSN_INFO_GET (INSN))
#define FOR_EACH_ARTIFICIAL_USE(ITER, BB_INDEX) \
- for (df_ref *ITER##_ = df_get_artificial_uses (BB_INDEX); \
- (ITER = *ITER##_); ++ITER##_)
+ for (ITER = df_get_artificial_uses (BB_INDEX); ITER; \
+ ITER = DF_REF_NEXT_LOC (ITER))
#define FOR_EACH_ARTIFICIAL_DEF(ITER, BB_INDEX) \
- for (df_ref *ITER##_ = df_get_artificial_defs (BB_INDEX); \
- (ITER = *ITER##_); ++ITER##_)
+ for (ITER = df_get_artificial_defs (BB_INDEX); ITER; \
+ ITER = DF_REF_NEXT_LOC (ITER))
/* An obstack for bitmap not related to specific dataflow problems.
This obstack should e.g. be used for bitmaps with a short life time
@@ -806,13 +806,13 @@ struct df_scan_bb_info
Blocks that are the targets of non-local goto's have the hard
frame pointer defined at the top of the block. */
- df_ref *artificial_defs;
+ df_ref artificial_defs;
/* Blocks that are targets of exception edges may have some
artificial uses. These are logically at the top of the block.
Most blocks have artificial uses at the bottom of the block. */
- df_ref *artificial_uses;
+ df_ref artificial_uses;
};
@@ -967,7 +967,7 @@ extern void df_dump_top (basic_block, FILE *);
extern void df_dump_bottom (basic_block, FILE *);
extern void df_dump_insn_top (const_rtx, FILE *);
extern void df_dump_insn_bottom (const_rtx, FILE *);
-extern void df_refs_chain_dump (df_ref *, bool, FILE *);
+extern void df_refs_chain_dump (df_ref, bool, FILE *);
extern void df_regs_chain_dump (df_ref, FILE *);
extern void df_insn_debug (rtx, bool, FILE *);
extern void df_insn_debug_regno (rtx, FILE *);
@@ -1147,7 +1147,7 @@ df_get_live_in (basic_block bb)
/* Get basic block info. */
/* Get the artificial defs for a basic block. */
-static inline df_ref *
+static inline df_ref
df_get_artificial_defs (unsigned int bb_index)
{
return df_scan_get_bb_info (bb_index)->artificial_defs;
@@ -1156,7 +1156,7 @@ df_get_artificial_defs (unsigned int bb_index)
/* Get the artificial uses for a basic block. */
-static inline df_ref *
+static inline df_ref
df_get_artificial_uses (unsigned int bb_index)
{
return df_scan_get_bb_info (bb_index)->artificial_uses;
@@ -1168,8 +1168,8 @@ df_get_artificial_uses (unsigned int bb_index)
static inline df_ref
df_single_def (const df_insn_info *info)
{
- df_ref *defs = DF_INSN_INFO_DEFS (info);
- return defs[0] && !defs[1] ? defs[0] : NULL;
+ df_ref defs = DF_INSN_INFO_DEFS (info);
+ return defs && !DF_REF_NEXT_LOC (defs) ? defs : NULL;
}
/* If INSN uses exactly one register, return the associated reference,
@@ -1178,8 +1178,8 @@ df_single_def (const df_insn_info *info)
static inline df_ref
df_single_use (const df_insn_info *info)
{
- df_ref *uses = DF_INSN_INFO_USES (info);
- return uses[0] && !uses[1] ? uses[0] : NULL;
+ df_ref uses = DF_INSN_INFO_USES (info);
+ return uses && !DF_REF_NEXT_LOC (uses) ? uses : NULL;
}
/* web */