diff options
author | kan <kan@FreeBSD.org> | 2004-07-28 03:11:36 +0000 |
---|---|---|
committer | kan <kan@FreeBSD.org> | 2004-07-28 03:11:36 +0000 |
commit | 5e00ec74d8ce58f99801200d4d3d0412c7cc1b28 (patch) | |
tree | 052f4bb635f2bea2c5e350bd60c902be100a0d1e /contrib/gcc/df.h | |
parent | 87b8398a7d9f9bf0e28bbcd54a4fc27db2125f38 (diff) | |
download | FreeBSD-src-5e00ec74d8ce58f99801200d4d3d0412c7cc1b28.zip FreeBSD-src-5e00ec74d8ce58f99801200d4d3d0412c7cc1b28.tar.gz |
Gcc 3.4.2 20040728.
Diffstat (limited to 'contrib/gcc/df.h')
-rw-r--r-- | contrib/gcc/df.h | 216 |
1 files changed, 111 insertions, 105 deletions
diff --git a/contrib/gcc/df.h b/contrib/gcc/df.h index 59f3143..9838aa8 100644 --- a/contrib/gcc/df.h +++ b/contrib/gcc/df.h @@ -1,6 +1,6 @@ /* Form lists of pseudo register references for autoinc optimization - for GNU compiler. This is part of flow optimization. - Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc. + for GNU compiler. This is part of flow optimization. + Copyright (C) 1999, 2000, 2001, 2003 Free Software Foundation, Inc. Contributed by Michael P. Hayes (m.hayes@elec.canterbury.ac.nz) This file is part of GCC. @@ -29,18 +29,15 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #define DF_RD_CHAIN 64 /* Reg-def chain. */ #define DF_RU_CHAIN 128 /* Reg-use chain. */ #define DF_ALL 255 -#define DF_HARD_REGS 1024 +#define DF_HARD_REGS 1024 /* Mark hard registers. */ #define DF_EQUIV_NOTES 2048 /* Mark uses present in EQUIV/EQUAL notes. */ +#define DF_FOR_REGALLOC 4096 /* If called for the register allocator. */ enum df_ref_type {DF_REF_REG_DEF, DF_REF_REG_USE, DF_REF_REG_MEM_LOAD, DF_REF_REG_MEM_STORE}; #define DF_REF_TYPE_NAMES {"def", "use", "mem load", "mem store"} -/* ???> Perhaps all these data structures should be made private - to enforce the interface. */ - - /* Link on a def-use or use-def chain. */ struct df_link { @@ -50,27 +47,42 @@ struct df_link enum df_ref_flags { + /* Read-modify-write refs generate both a use and a def and + these are marked with this flag to show that they are not + independent. */ DF_REF_READ_WRITE = 1, - /* This flag is set on register references itself representing a or - being inside a subreg on machines which have CLASS_CANNOT_CHANGE_MODE - and where the mode change of that subreg expression is invalid for - this class. Note, that this flag can also be set on df_refs - representing the REG itself (i.e. one might not see the subreg - anyore). Also note, that this flag is set also for hardreg refs. - I.e. you must check yourself if it's a pseudo. */ - DF_REF_MODE_CHANGE = 2 + /* This flag is set on register references inside a subreg on + machines which have CANNOT_CHANGE_MODE_CLASS. + Note, that this flag can also be set on df_refs representing + the REG itself (i.e., one might not see the subreg anyore). + Also note, that this flag is set also for hardreg refs, i.e., + you must check yourself if it's a pseudo. */ + DF_REF_MODE_CHANGE = 2, + + /* This flag is set, if we stripped the subreg from the reference. + In this case we must make conservative guesses, at what the + outer mode was. */ + DF_REF_STRIPPED = 4, + + /* This flag is set during register allocation if it's okay for + the reference's INSN to have one of its operands replaced with a + memory reference. */ + DF_REF_MEM_OK = 8 }; -/* Define a register reference structure. */ + +/* Define a register reference structure. One of these is allocated + for every register reference (use or def). Note some register + references (e.g., post_inc, subreg) generate both a def and a use. */ struct ref { rtx reg; /* The register referenced. */ rtx insn; /* Insn containing ref. */ - rtx *loc; /* Loc is the location of the reg. */ + rtx *loc; /* The location of the reg. */ struct df_link *chain; /* Head of def-use or use-def chain. */ - enum df_ref_type type; /* Type of ref. */ unsigned int id; /* Ref index. */ + enum df_ref_type type; /* Type of ref. */ enum df_ref_flags flags; /* Various flags. */ }; @@ -80,12 +92,9 @@ struct insn_info { struct df_link *defs; /* Head of insn-def chain. */ struct df_link *uses; /* Head of insn-use chain. */ - /* ???? The following luid field should be considerd private so that + /* ???? The following luid field should be considered private so that we can change it on the fly to accommodate new insns? */ int luid; /* Logical UID. */ -#if 0 - rtx insn; /* Backpointer to the insn. */ -#endif }; @@ -148,15 +157,15 @@ 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. + /* 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 */ - int * inverse_rc_map; /* block number -> reverse completion order */ - int * inverse_dfs_map; /* block number -> DFS order */ - int * inverse_rts_map; /* block number -> reverse top-sort order */ + int *dfs_order; /* DFS order -> block number. */ + int *rc_order; /* Reverse completion order -> block number. */ + int *rts_order; /* Reverse top sort order -> block number. */ + int *inverse_rc_map; /* Block number -> reverse completion order. */ + int *inverse_dfs_map; /* Block number -> DFS order. */ + int *inverse_rts_map; /* Block number -> reverse top-sort order. */ }; @@ -171,18 +180,14 @@ struct df_map /* Macros to access the elements within the ref structure. */ + #define DF_REF_REAL_REG(REF) (GET_CODE ((REF)->reg) == SUBREG \ ? SUBREG_REG ((REF)->reg) : ((REF)->reg)) #define DF_REF_REGNO(REF) REGNO (DF_REF_REAL_REG (REF)) #define DF_REF_REAL_LOC(REF) (GET_CODE ((REF)->reg) == SUBREG \ ? &SUBREG_REG ((REF)->reg) : ((REF)->loc)) -#ifdef OLD_DF_INTERFACE -#define DF_REF_REG(REF) DF_REF_REAL_REG(REF) -#define DF_REF_LOC(REF) DF_REF_REAL_LOC(REF) -#else #define DF_REF_REG(REF) ((REF)->reg) #define DF_REF_LOC(REF) ((REF)->loc) -#endif #define DF_REF_BB(REF) (BLOCK_FOR_INSN ((REF)->insn)) #define DF_REF_BBNO(REF) (BLOCK_FOR_INSN ((REF)->insn)->index) #define DF_REF_INSN(REF) ((REF)->insn) @@ -199,7 +204,7 @@ struct df_map #define DF_REF_REG_MEM_STORE_P(REF) (DF_REF_TYPE (REF) == DF_REF_REG_MEM_STORE) #define DF_REF_REG_MEM_LOAD_P(REF) (DF_REF_TYPE (REF) == DF_REF_REG_MEM_LOAD) #define DF_REF_REG_MEM_P(REF) (DF_REF_REG_MEM_STORE_P (REF) \ - || DF_REF_REG_MEM_LOAD_P (REF)) + || DF_REF_REG_MEM_LOAD_P (REF)) /* Macros to access the elements within the reg_info structure table. */ @@ -226,120 +231,121 @@ struct df_map /* Functions to build and analyse dataflow information. */ -extern struct df *df_init PARAMS ((void)); +extern struct df *df_init (void); + +extern int df_analyse (struct df *, bitmap, int); -extern int df_analyse PARAMS ((struct df *, bitmap, int)); +extern void df_finish (struct df *); -extern void df_finish PARAMS ((struct df *)); +extern void df_dump (struct df *, int, FILE *); -extern void df_dump PARAMS ((struct df *, int, FILE *)); /* Functions to modify insns. */ -extern void df_insn_modify PARAMS ((struct df *, basic_block, rtx)); +extern void df_insn_modify (struct df *, basic_block, rtx); -extern rtx df_insn_delete PARAMS ((struct df *, basic_block, rtx)); +extern rtx df_insn_delete (struct df *, basic_block, rtx); -extern rtx df_pattern_emit_before PARAMS ((struct df *, rtx, - basic_block, rtx)); +extern rtx df_pattern_emit_before (struct df *, rtx, basic_block, rtx); -extern rtx df_jump_pattern_emit_after PARAMS ((struct df *, rtx, - basic_block, rtx)); +extern rtx df_jump_pattern_emit_after (struct df *, rtx, basic_block, rtx); -extern rtx df_pattern_emit_after PARAMS ((struct df *, rtx, - basic_block, rtx)); +extern rtx df_pattern_emit_after (struct df *, rtx, basic_block, rtx); -extern rtx df_insn_move_before PARAMS ((struct df *, basic_block, rtx, - basic_block, rtx)); +extern rtx df_insn_move_before (struct df *, basic_block, rtx, basic_block, + rtx); -extern int df_reg_replace PARAMS ((struct df *, bitmap, rtx, rtx)); +extern int df_reg_replace (struct df *, bitmap, rtx, rtx); -extern int df_ref_reg_replace PARAMS ((struct df *, struct ref *, rtx, rtx)); +extern int df_ref_reg_replace (struct df *, struct ref *, rtx, rtx); -extern int df_ref_remove PARAMS ((struct df *, struct ref *)); +extern int df_ref_remove (struct df *, struct ref *); -extern int df_insn_reg_replace PARAMS ((struct df *, basic_block, - rtx, rtx, rtx)); +extern int df_insn_reg_replace (struct df *, basic_block, rtx, rtx, rtx); -extern int df_insn_mem_replace PARAMS ((struct df *, basic_block, - rtx, rtx, rtx)); +extern int df_insn_mem_replace (struct df *, basic_block, rtx, rtx, rtx); -extern struct ref *df_bb_def_use_swap PARAMS ((struct df *, basic_block, - rtx, rtx, unsigned int)); +extern struct ref *df_bb_def_use_swap (struct df *, basic_block, rtx, rtx, + unsigned int); /* Functions to query dataflow information. */ -extern basic_block df_regno_bb PARAMS((struct df *, unsigned int)); +extern basic_block df_regno_bb (struct df *, unsigned int); -extern int df_reg_lifetime PARAMS ((struct df *, rtx)); +extern int df_reg_lifetime (struct df *, rtx); -extern int df_reg_global_p PARAMS ((struct df *, rtx)); +extern int df_reg_global_p (struct df *, rtx); -extern int df_insn_regno_def_p PARAMS ((struct df *, - basic_block, rtx, unsigned int)); +extern int df_insn_regno_def_p (struct df *, basic_block, rtx, unsigned int); -extern int df_insn_dominates_all_uses_p PARAMS ((struct df *, - basic_block, rtx)); +extern int df_insn_dominates_all_uses_p (struct df *, basic_block, rtx); -extern int df_insn_dominates_uses_p PARAMS ((struct df *, basic_block, - rtx, bitmap)); +extern int df_insn_dominates_uses_p (struct df *, basic_block, rtx, bitmap); -extern int df_bb_reg_live_start_p PARAMS ((struct df *, basic_block, rtx)); +extern int df_bb_reg_live_start_p (struct df *, basic_block, rtx); -extern int df_bb_reg_live_end_p PARAMS ((struct df *, basic_block, rtx)); +extern int df_bb_reg_live_end_p (struct df *, basic_block, rtx); -extern int df_bb_regs_lives_compare PARAMS ((struct df *, basic_block, - rtx, rtx)); +extern int df_bb_regs_lives_compare (struct df *, basic_block, rtx, rtx); -extern rtx df_bb_single_def_use_insn_find PARAMS((struct df *, basic_block, - rtx, rtx)); +extern rtx df_bb_single_def_use_insn_find (struct df *, basic_block, rtx, + rtx); /* Functions for debugging from GDB. */ -extern void debug_df_insn PARAMS ((rtx)); +extern void debug_df_insn (rtx); + +extern void debug_df_regno (unsigned int); + +extern void debug_df_reg (rtx); -extern void debug_df_regno PARAMS ((unsigned int)); +extern void debug_df_defno (unsigned int); -extern void debug_df_reg PARAMS ((rtx)); +extern void debug_df_useno (unsigned int); -extern void debug_df_defno PARAMS ((unsigned int)); +extern void debug_df_ref (struct ref *); -extern void debug_df_useno PARAMS ((unsigned int)); +extern void debug_df_chain (struct df_link *); -extern void debug_df_ref PARAMS ((struct ref *)); +extern void df_insn_debug (struct df *, rtx, FILE *); -extern void debug_df_chain PARAMS ((struct df_link *)); -extern void df_insn_debug PARAMS ((struct df *, rtx, FILE *)); -extern void df_insn_debug_regno PARAMS ((struct df *, rtx, FILE *)); -/* Meet over any path (UNION) or meet over all paths (INTERSECTION) */ +extern void df_insn_debug_regno (struct df *, rtx, FILE *); + + +/* Meet over any path (UNION) or meet over all paths (INTERSECTION). */ enum df_confluence_op { - UNION, - INTERSECTION + DF_UNION, + DF_INTERSECTION }; -/* Dataflow direction */ + + +/* Dataflow direction. */ enum df_flow_dir { - FORWARD, - BACKWARD + DF_FORWARD, + DF_BACKWARD }; -typedef void (*transfer_function_sbitmap) PARAMS ((int, int *, sbitmap, sbitmap, - sbitmap, sbitmap, void *)); -typedef void (*transfer_function_bitmap) PARAMS ((int, int *, bitmap, bitmap, - bitmap, bitmap, void *)); - -extern void iterative_dataflow_sbitmap PARAMS ((sbitmap *, sbitmap *, - sbitmap *, sbitmap *, - bitmap, enum df_flow_dir, - enum df_confluence_op, - transfer_function_sbitmap, - int *, void *)); -extern void iterative_dataflow_bitmap PARAMS ((bitmap *, bitmap *, bitmap *, - bitmap *, bitmap, - enum df_flow_dir, - enum df_confluence_op, - transfer_function_bitmap, - int *, void *)); + +typedef void (*transfer_function_sbitmap) (int, int *, sbitmap, sbitmap, + sbitmap, sbitmap, void *); + +typedef void (*transfer_function_bitmap) (int, int *, bitmap, bitmap, + bitmap, bitmap, void *); + +extern void iterative_dataflow_sbitmap (sbitmap *, sbitmap *, sbitmap *, + sbitmap *, bitmap, enum df_flow_dir, + enum df_confluence_op, + transfer_function_sbitmap, + int *, void *); + +extern void iterative_dataflow_bitmap (bitmap *, bitmap *, bitmap *, + bitmap *, bitmap, + enum df_flow_dir, + enum df_confluence_op, + transfer_function_bitmap, + int *, void *); +extern bool read_modify_subreg_p (rtx); |