summaryrefslogtreecommitdiff
path: root/gcc/df.h
diff options
context:
space:
mode:
authorzadeck <zadeck@138bc75d-0d04-0410-961f-82ee72b054a4>2008-04-21 18:55:13 +0000
committerzadeck <zadeck@138bc75d-0d04-0410-961f-82ee72b054a4>2008-04-21 18:55:13 +0000
commitbf1f8fbc605e7217a2793f417e54ef3946a655ad (patch)
tree7a1b19b42f86a47fffcfe11926a453b8d560f7dd /gcc/df.h
parent772236db27f9c3dcb7a28a0d26d6134b63dffe18 (diff)
downloadgcc-bf1f8fbc605e7217a2793f417e54ef3946a655ad.tar.gz
2008-04-24 Richard Sandiford <rsandifo@nildram.co.uk>
Kenneth Zadeck <zadeck@naturalbridge.com> * dbgcnt.def (ra_byte_scan): Added. * dbgcnt.c (dbg_cnt): Added code to print message to dump_file when the last hit happens for a counter. * timevar.def (TV_DF_BYTE_LR): New variable. * tree-pass.h (pass_fast_rtl_byte_dce): New pass. * passes.c (pass_fast_rtl_byte_dce): New pass. * fwprop.c (update_df): Added mode to call df_ref_create. Renamed DF_REF_WIDTH and DF_REF_OFFSET to DF_REF_EXTRACT_WIDTH and DF_REF_EXTRACT_OFFSET. * df.h (DF_BYTE_LR, DF_BYTE_LR_BB_INFO, DF_BYTE_LR_IN, DF_BYTE_LR_OUT, df_byte_lr): New macro. (df_mm): New enum. (df_ref_extract): Added mode field. (DF_REF_WIDTH, DF_REF_OFFSET) Renamed to DF_REF_EXTRACT_WIDTH and DF_REF_EXTRACT_OFFSET. (DF_REF_EXTRACT_MODE): New macro. (df_byte_lr_bb_info): New structure. (df_print_byte_regset, df_compute_accessed_bytes, df_byte_lr_add_problem, df_byte_lr_get_regno_start, df_byte_lr_get_regno_len, df_byte_lr_simulate_defs, df_byte_lr_simulate_uses, df_byte_lr_simulate_artificial_refs_at_top, df_byte_lr_simulate_artificial_refs_at_end, df_compute_accessed_bytes): New function. (df_ref_create): Add parameter. (df_byte_lr_get_bb_info): New inline function. * df-scan.c (df_ref_record, df_uses_record, df_ref_create_structure): Added mode parameter. (df_ref_create, df_notes_rescan, df_ref_record, df_def_record_1, df_defs_record, df_uses_record, df_get_conditional_uses, df_get_call_refs, df_insn_refs_collect, df_bb_refs_collect, df_entry_block_defs_collect, df_exit_block_uses_collect): Added mode parameter to calls to df_ref_record, df_uses_record, df_ref_create_structure. (df_ref_equal_p, df_ref_compare): Added test for modes. (df_ref_create_structure): Added code to set mode. Renamed DF_REF_WIDTH and DF_REF_OFFSET to DF_REF_EXTRACT_WIDTH and DF_REF_EXTRACT_OFFSET. * df-core.c (df_print_byte_regset): New function. * df-byte-scan.c: New file. * df-problems.c (df_rd_transfer_function): Removed unnecessary calls to BITMAP_FREE. (df_byte_lr_problem_data, df_problem problem_BYTE_LR): New structure. (df_byte_lr_get_regno_start, df_byte_lr_get_regno_len, df_byte_lr_set_bb_info, df_byte_lr_free_bb_info, df_byte_lr_check_regs, df_byte_lr_expand_bitmap, df_byte_lr_alloc, df_byte_lr_reset, df_byte_lr_bb_local_compute, df_byte_lr_local_compute, df_byte_lr_init, df_byte_lr_confluence_0, df_byte_lr_confluence_n, df_byte_lr_transfer_function, df_byte_lr_free, df_byte_lr_top_dump, df_byte_lr_bottom_dump, df_byte_lr_add_problem, df_byte_lr_simulate_defs, df_byte_lr_simulate_uses, df_byte_lr_simulate_artificial_refs_at_top, df_byte_lr_simulate_artificial_refs_at_end): New function. * dce.c (byte_dce_process_block): New function. (dce_process_block): au is now passed in rather than computed locally. Changed loops that look at artificial defs to not look for conditional or partial ones, because there never are any. (fast_dce): Now is able to drive byte_dce_process_block or dce_process_block depending on the kind of dce being done. (rest_of_handle_fast_dce): Add parameter to fast_dce. (rest_of_handle_fast_byte_dce): New function. (rtl_opt_pass pass_fast_rtl_byte_dce): New pass. * Makefile.in (df-byte-scan.o, debugcnt.o): Added dependencies. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@134523 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/df.h')
-rw-r--r--gcc/df.h85
1 files changed, 70 insertions, 15 deletions
diff --git a/gcc/df.h b/gcc/df.h
index cf113aefd50..3c0894736df 100644
--- a/gcc/df.h
+++ b/gcc/df.h
@@ -42,12 +42,13 @@ struct df_link;
a uniform manner. The last four problems can be added or deleted
at any time are always defined (though LIVE is always there at -O2
or higher); the others are always there. */
-#define DF_SCAN 0
-#define DF_LR 1 /* Live Registers backward. */
-#define DF_LIVE 2 /* Live Registers & Uninitialized Registers */
-#define DF_RD 3 /* Reaching Defs. */
-#define DF_CHAIN 4 /* Def-Use and/or Use-Def Chains. */
-#define DF_NOTE 5 /* REG_DEF and REG_UNUSED notes. */
+#define DF_SCAN 0
+#define DF_LR 1 /* Live Registers backward. */
+#define DF_LIVE 2 /* Live Registers & Uninitialized Registers */
+#define DF_RD 3 /* Reaching Defs. */
+#define DF_CHAIN 4 /* Def-Use and/or Use-Def Chains. */
+#define DF_BYTE_LR 5 /* Subreg tracking lr. */
+#define DF_NOTE 6 /* REG_DEF and REG_UNUSED notes. */
#define DF_LAST_PROBLEM_PLUS1 (DF_NOTE + 1)
@@ -59,6 +60,13 @@ enum df_flow_dir
DF_BACKWARD
};
+/* Used in the byte scanning to determine if may or must info is to be
+ returned. */
+enum df_mm
+ {
+ DF_MM_MAY,
+ DF_MM_MUST
+ };
/* The first of these is a set of a register. The remaining three are
all uses of a register (the mem_load and mem_store relate to how
@@ -398,6 +406,7 @@ struct df_ref_extract
struct df_ref ref;
int width;
int offset;
+ enum machine_mode mode;
};
/* These links are used for two purposes:
@@ -573,6 +582,7 @@ struct df
#define DF_RD_BB_INFO(BB) (df_rd_get_bb_info((BB)->index))
#define DF_LR_BB_INFO(BB) (df_lr_get_bb_info((BB)->index))
#define DF_LIVE_BB_INFO(BB) (df_live_get_bb_info((BB)->index))
+#define DF_BYTE_LR_BB_INFO(BB) (df_byte_lr_get_bb_info((BB)->index))
/* Most transformations that wish to use live register analysis will
use these macros. This info is the and of the lr and live sets. */
@@ -585,6 +595,12 @@ struct df
#define DF_LR_IN(BB) (DF_LR_BB_INFO(BB)->in)
#define DF_LR_OUT(BB) (DF_LR_BB_INFO(BB)->out)
+/* These macros are used by passes that are not tolerant of
+ uninitialized variables. This intolerance should eventually
+ be fixed. */
+#define DF_BYTE_LR_IN(BB) (DF_BYTE_LR_BB_INFO(BB)->in)
+#define DF_BYTE_LR_OUT(BB) (DF_BYTE_LR_BB_INFO(BB)->out)
+
/* Macros to access the elements within the ref structure. */
@@ -619,8 +635,9 @@ struct df
#define DF_REF_PREV_REG(REF) ((REF)->prev_reg)
/* The following two macros may only be applied if one of
DF_REF_SIGN_EXTRACT | DF_REF_ZERO_EXTRACT is true. */
-#define DF_REF_WIDTH(REF) (((struct df_ref_extract *)(REF))->width)
-#define DF_REF_OFFSET(REF) (((struct df_ref_extract *)(REF))->offset)
+#define DF_REF_EXTRACT_WIDTH(REF) (((struct df_ref_extract *)(REF))->width)
+#define DF_REF_EXTRACT_OFFSET(REF) (((struct df_ref_extract *)(REF))->offset)
+#define DF_REF_EXTRACT_MODE(REF) (((struct df_ref_extract *)(REF))->mode)
/* Macros to determine the reference type. */
#define DF_REF_REG_DEF_P(REF) (DF_REF_TYPE (REF) == DF_REF_REG_DEF)
@@ -775,16 +792,33 @@ struct df_live_bb_info
};
+/* Live registers, a backwards dataflow problem. These bitmaps are
+indexed by the df_byte_lr_offset array which is indexed by pseudo. */
+
+struct df_byte_lr_bb_info
+{
+ /* Local sets to describe the basic blocks. */
+ bitmap def; /* The set of registers set in this block
+ - except artificial defs at the top. */
+ bitmap use; /* The set of registers used in this block. */
+
+ /* The results of the dataflow problem. */
+ bitmap in; /* Just before the block itself. */
+ bitmap out; /* At the bottom of the block. */
+};
+
+
/* This is used for debugging and for the dumpers to find the latest
instance so that the df info can be added to the dumps. This
should not be used by regular code. */
extern struct df *df;
-#define df_scan (df->problems_by_index[DF_SCAN])
-#define df_rd (df->problems_by_index[DF_RD])
-#define df_lr (df->problems_by_index[DF_LR])
-#define df_live (df->problems_by_index[DF_LIVE])
-#define df_chain (df->problems_by_index[DF_CHAIN])
-#define df_note (df->problems_by_index[DF_NOTE])
+#define df_scan (df->problems_by_index[DF_SCAN])
+#define df_rd (df->problems_by_index[DF_RD])
+#define df_lr (df->problems_by_index[DF_LR])
+#define df_live (df->problems_by_index[DF_LIVE])
+#define df_chain (df->problems_by_index[DF_CHAIN])
+#define df_byte_lr (df->problems_by_index[DF_BYTE_LR])
+#define df_note (df->problems_by_index[DF_NOTE])
/* This symbol turns on checking that each modification of the cfg has
been identified to the appropriate df routines. It is not part of
@@ -831,6 +865,7 @@ extern struct df_ref *df_find_use (rtx, rtx);
extern bool df_reg_used (rtx, rtx);
extern void df_worklist_dataflow (struct dataflow *,bitmap, int *, int);
extern void df_print_regset (FILE *file, bitmap r);
+extern void df_print_byte_regset (FILE *file, bitmap r);
extern void df_dump (FILE *);
extern void df_dump_region (FILE *);
extern void df_dump_start (FILE *);
@@ -867,6 +902,13 @@ extern void df_live_verify_transfer_functions (void);
extern void df_live_add_problem (void);
extern void df_live_set_all_dirty (void);
extern void df_chain_add_problem (enum df_chain_flags);
+extern void df_byte_lr_add_problem (void);
+extern int df_byte_lr_get_regno_start (unsigned int);
+extern int df_byte_lr_get_regno_len (unsigned int);
+extern void df_byte_lr_simulate_defs (rtx, bitmap);
+extern void df_byte_lr_simulate_uses (rtx, bitmap);
+extern void df_byte_lr_simulate_artificial_refs_at_top (basic_block, bitmap);
+extern void df_byte_lr_simulate_artificial_refs_at_end (basic_block, bitmap);
extern void df_note_add_problem (void);
extern void df_simulate_find_defs (rtx, bitmap);
extern void df_simulate_defs (rtx, bitmap);
@@ -885,7 +927,7 @@ extern void df_grow_insn_info (void);
extern void df_scan_blocks (void);
extern struct df_ref *df_ref_create (rtx, rtx *, rtx,basic_block,
enum df_ref_type, enum df_ref_flags,
- int, int);
+ int, int, enum machine_mode);
extern void df_ref_remove (struct df_ref *);
extern struct df_insn_info * df_insn_create_insn_record (rtx);
extern void df_insn_delete (basic_block, unsigned int);
@@ -911,6 +953,10 @@ extern void df_compute_regs_ever_live (bool);
extern bool df_read_modify_subreg_p (rtx);
extern void df_scan_verify (void);
+/* Functions defined in df-byte-scan.c. */
+extern bool df_compute_accessed_bytes (struct df_ref *, enum df_mm,
+ unsigned int *, unsigned int *);
+
/* Get basic block info. */
@@ -950,6 +996,15 @@ df_live_get_bb_info (unsigned int index)
return NULL;
}
+static inline struct df_byte_lr_bb_info *
+df_byte_lr_get_bb_info (unsigned int index)
+{
+ if (index < df_byte_lr->block_info_size)
+ return (struct df_byte_lr_bb_info *) df_byte_lr->block_info[index];
+ else
+ return NULL;
+}
+
/* Get the artificial defs for a basic block. */
static inline struct df_ref **