diff options
author | rakdver <rakdver@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-06-10 15:01:01 +0000 |
---|---|---|
committer | rakdver <rakdver@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-06-10 15:01:01 +0000 |
commit | 79f51373514cf1f6962fb39242bdea6720bba16a (patch) | |
tree | 13e9c8eb6c5881a41a65abc562c890d10c755a1c /gcc/df.h | |
parent | bcac70f4d50a99aa43ff3e04568348fd684c0bdc (diff) | |
download | linaro-gcc-79f51373514cf1f6962fb39242bdea6720bba16a.tar.gz linaro-gcc-79f51373514cf1f6962fb39242bdea6720bba16a.tar.bz2 linaro-gcc-79f51373514cf1f6962fb39242bdea6720bba16a.zip |
* Makefile.in (df.o): Remove fibheap dependency.
* df.h: Do not include sbitmap.h.
(struct ref): New field "data".
(DF_REF_DATA): New accessor macro.
(struct df): Field "dom" removed.
(df_analyze_subcfg): New function.
(transfer_function_sbitmap, transfer_function_bitmap): Replaced by ...
(transfer_function): ... new type.
(iterative_dataflow_sbitmap, iterative_dataflow_bitmap): Replaced by ...
(iterative_dataflow): ... new function.
(enum set_representation, struct dataflow): New.
* df.c: Do not include fibheap.h.
(df_reg_def_chain_clean, df_reg_use_chain_clean,
(df_bb_table_realloc, df_analyse_subcfg, free_reg_ref_chain,
prune_to_subcfg, df_bb_modify): New functions.
(df_bitmaps_alloc, df_reg_def_chain_create, df_reg_use_chain_create,
df_refs_update, df_reg_table_realloc, df_ref_create,
df_bb_reg_def_chain_create, df_bb_reg_use_chain_create,
df_bb_rd_local_compute, df_bb_ru_local_compute, df_bb_lr_local_compute,
df_analyse_1, df_insn_modify): Support analysing only a part of the cfg.
(dataflow_set_a_op_b, dataflow_set_copy): New functions.
(df_rd_transfer_function, df_ru_transfer_function,
df_lr_transfer_function): Type of bitmaps changed to void *.
(hybrid_search_bitmap, hybrid_search_sbitmap): Merge into ...
(hybrid_search): ... new function.
(iterative_dataflow_bitmap, iterative_dataflow_sbitmap): Merge into ...
(iterative_dataflow): ... new function. Avoid use of fibheaps for
a worklist. Do not process basic blocks unnecessarily.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@82921 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/df.h')
-rw-r--r-- | gcc/df.h | 53 |
1 files changed, 33 insertions, 20 deletions
@@ -24,7 +24,6 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #define GCC_DF_H #include "bitmap.h" -#include "sbitmap.h" #include "basic-block.h" #define DF_RD 1 /* Reaching definitions. */ @@ -91,6 +90,7 @@ struct ref unsigned int id; /* Ref index. */ enum df_ref_type type; /* Type of ref. */ enum df_ref_flags flags; /* Various flags. */ + void *data; /* The data assigned to it by user. */ }; @@ -164,9 +164,6 @@ struct df bitmap insns_modified; /* Insns that (may) have changed. */ bitmap bbs_modified; /* Blocks that (may) have changed. */ bitmap all_blocks; /* All blocks in CFG. */ - /* The sbitmap vector of dominators or NULL if not computed. - Ideally, this should be a pointer to a CFG object. */ - sbitmap *dom; int *dfs_order; /* DFS order -> block number. */ int *rc_order; /* Reverse completion order -> block number. */ int *rts_order; /* Reverse top sort order -> block number. */ @@ -203,6 +200,7 @@ struct df_map #define DF_REF_CHAIN(REF) ((REF)->chain) #define DF_REF_ID(REF) ((REF)->id) #define DF_REF_FLAGS(REF) ((REF)->flags) +#define DF_REF_DATA(REF) ((REF)->data) /* Macros to determine the reference type. */ @@ -241,6 +239,7 @@ struct df_map extern struct df *df_init (void); extern int df_analyze (struct df *, bitmap, int); +extern void df_analyze_subcfg (struct df *, bitmap, int); extern void df_finish (struct df *); @@ -308,7 +307,6 @@ extern struct ref *df_find_def (struct df *, rtx, rtx); extern int df_reg_used (struct df *, rtx, rtx); - /* Functions for debugging from GDB. */ extern void debug_df_insn (rtx); @@ -346,24 +344,39 @@ enum df_flow_dir }; -typedef void (*transfer_function_sbitmap) (int, int *, sbitmap, sbitmap, - sbitmap, sbitmap, void *); +typedef void (*transfer_function) (int, int *, void *, void *, + void *, void *, void *); + +/* The description of a dataflow problem to solve. */ -typedef void (*transfer_function_bitmap) (int, int *, bitmap, bitmap, - bitmap, bitmap, void *); +enum set_representation +{ + SR_SBITMAP, /* Represent sets by bitmaps. */ + SR_BITMAP /* Represent sets by sbitmaps. */ +}; -extern void iterative_dataflow_sbitmap (sbitmap *, sbitmap *, sbitmap *, - sbitmap *, bitmap, enum df_flow_dir, - enum df_confluence_op, - transfer_function_sbitmap, - int *, void *); +struct dataflow +{ + enum set_representation repr; /* The way the sets are represented. */ + + /* The following arrays are indexed by block indices, so they must always + be large enough even if we restrict ourselves just to a subset of cfg. */ + void **gen, **kill; /* Gen and kill sets. */ + void **in, **out; /* Results. */ + + enum df_flow_dir dir; /* Dataflow direction. */ + enum df_confluence_op conf_op; /* Confluence operator. */ + unsigned n_blocks; /* Number of basic blocks in the + order. */ + int *order; /* The list of basic blocks to work + with, in the order they should + be processed in. */ + transfer_function transfun; /* The transfer function. */ + void *data; /* Data used by the transfer + function. */ +}; -extern void iterative_dataflow_bitmap (bitmap *, bitmap *, bitmap *, - bitmap *, bitmap, - enum df_flow_dir, - enum df_confluence_op, - transfer_function_bitmap, - int *, void *); +extern void iterative_dataflow (struct dataflow *); extern bool read_modify_subreg_p (rtx); #endif /* GCC_DF_H */ |