Makefile.in (df.o): Remove fibheap dependency.

* 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.

From-SVN: r82921
This commit is contained in:
Zdenek Dvorak 2004-06-10 17:01:01 +02:00 committed by Zdenek Dvorak
parent 109e00403a
commit 9bf7acfccb
4 changed files with 748 additions and 529 deletions

View File

@ -1,3 +1,36 @@
2004-06-10 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
* 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.
2004-06-10 Roger Sayle <roger@eyesopen.com>
* fold-const.c (fold_abs_const): Make extern.

View File

@ -140,7 +140,7 @@ XCFLAGS =
TCFLAGS =
CFLAGS = -g
STAGE1_CFLAGS = -g @stage1_cflags@
BOOT_CFLAGS = -g -O2
BOOT_CFLAGS = -g -O2
# Flags to determine code coverage. When coverage is disabled, this will
# contain the optimization flags, as you normally want code coverage
@ -1881,7 +1881,7 @@ tree-complex.o : tree-complex.c $(CONFIG_H) system.h $(TREE_H) \
flags.h
df.o : df.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
insn-config.h $(RECOG_H) function.h $(REGS_H) alloc-pool.h hard-reg-set.h \
$(BASIC_BLOCK_H) $(DF_H) $(FIBHEAP_H)
$(BASIC_BLOCK_H) $(DF_H)
var-tracking.o : var-tracking.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
$(RTL_H) $(TREE_H) hard-reg-set.h insn-config.h reload.h flags.h \
$(BASIC_BLOCK_H) output.h sbitmap.h alloc-pool.h $(FIBHEAP_H) $(HASHTAB_H)

1187
gcc/df.c

File diff suppressed because it is too large Load Diff

View File

@ -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 *);
typedef void (*transfer_function_bitmap) (int, int *, bitmap, bitmap,
bitmap, bitmap, void *);
/* The description of a dataflow problem to solve. */
extern void iterative_dataflow_sbitmap (sbitmap *, sbitmap *, sbitmap *,
sbitmap *, bitmap, enum df_flow_dir,
enum df_confluence_op,
transfer_function_sbitmap,
int *, void *);
enum set_representation
{
SR_SBITMAP, /* Represent sets by bitmaps. */
SR_BITMAP /* Represent sets by sbitmaps. */
};
extern void iterative_dataflow_bitmap (bitmap *, bitmap *, bitmap *,
bitmap *, bitmap,
enum df_flow_dir,
enum df_confluence_op,
transfer_function_bitmap,
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 (struct dataflow *);
extern bool read_modify_subreg_p (rtx);
#endif /* GCC_DF_H */