GCC Middle and Back End API Reference
df.h File Reference
#include "bitmap.h"
#include "regset.h"
#include "sbitmap.h"
#include "basic-block.h"
#include "alloc-pool.h"
#include "timevar.h"
Include dependency graph for df.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  df_problem
struct  dataflow
struct  df_mw_hardreg
struct  df_base_ref
struct  df_artificial_ref
struct  df_regular_ref
union  df_ref_d
struct  df_insn_info
struct  df_link
struct  df_ref_info
struct  df_reg_info
struct  df_d
struct  df_scan_bb_info
struct  df_rd_bb_info
struct  df_md_bb_info
struct  df_lr_bb_info
struct  df_live_bb_info
struct  df_word_lr_bb_info
struct  web_entry

Macros

#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_WORD_LR   5 /* Subreg tracking lr. */
#define DF_NOTE   6 /* REG_DEAD and REG_UNUSED notes. */
#define DF_MD   7 /* Multiple Definitions. */
#define DF_LAST_PROBLEM_PLUS1   (DF_MD + 1)
#define DF_SCAN_BB_INFO(BB)   (df_scan_get_bb_info ((BB)->index))
#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_WORD_LR_BB_INFO(BB)   (df_word_lr_get_bb_info ((BB)->index))
#define DF_MD_BB_INFO(BB)   (df_md_get_bb_info ((BB)->index))
#define DF_LIVE_IN(BB)   (&DF_LIVE_BB_INFO (BB)->in)
#define DF_LIVE_OUT(BB)   (&DF_LIVE_BB_INFO (BB)->out)
#define DF_LR_IN(BB)   (&DF_LR_BB_INFO (BB)->in)
#define DF_LR_OUT(BB)   (&DF_LR_BB_INFO (BB)->out)
#define DF_WORD_LR_IN(BB)   (&DF_WORD_LR_BB_INFO (BB)->in)
#define DF_WORD_LR_OUT(BB)   (&DF_WORD_LR_BB_INFO (BB)->out)
#define DF_REF_REAL_REG(REF)
#define DF_REF_REGNO(REF)   ((REF)->base.regno)
#define DF_REF_REAL_LOC(REF)
#define DF_REF_REG(REF)   ((REF)->base.reg)
#define DF_REF_LOC(REF)
#define DF_REF_BB(REF)
#define DF_REF_BBNO(REF)   (DF_REF_BB (REF)->index)
#define DF_REF_INSN_INFO(REF)   ((REF)->base.insn_info)
#define DF_REF_INSN(REF)   ((REF)->base.insn_info->insn)
#define DF_REF_INSN_UID(REF)   (INSN_UID (DF_REF_INSN(REF)))
#define DF_REF_CLASS(REF)   ((REF)->base.cl)
#define DF_REF_TYPE(REF)   ((REF)->base.type)
#define DF_REF_CHAIN(REF)   ((REF)->base.chain)
#define DF_REF_ID(REF)   ((REF)->base.id)
#define DF_REF_FLAGS(REF)   ((REF)->base.flags)
#define DF_REF_FLAGS_IS_SET(REF, v)   ((DF_REF_FLAGS (REF) & (v)) != 0)
#define DF_REF_FLAGS_SET(REF, v)   (DF_REF_FLAGS (REF) |= (v))
#define DF_REF_FLAGS_CLEAR(REF, v)   (DF_REF_FLAGS (REF) &= ~(v))
#define DF_REF_ORDER(REF)   ((REF)->base.ref_order)
#define DF_REF_IS_ARTIFICIAL(REF)   (DF_REF_CLASS (REF) == DF_REF_ARTIFICIAL)
#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_REG(REF)   ((REF)->base.next_reg)
#define DF_REF_PREV_REG(REF)   ((REF)->base.prev_reg)
#define DF_REF_EXTRACT_WIDTH(REF)   ((REF)->extract_ref.width)
#define DF_REF_EXTRACT_OFFSET(REF)   ((REF)->extract_ref.offset)
#define DF_REF_EXTRACT_MODE(REF)   ((REF)->extract_ref.mode)
#define DF_REF_REG_DEF_P(REF)   (DF_REF_TYPE (REF) == DF_REF_REG_DEF)
#define DF_REF_REG_USE_P(REF)   ((REF) && !DF_REF_REG_DEF_P (REF))
#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)
#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_TYPE(MREF)   ((MREF)->type)
#define DF_DEFS_TABLE_SIZE()   (df->def_info.table_size)
#define DF_DEFS_GET(ID)   (df->def_info.refs[(ID)])
#define DF_DEFS_SET(ID, VAL)   (df->def_info.refs[(ID)]=(VAL))
#define DF_DEFS_COUNT(ID)   (df->def_info.count[(ID)])
#define DF_DEFS_BEGIN(ID)   (df->def_info.begin[(ID)])
#define DF_USES_TABLE_SIZE()   (df->use_info.table_size)
#define DF_USES_GET(ID)   (df->use_info.refs[(ID)])
#define DF_USES_SET(ID, VAL)   (df->use_info.refs[(ID)]=(VAL))
#define DF_USES_COUNT(ID)   (df->use_info.count[(ID)])
#define DF_USES_BEGIN(ID)   (df->use_info.begin[(ID)])
#define DF_REG_SIZE(DF)   (df->regs_inited)
#define DF_REG_DEF_GET(REG)   (df->def_regs[(REG)])
#define DF_REG_DEF_CHAIN(REG)   (df->def_regs[(REG)]->reg_chain)
#define DF_REG_DEF_COUNT(REG)   (df->def_regs[(REG)]->n_refs)
#define DF_REG_USE_GET(REG)   (df->use_regs[(REG)])
#define DF_REG_USE_CHAIN(REG)   (df->use_regs[(REG)]->reg_chain)
#define DF_REG_USE_COUNT(REG)   (df->use_regs[(REG)]->n_refs)
#define DF_REG_EQ_USE_GET(REG)   (df->eq_use_regs[(REG)])
#define DF_REG_EQ_USE_CHAIN(REG)   (df->eq_use_regs[(REG)]->reg_chain)
#define DF_REG_EQ_USE_COUNT(REG)   (df->eq_use_regs[(REG)]->n_refs)
#define DF_REGNO_FIRST_DEF(REGNUM)   (DF_REG_DEF_GET(REGNUM) ? DF_REG_DEF_GET (REGNUM) : 0)
#define DF_REGNO_LAST_USE(REGNUM)   (DF_REG_USE_GET(REGNUM) ? DF_REG_USE_GET (REGNUM) : 0)
#define DF_INSN_SIZE()   ((df)->insns_size)
#define DF_INSN_INFO_GET(INSN)   (df->insns[(INSN_UID (INSN))])
#define DF_INSN_INFO_SET(INSN, VAL)   (df->insns[(INSN_UID (INSN))]=(VAL))
#define DF_INSN_INFO_LUID(II)   ((II)->luid)
#define DF_INSN_INFO_DEFS(II)   ((II)->defs)
#define DF_INSN_INFO_USES(II)   ((II)->uses)
#define DF_INSN_INFO_EQ_USES(II)   ((II)->eq_uses)
#define DF_INSN_LUID(INSN)   (DF_INSN_INFO_LUID (DF_INSN_INFO_GET (INSN)))
#define DF_INSN_DEFS(INSN)   (DF_INSN_INFO_DEFS (DF_INSN_INFO_GET (INSN)))
#define DF_INSN_USES(INSN)   (DF_INSN_INFO_USES (DF_INSN_INFO_GET (INSN)))
#define DF_INSN_EQ_USES(INSN)   (DF_INSN_INFO_EQ_USES (DF_INSN_INFO_GET (INSN)))
#define DF_INSN_UID_GET(UID)   (df->insns[(UID)])
#define DF_INSN_UID_SET(UID, VAL)   (df->insns[(UID)]=(VAL))
#define DF_INSN_UID_SAFE_GET(UID)
#define DF_INSN_UID_LUID(INSN)   (DF_INSN_UID_GET (INSN)->luid)
#define DF_INSN_UID_DEFS(INSN)   (DF_INSN_UID_GET (INSN)->defs)
#define DF_INSN_UID_USES(INSN)   (DF_INSN_UID_GET (INSN)->uses)
#define DF_INSN_UID_EQ_USES(INSN)   (DF_INSN_UID_GET (INSN)->eq_uses)
#define DF_INSN_UID_MWS(INSN)   (DF_INSN_UID_GET (INSN)->mw_hardregs)
#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_word_lr   (df->problems_by_index[DF_WORD_LR])
#define df_note   (df->problems_by_index[DF_NOTE])
#define df_md   (df->problems_by_index[DF_MD])

Typedefs

typedef void(* df_alloc_function )(bitmap)
typedef void(* df_reset_function )(bitmap)
typedef void(* df_free_bb_function )(basic_block, void *)
typedef void(* df_local_compute_function )(bitmap)
typedef void(* df_init_function )(bitmap)
typedef void(* df_dataflow_function )(struct dataflow *, bitmap, int *, int)
typedef void(* df_confluence_function_0 )(basic_block)
typedef bool(* df_confluence_function_n )(edge)
typedef bool(* df_transfer_function )(int)
typedef void(* df_finalizer_function )(bitmap)
typedef void(* df_free_function )(void)
typedef void(* df_remove_problem_function )(void)
typedef void(* df_dump_problem_function )(FILE *)
typedef void(* df_dump_bb_problem_function )(basic_block, FILE *)
typedef void(* df_dump_insn_problem_function )(const_rtx, FILE *)
typedef void(* df_verify_solution_start )(void)
typedef void(* df_verify_solution_end )(void)
typedef union df_ref_ddf_ref

Enumerations

enum  df_flow_dir { DF_NONE, DF_FORWARD, DF_BACKWARD }
enum  df_ref_class { DF_REF_BASE, DF_REF_ARTIFICIAL, DF_REF_REGULAR }
enum  df_ref_type { DF_REF_REG_DEF, DF_REF_REG_USE, DF_REF_REG_MEM_LOAD, DF_REF_REG_MEM_STORE }
enum  df_ref_flags {
  DF_REF_CONDITIONAL = 1 << 0, DF_REF_AT_TOP = 1 << 1, DF_REF_IN_NOTE = 1 << 2, DF_HARD_REG_LIVE = 1 << 3,
  DF_REF_PARTIAL = 1 << 4, DF_REF_READ_WRITE = 1 << 5, DF_REF_MAY_CLOBBER = 1 << 6, DF_REF_MUST_CLOBBER = 1 << 7,
  DF_REF_SIGN_EXTRACT = 1 << 8, DF_REF_ZERO_EXTRACT = 1 << 9, DF_REF_STRICT_LOW_PART = 1 << 10, DF_REF_SUBREG = 1 << 11,
  DF_REF_MW_HARDREG = 1 << 12, DF_REF_CALL_STACK_USAGE = 1 << 13, DF_REF_REG_MARKER = 1 << 14, DF_REF_PRE_POST_MODIFY = 1 << 15
}
enum  df_ref_order {
  DF_REF_ORDER_NO_TABLE, DF_REF_ORDER_UNORDERED, DF_REF_ORDER_UNORDERED_WITH_NOTES, DF_REF_ORDER_BY_REG,
  DF_REF_ORDER_BY_REG_WITH_NOTES, DF_REF_ORDER_BY_INSN, DF_REF_ORDER_BY_INSN_WITH_NOTES
}
enum  df_chain_flags { DF_DU_CHAIN = 1, DF_UD_CHAIN = 2 }
enum  df_changeable_flags {
  DF_LR_RUN_DCE = 1 << 0, DF_NO_HARD_REGS = 1 << 1, DF_EQ_NOTES = 1 << 2, DF_NO_REGS_EVER_LIVE = 1 << 3,
  DF_NO_INSN_RESCAN = 1 << 4, DF_DEFER_INSN_RESCAN = 1 << 5, DF_RD_PRUNE_DEAD_DEFS = 1 << 6, DF_VERIFY_SCHEDULED = 1 << 7
}

Functions

void df_add_problem (struct df_problem *)
int df_set_flags (int)
int df_clear_flags (int)
void df_set_blocks (bitmap)
void df_remove_problem (struct dataflow *)
void df_finish_pass (bool)
void df_analyze_problem (struct dataflow *, bitmap, int *, int)
void df_analyze (void)
int df_get_n_blocks (enum df_flow_dir)
int * df_get_postorder (enum df_flow_dir)
void df_simple_dataflow (enum df_flow_dir, df_init_function, df_confluence_function_0, df_confluence_function_n, df_transfer_function, bitmap, int *, int)
void df_mark_solutions_dirty (void)
bool df_get_bb_dirty (basic_block)
void df_set_bb_dirty (basic_block)
void df_compact_blocks (void)
void df_bb_replace (int, basic_block)
void df_bb_delete (int)
void df_verify (void)
df_ref df_bb_regno_first_def_find (basic_block, unsigned int)
df_ref df_bb_regno_last_def_find (basic_block, unsigned int)
df_ref df_find_def (rtx, rtx)
bool df_reg_defined (rtx, rtx)
df_ref df_find_use (rtx, rtx)
bool df_reg_used (rtx, rtx)
void df_worklist_dataflow (struct dataflow *, bitmap, int *, int)
void df_print_regset (FILE *file, bitmap r)
void df_print_word_regset (FILE *file, bitmap r)
void df_dump (FILE *)
void df_dump_region (FILE *)
void df_dump_start (FILE *)
void df_dump_top (basic_block, FILE *)
void df_dump_bottom (basic_block, FILE *)
void df_dump_insn_top (const_rtx, FILE *)
void df_dump_insn_bottom (const_rtx, FILE *)
void df_refs_chain_dump (df_ref *, bool, FILE *)
void df_regs_chain_dump (df_ref, FILE *)
void df_insn_debug (rtx, bool, FILE *)
void df_insn_debug_regno (rtx, FILE *)
void df_regno_debug (unsigned int, FILE *)
void df_ref_debug (df_ref, FILE *)
void debug_df_insn (rtx)
void debug_df_regno (unsigned int)
void debug_df_reg (rtx)
void debug_df_defno (unsigned int)
void debug_df_useno (unsigned int)
void debug_df_ref (df_ref)
void debug_df_chain (struct df_link *)
struct df_linkdf_chain_create (df_ref, df_ref)
void df_chain_unlink (df_ref)
void df_chain_copy (df_ref, struct df_link *)
void df_grow_bb_info (struct dataflow *)
void df_chain_dump (struct df_link *, FILE *)
void df_print_bb_index (basic_block bb, FILE *file)
void df_rd_add_problem (void)
void df_rd_simulate_artificial_defs_at_top (basic_block, bitmap)
void df_rd_simulate_one_insn (basic_block, rtx, bitmap)
void df_lr_add_problem (void)
void df_lr_verify_transfer_functions (void)
void df_live_verify_transfer_functions (void)
void df_live_add_problem (void)
void df_live_set_all_dirty (void)
void df_chain_add_problem (unsigned int)
void df_word_lr_add_problem (void)
bool df_word_lr_mark_ref (df_ref, bool, bitmap)
bool df_word_lr_simulate_defs (rtx, bitmap)
void df_word_lr_simulate_uses (rtx, bitmap)
void df_word_lr_simulate_artificial_refs_at_top (basic_block, bitmap)
void df_word_lr_simulate_artificial_refs_at_end (basic_block, bitmap)
void df_note_add_problem (void)
void df_md_add_problem (void)
void df_md_simulate_artificial_defs_at_top (basic_block, bitmap)
void df_md_simulate_one_insn (basic_block, rtx, bitmap)
void df_simulate_find_noclobber_defs (rtx, bitmap)
void df_simulate_find_defs (rtx, bitmap)
void df_simulate_defs (rtx, bitmap)
void df_simulate_uses (rtx, bitmap)
void df_simulate_initialize_backwards (basic_block, bitmap)
void df_simulate_one_insn_backwards (basic_block, rtx, bitmap)
void df_simulate_finalize_backwards (basic_block, bitmap)
void df_simulate_initialize_forwards (basic_block, bitmap)
void df_simulate_one_insn_forwards (basic_block, rtx, bitmap)
void simulate_backwards_to_point (basic_block, regset, rtx)
bool can_move_insns_across (rtx, rtx, rtx, rtx, basic_block, regset, regset, rtx *)
void df_scan_alloc (bitmap)
void df_scan_add_problem (void)
void df_grow_reg_info (void)
void df_grow_insn_info (void)
void df_scan_blocks (void)
df_ref df_ref_create (rtx, rtx *, rtx, basic_block, enum df_ref_type, int ref_flags)
void df_uses_create (rtx *, rtx, int)
void df_ref_remove (df_ref)
struct df_insn_infodf_insn_create_insn_record (rtx)
void df_insn_delete (rtx)
void df_bb_refs_record (int, bool)
bool df_insn_rescan (rtx)
bool df_insn_rescan_debug_internal (rtx)
void df_insn_rescan_all (void)
void df_process_deferred_rescans (void)
void df_recompute_luids (basic_block)
void df_insn_change_bb (rtx, basic_block)
void df_maybe_reorganize_use_refs (enum df_ref_order)
void df_maybe_reorganize_def_refs (enum df_ref_order)
void df_ref_change_reg_with_loc (int, int, rtx)
void df_notes_rescan (rtx)
void df_hard_reg_init (void)
void df_update_entry_block_defs (void)
void df_update_exit_block_uses (void)
void df_update_entry_exit_and_calls (void)
bool df_hard_reg_used_p (unsigned int)
unsigned int df_hard_reg_used_count (unsigned int)
bool df_regs_ever_live_p (unsigned int)
void df_set_regs_ever_live (unsigned int, bool)
void df_compute_regs_ever_live (bool)
bool df_read_modify_subreg_p (rtx)
void df_scan_verify (void)
static struct df_scan_bb_infodf_scan_get_bb_info ()
static struct df_rd_bb_infodf_rd_get_bb_info ()
static struct df_lr_bb_infodf_lr_get_bb_info ()
static struct df_md_bb_infodf_md_get_bb_info ()
static struct df_live_bb_infodf_live_get_bb_info ()
static struct df_word_lr_bb_infodf_word_lr_get_bb_info ()
static bitmap df_get_live_out ()
static bitmap df_get_live_in ()
static df_refdf_get_artificial_defs ()
static df_refdf_get_artificial_uses ()
struct web_entryunionfind_root (struct web_entry *)
bool unionfind_union (struct web_entry *, struct web_entry *)
void union_defs (df_ref, struct web_entry *, unsigned int *used, struct web_entry *, bool(*fun)(struct web_entry *, struct web_entry *))

Variables

bitmap_obstack df_bitmap_obstack
struct df_ddf

Macro Definition Documentation

#define DF_CHAIN   4 /* Def-Use and/or Use-Def Chains. */
#define df_chain   (df->problems_by_index[DF_CHAIN])
#define DF_DEFS_BEGIN (   ID)    (df->def_info.begin[(ID)])
#define DF_DEFS_COUNT (   ID)    (df->def_info.count[(ID)])
#define DF_DEFS_GET (   ID)    (df->def_info.refs[(ID)])
#define DF_DEFS_SET (   ID,
  VAL 
)    (df->def_info.refs[(ID)]=(VAL))
#define DF_DEFS_TABLE_SIZE ( )    (df->def_info.table_size)

Macros to get the refs out of def_info or use_info refs table. If the focus of the dataflow has been set to some subset of blocks with df_set_blocks, these macros will only find the uses and defs in that subset of blocks.

These macros should be used with care. The def macros are only usable after a call to df_maybe_reorganize_def_refs and the use macros are only usable after a call to df_maybe_reorganize_use_refs. HOWEVER, BUILDING AND USING THESE ARRAYS ARE A CACHE LOCALITY KILLER.

#define DF_INSN_DEFS (   INSN)    (DF_INSN_INFO_DEFS (DF_INSN_INFO_GET (INSN)))
#define DF_INSN_EQ_USES (   INSN)    (DF_INSN_INFO_EQ_USES (DF_INSN_INFO_GET (INSN)))
#define DF_INSN_INFO_DEFS (   II)    ((II)->defs)
#define DF_INSN_INFO_EQ_USES (   II)    ((II)->eq_uses)
#define DF_INSN_INFO_GET (   INSN)    (df->insns[(INSN_UID (INSN))])
#define DF_INSN_INFO_LUID (   II)    ((II)->luid)
#define DF_INSN_INFO_SET (   INSN,
  VAL 
)    (df->insns[(INSN_UID (INSN))]=(VAL))
#define DF_INSN_INFO_USES (   II)    ((II)->uses)
#define DF_INSN_LUID (   INSN)    (DF_INSN_INFO_LUID (DF_INSN_INFO_GET (INSN)))

Referenced by try_combine().

#define DF_INSN_SIZE ( )    ((df)->insns_size)

Macros to access the elements within the insn_info structure table.

#define DF_INSN_UID_DEFS (   INSN)    (DF_INSN_UID_GET (INSN)->defs)
#define DF_INSN_UID_EQ_USES (   INSN)    (DF_INSN_UID_GET (INSN)->eq_uses)
#define DF_INSN_UID_GET (   UID)    (df->insns[(UID)])
#define DF_INSN_UID_LUID (   INSN)    (DF_INSN_UID_GET (INSN)->luid)
#define DF_INSN_UID_MWS (   INSN)    (DF_INSN_UID_GET (INSN)->mw_hardregs)
#define DF_INSN_UID_SAFE_GET (   UID)
Value:
(((unsigned)(UID) < DF_INSN_SIZE ()) \
? DF_INSN_UID_GET (UID) \
: NULL)

Referenced by df_insn_rescan_debug_internal(), and df_ref_chain_delete().

#define DF_INSN_UID_SET (   UID,
  VAL 
)    (df->insns[(UID)]=(VAL))
#define DF_INSN_UID_USES (   INSN)    (DF_INSN_UID_GET (INSN)->uses)
#define DF_INSN_USES (   INSN)    (DF_INSN_INFO_USES (DF_INSN_INFO_GET (INSN)))
#define DF_LAST_PROBLEM_PLUS1   (DF_MD + 1)
#define DF_LIVE   2 /* Live Registers & Uninitialized Registers */
#define DF_LIVE_BB_INFO (   BB)    (df_live_get_bb_info ((BB)->index))
#define DF_LIVE_IN (   BB)    (&DF_LIVE_BB_INFO (BB)->in)

Most transformations that wish to use live register analysis will use these macros. This info is the and of the lr and live sets.

Referenced by df_live_finalize(), and df_live_free().

#define DF_LIVE_OUT (   BB)    (&DF_LIVE_BB_INFO (BB)->out)

Referenced by df_live_finalize(), and df_live_free().

#define DF_LR   1 /* Live Registers backward. */
#define DF_LR_BB_INFO (   BB)    (df_lr_get_bb_info ((BB)->index))
#define DF_LR_IN (   BB)    (&DF_LR_BB_INFO (BB)->in)

These macros are used by passes that are not tolerant of uninitialized variables. This intolerance should eventually be fixed.

Referenced by df_lr_free(), and init_reg_last().

#define DF_LR_OUT (   BB)    (&DF_LR_BB_INFO (BB)->out)
#define DF_MD   7 /* Multiple Definitions. */
#define df_md   (df->problems_by_index[DF_MD])
#define DF_MD_BB_INFO (   BB)    (df_md_get_bb_info ((BB)->index))
#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_TYPE (   MREF)    ((MREF)->type)
#define DF_NOTE   6 /* REG_DEAD and REG_UNUSED notes. */
#define df_note   (df->problems_by_index[DF_NOTE])

Referenced by df_word_lr_confluence_n().

#define DF_RD   3 /* Reaching Defs. */
#define df_rd   (df->problems_by_index[DF_RD])

Referenced by df_rd_alloc().

#define DF_RD_BB_INFO (   BB)    (df_rd_get_bb_info ((BB)->index))
#define DF_REF_BB (   REF)
Value:
? (REF)->artificial_ref.bb \

Referenced by gate_fwprop().

#define DF_REF_BBNO (   REF)    (DF_REF_BB (REF)->index)
#define DF_REF_CLASS (   REF)    ((REF)->base.cl)
#define DF_REF_EXTRACT_MODE (   REF)    ((REF)->extract_ref.mode)
#define DF_REF_EXTRACT_OFFSET (   REF)    ((REF)->extract_ref.offset)
#define DF_REF_EXTRACT_WIDTH (   REF)    ((REF)->extract_ref.width)

The following two macros may only be applied if one of DF_REF_SIGN_EXTRACT | DF_REF_ZERO_EXTRACT is true.

#define DF_REF_FLAGS_CLEAR (   REF,
 
)    (DF_REF_FLAGS (REF) &= ~(v))
#define DF_REF_FLAGS_IS_SET (   REF,
 
)    ((DF_REF_FLAGS (REF) & (v)) != 0)
#define DF_REF_FLAGS_SET (   REF,
 
)    (DF_REF_FLAGS (REF) |= (v))

Referenced by df_refs_add_to_chains().

#define DF_REF_ID (   REF)    ((REF)->base.id)
#define DF_REF_INSN (   REF)    ((REF)->base.insn_info->insn)
#define DF_REF_INSN_INFO (   REF)    ((REF)->base.insn_info)

Referenced by one_pre_gcse_pass().

#define DF_REF_INSN_UID (   REF)    (INSN_UID (DF_REF_INSN(REF)))
#define DF_REF_IS_ARTIFICIAL (   REF)    (DF_REF_CLASS (REF) == DF_REF_ARTIFICIAL)

If DF_REF_IS_ARTIFICIAL () is true, this is not a real definition/use, but an artificial one created to model always live registers, eh uses, etc.

Referenced by df_chain_dump(), df_ref_compress_rec(), find_call_stack_args(), and prescan_insns_for_dce().

#define DF_REF_IS_REG_MARKED (   REF)    (DF_REF_FLAGS_IS_SET ((REF),DF_REF_REG_MARKER))

Referenced by df_hard_reg_init().

#define DF_REF_LOC (   REF)
Value:
(REF)->regular_ref.loc : NULL)

Referenced by df_note_bb_compute(), and df_word_lr_add_problem().

#define DF_REF_NEXT_REG (   REF)    ((REF)->base.next_reg)

Referenced by one_pre_gcse_pass().

#define DF_REF_ORDER (   REF)    ((REF)->base.ref_order)
#define DF_REF_PREV_REG (   REF)    ((REF)->base.prev_reg)
#define DF_REF_REAL_LOC (   REF)
Value:
(GET_CODE (*((REF)->regular_ref.loc)) == SUBREG \
? &SUBREG_REG (*((REF)->regular_ref.loc)) : ((REF)->regular_ref.loc))

Referenced by dead_debug_global_insert(), dead_debug_insert_temp(), and df_note_bb_compute().

#define DF_REF_REAL_REG (   REF)
Value:
(GET_CODE ((REF)->base.reg) == SUBREG \
? SUBREG_REG ((REF)->base.reg) : ((REF)->base.reg))

Macros to access the elements within the ref structure.

Referenced by one_pre_gcse_pass().

#define DF_REF_REG (   REF)    ((REF)->base.reg)
#define DF_REF_REG_DEF_P (   REF)    (DF_REF_TYPE (REF) == DF_REF_REG_DEF)

Macros to determine the reference type.

Referenced by df_chain_dump(), and df_refs_add_to_chains().

#define DF_REF_REG_MARK (   REF)    (DF_REF_FLAGS_SET ((REF),DF_REF_REG_MARKER))
#define DF_REF_REG_MEM_LOAD_P (   REF)    (DF_REF_TYPE (REF) == DF_REF_REG_MEM_LOAD)
#define DF_REF_REG_MEM_P (   REF)
#define DF_REF_REG_MEM_STORE_P (   REF)    (DF_REF_TYPE (REF) == DF_REF_REG_MEM_STORE)
#define DF_REF_REG_UNMARK (   REF)    (DF_REF_FLAGS_CLEAR ((REF),DF_REF_REG_MARKER))

Referenced by df_hard_reg_init().

#define DF_REF_REG_USE_P (   REF)    ((REF) && !DF_REF_REG_DEF_P (REF))
#define DF_REF_TYPE (   REF)    ((REF)->base.type)

Referenced by gate_fwprop().

#define DF_REG_DEF_CHAIN (   REG)    (df->def_regs[(REG)]->reg_chain)
#define DF_REG_DEF_COUNT (   REG)    (df->def_regs[(REG)]->n_refs)

Referenced by get_varargs_alias_set().

#define DF_REG_DEF_GET (   REG)    (df->def_regs[(REG)])
#define DF_REG_EQ_USE_CHAIN (   REG)    (df->eq_use_regs[(REG)]->reg_chain)
#define DF_REG_EQ_USE_COUNT (   REG)    (df->eq_use_regs[(REG)]->n_refs)
#define DF_REG_EQ_USE_GET (   REG)    (df->eq_use_regs[(REG)])
#define DF_REG_SIZE (   DF)    (df->regs_inited)

Macros to access the register information from scan dataflow record.

Referenced by best_gain_for_invariant().

#define DF_REG_USE_CHAIN (   REG)    (df->use_regs[(REG)]->reg_chain)
#define DF_REG_USE_COUNT (   REG)    (df->use_regs[(REG)]->n_refs)
#define DF_REG_USE_GET (   REG)    (df->use_regs[(REG)])
#define DF_REGNO_FIRST_DEF (   REGNUM)    (DF_REG_DEF_GET(REGNUM) ? DF_REG_DEF_GET (REGNUM) : 0)

Macros to access the elements within the reg_info structure table.

Referenced by best_gain_for_invariant().

#define DF_REGNO_LAST_USE (   REGNUM)    (DF_REG_USE_GET(REGNUM) ? DF_REG_USE_GET (REGNUM) : 0)

Referenced by best_gain_for_invariant().

#define DF_SCAN   0

Data flow problems. All problems must have a unique id here. Scanning is not really a dataflow problem, but it is useful to have the basic block functions in the vector so that things get done in 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   (df->problems_by_index[DF_SCAN])
#define DF_SCAN_BB_INFO (   BB)    (df_scan_get_bb_info ((BB)->index))
#define DF_USES_BEGIN (   ID)    (df->use_info.begin[(ID)])
#define DF_USES_COUNT (   ID)    (df->use_info.count[(ID)])
#define DF_USES_GET (   ID)    (df->use_info.refs[(ID)])

Referenced by gate_fwprop().

#define DF_USES_SET (   ID,
  VAL 
)    (df->use_info.refs[(ID)]=(VAL))
#define DF_USES_TABLE_SIZE ( )    (df->use_info.table_size)
#define DF_WORD_LR   5 /* Subreg tracking lr. */
#define df_word_lr   (df->problems_by_index[DF_WORD_LR])

Referenced by fast_dce(), and gate_ud_dce().

#define DF_WORD_LR_BB_INFO (   BB)    (df_word_lr_get_bb_info ((BB)->index))
#define DF_WORD_LR_IN (   BB)    (&DF_WORD_LR_BB_INFO (BB)->in)

These macros are used by passes that are not tolerant of uninitialized variables. This intolerance should eventually be fixed.

#define DF_WORD_LR_OUT (   BB)    (&DF_WORD_LR_BB_INFO (BB)->out)

Referenced by gate_ud_dce().


Typedef Documentation

typedef void(* df_alloc_function)(bitmap)

Function prototypes added to df_problem instance. Allocate the problem specific data.

typedef void(* df_confluence_function_0)(basic_block)

Confluence operator for blocks with 0 out (or in) edges.

typedef bool(* df_confluence_function_n)(edge)

Confluence operator for blocks with 1 or more out (or in) edges. Return true if BB input data has changed.

typedef void(* df_dataflow_function)(struct dataflow *, bitmap, int *, int)

Iterative dataflow function.

typedef void(* df_dump_bb_problem_function)(basic_block, FILE *)

Function to dump top or bottom of basic block results to FILE.

typedef void(* df_dump_insn_problem_function)(const_rtx, FILE *)

Function to dump before or after an insn to FILE.

typedef void(* df_dump_problem_function)(FILE *)

Function to dump basic block independent results to FILE.

typedef void(* df_finalizer_function)(bitmap)

Function to massage the information after the problem solving.

typedef void(* df_free_bb_function)(basic_block, void *)

Free the basic block info. Called from the block reordering code to get rid of the blocks that have been squished down.

typedef void(* df_free_function)(void)

Function to free all of the problem specific datastructures.

typedef void(* df_init_function)(bitmap)

Init the solution specific data.

typedef void(* df_local_compute_function)(bitmap)

Local compute function.

typedef union df_ref_d* df_ref
typedef void(* df_remove_problem_function)(void)

Function to remove this problem from the stack of dataflow problems without effecting the other problems in the stack except for those that depend on this problem.

typedef void(* df_reset_function)(bitmap)

This function is called if the problem has global data that needs to be cleared when ever the set of blocks changes. The bitmap contains the set of blocks that may require special attention. This call is only made if some of the blocks are going to change. If everything is to be deleted, the wholesale deletion mechanisms apply.

typedef bool(* df_transfer_function)(int)

Transfer function for blocks. Return true if BB output data has changed.

typedef void(* df_verify_solution_end)(void)

Function to dump top or bottom of basic block results to FILE.

typedef void(* df_verify_solution_start)(void)

Function to dump top or bottom of basic block results to FILE.


Enumeration Type Documentation

Enumerator:
DF_DU_CHAIN 

Flags that control the building of chains.

DF_UD_CHAIN 
Enumerator:
DF_LR_RUN_DCE 

Scanning flags. Flag to control the running of dce as a side effect of building LR.

DF_NO_HARD_REGS 
DF_EQ_NOTES 
DF_NO_REGS_EVER_LIVE 
DF_NO_INSN_RESCAN 

Cause df_insn_rescan df_notes_rescan and df_insn_delete, to return immediately. This is used by passes that know how to update the scanning them selves.

DF_DEFER_INSN_RESCAN 

Cause df_insn_rescan df_notes_rescan and df_insn_delete, to return after marking the insn for later processing. This allows all rescans to be batched.

DF_RD_PRUNE_DEAD_DEFS 

Compute the reaching defs problem as "live and reaching defs" (LR&RD). A DEF is reaching and live at insn I if DEF reaches I and REGNO(DEF) is in LR_IN of the basic block containing I.

DF_VERIFY_SCHEDULED 

Dataflow direction.

Enumerator:
DF_NONE 
DF_FORWARD 
DF_BACKWARD 

Descriminator for the various df_ref types.

Enumerator:
DF_REF_BASE 
DF_REF_ARTIFICIAL 
DF_REF_REGULAR 
Enumerator:
DF_REF_CONDITIONAL 

This flag is set if this ref occurs inside of a conditional execution instruction.

DF_REF_AT_TOP 

If this flag is set for an artificial use or def, that ref logically happens at the top of the block. If it is not set for an artificial use or def, that ref logically happens at the bottom of the block. This is never set for regular refs.

DF_REF_IN_NOTE 

This flag is set if the use is inside a REG_EQUAL or REG_EQUIV note.

DF_HARD_REG_LIVE 

This bit is true if this ref can make regs_ever_live true for this regno.

DF_REF_PARTIAL 

This flag is set if this ref is a partial use or def of the associated register.

DF_REF_READ_WRITE 

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_MAY_CLOBBER 

This flag is set if this ref, generally a def, may clobber the referenced register. This is generally only set for hard registers that cross a call site. With better information about calls, some of these could be changed in the future to DF_REF_MUST_CLOBBER.

DF_REF_MUST_CLOBBER 

This flag is set if this ref, generally a def, is a real clobber. This is not currently set for registers live across a call because that clobbering may or may not happen.

Most of the uses of this are with sets that have a GET_CODE(..)==CLOBBER. Note that this is set even if the clobber is to a subreg. So in order to tell if the clobber wipes out the entire register, it is necessary to also check the DF_REF_PARTIAL flag.

DF_REF_SIGN_EXTRACT 

If the ref has one of the following two flags set, then the struct df_ref can be cast to struct df_ref_extract to access the width and offset fields. This flag is set if the ref contains a SIGN_EXTRACT.

DF_REF_ZERO_EXTRACT 

This flag is set if the ref contains a ZERO_EXTRACT.

DF_REF_STRICT_LOW_PART 

This flag is set if the ref contains a STRICT_LOW_PART.

DF_REF_SUBREG 

This flag is set if the ref contains a SUBREG.

DF_REF_MW_HARDREG 

This bit is true if this ref is part of a multiword hardreg.

DF_REF_CALL_STACK_USAGE 

This flag is set if this ref is a usage of the stack pointer by a function call.

DF_REF_REG_MARKER 

This flag is used for verification of existing refs.

DF_REF_PRE_POST_MODIFY 

This flag is set if this ref is inside a pre/post modify.

The possible ordering of refs within the df_ref_info.

Enumerator:
DF_REF_ORDER_NO_TABLE 

There is not table.

DF_REF_ORDER_UNORDERED 

There is a table of refs but it is not (or no longer) organized by one of the following methods.

DF_REF_ORDER_UNORDERED_WITH_NOTES 
DF_REF_ORDER_BY_REG 

Organize the table by reg order, all of the refs with regno 0 followed by all of the refs with regno 1 ... . Within all of the regs for a particular regno, the refs are unordered.

DF_REF_ORDER_BY_REG_WITH_NOTES 

For uses, the refs within eq notes may be added for DF_REF_ORDER_BY_REG.

DF_REF_ORDER_BY_INSN 

Organize the refs in insn order. The insns are ordered within a block, and the blocks are ordered by FOR_ALL_BB.

DF_REF_ORDER_BY_INSN_WITH_NOTES 

For uses, the refs within eq notes may be added for DF_REF_ORDER_BY_INSN.

The first of these us a set of a registers. The remaining three are all uses of a register (the mem_load and mem_store relate to how the register as an addressing operand).

Enumerator:
DF_REF_REG_DEF 
DF_REF_REG_USE 
DF_REF_REG_MEM_LOAD 
DF_REF_REG_MEM_STORE 

Function Documentation

bool can_move_insns_across ( rtx  from,
rtx  to,
rtx  across_from,
rtx  across_to,
basic_block  merge_bb,
regset  merge_live,
regset  other_branch_live,
rtx pmove_upto 
)

Return true if it is safe to move a group of insns, described by the range FROM to TO, backwards across another group of insns, described by ACROSS_FROM to ACROSS_TO. It is assumed that there are no insns between ACROSS_TO and FROM, but they may be in different basic blocks; MERGE_BB is the block from which the insns will be moved. The caller must pass in a regset MERGE_LIVE which specifies the registers live after TO.

This function may be called in one of two cases: either we try to move identical instructions from all successor blocks into their predecessor, or we try to move from only one successor block. If OTHER_BRANCH_LIVE is nonnull, it indicates that we're dealing with the second case. It should contain a set of registers live at the end of ACROSS_TO which must not be clobbered by moving the insns. In that case, we're also more careful about moving memory references and trapping insns.

We return false if it is not safe to move the entire group, but it may still be possible to move a subgroup. PMOVE_UPTO, if nonnull, is set to point at the last moveable insn in such a case.

 Find real bounds, ignoring debug insns.   
           Pure functions can read from memory.  Const functions can
           read from arguments that the ABI has forced onto the stack.
           Neither sort of read can be volatile.   
         This is used just to find sets of the stack pointer.   
 Collect:
 MERGE_SET = set of registers set in MERGE_BB
 MERGE_USE = set of registers used in MERGE_BB and live at its top
 MERGE_LIVE = set of registers live at the point inside the MERGE
 range that we've reached during scanning
 TEST_SET = set of registers set between ACROSS_FROM and ACROSS_END.
 TEST_USE = set of registers used between ACROSS_FROM and ACROSS_END,
 and live before ACROSS_FROM.   
 Compute the set of registers set and used in the ACROSS range.   
 Compute an upper bound for the amount of insns moved, by finding
 the first insn in MERGE that sets a register in TEST_USE, or uses
 a register in TEST_SET.  We also check for calls, trapping operations,
 and memory references.   
         We cannot move memory stores past each other, or move memory
         reads past stores, at least not without tracking them and
         calling true_dependence on every pair.

         If there is no other branch and no memory references or
         sets in the ACROSS range, we can move memory references
         freely, even volatile ones.

         Otherwise, the rules are as follows: volatile memory
         references and stores can't be moved at all, and any type
         of memory reference can't be moved if there are volatile
         accesses or stores in the ACROSS range.  That leaves
         normal reads, which can be moved, as the trapping case is
         dealt with elsewhere.   
             Catch sets of the stack pointer.   
         We're only interested in uses which use a value live at
         the top, not one previously set in this block.   
 Now, lower this upper bound by also taking into account that
 a range of insns moved across ACROSS must not leave a register
 live at the end that will be clobbered in ACROSS.  We need to
 find a point where TEST_SET & LIVE == 0.

 Insns in the MERGE range that set registers which are also set
 in the ACROSS range may still be moved as long as we also move
 later insns which use the results of the set, and make the
 register dead again.  This is verified by the condition stated
 above.  We only need to test it for registers that are set in
 the moved region.

 MERGE_LIVE is provided by the caller and holds live registers after
 TO.   
 We're not interested in registers that aren't set in the moved
 region at all.   
 For small register class machines, don't lengthen lifetimes of
 hard registers before reload.   
void debug_df_chain ( struct df_link )
void debug_df_defno ( unsigned  int)
void debug_df_insn ( rtx  )
void debug_df_ref ( df_ref  )
void debug_df_reg ( rtx  )
void debug_df_regno ( unsigned  int)
void debug_df_useno ( unsigned  int)
void df_add_problem ( struct df_problem )

This symbol turns on checking that each modification of the cfg has been identified to the appropriate df routines. It is not part of verification per se because the check that the final solution has not changed covers this. However, if the solution is not being properly recomputed because the cfg is being modified, adding in calls to df_check_cfg_clean can be used to find the source of that kind of problem. Functions defined in df-core.c.

void df_analyze ( void  )

Analyze dataflow info for the basic blocks specified by the bitmap BLOCKS, or for the whole CFG if BLOCKS is zero.

 These should be the same.   
 We need to do this before the df_verify_all because this is
 not kept incrementally up to date.   
 Make sure that we have pruned any unreachable blocks from these
 sets.   
 Skip over the DF_SCAN problem.  

Referenced by compute_bb_for_insn(), copyprop_hardreg_forward(), dse_step4(), duplicate_computed_gotos(), mark_artificial_uses(), move_unallocated_pseudos(), and split_live_ranges_for_shrink_wrap().

void df_analyze_problem ( struct dataflow dflow,
bitmap  blocks_to_consider,
int *  postorder,
int  n_blocks 
)

Execute dataflow analysis on a single dataflow problem.

BLOCKS_TO_CONSIDER are the blocks whose solution can either be examined or will be computed. For calls from DF_ANALYZE, this is the set of blocks that has been passed to DF_SET_BLOCKS.

 (Re)Allocate the datastructures necessary to solve the problem.   
 Set up the problem and compute the local information.   
 Solve the equations.   
 Massage the solution.   

Referenced by fast_dce().

void df_bb_delete ( int  )
void df_bb_refs_record ( int  ,
bool   
)
df_ref df_bb_regno_first_def_find ( basic_block  ,
unsigned  int 
)
df_ref df_bb_regno_last_def_find ( basic_block  ,
unsigned  int 
)
void df_bb_replace ( int  ,
basic_block   
)
void df_chain_add_problem ( unsigned  int)
void df_chain_copy ( df_ref  to_ref,
struct df_link from_ref 
)

Copy the du or ud chain starting at FROM_REF and attach it to TO_REF.

struct df_link* df_chain_create ( df_ref  ,
df_ref   
)
read

Functions defined in df-problems.c.

void df_chain_dump ( struct df_link ,
FILE *   
)
void df_chain_unlink ( df_ref  )
int df_clear_flags ( int  )
void df_compact_blocks ( void  )

Called from the rtl_compact_blocks to reorganize the problems basic block info.

     Need to reorganize the out_of_date_transfer_functions for the
     dflow problem.   
     Now shuffle the block info for the problem.   
         Copy the bb info from the problem tmps to the proper
         place in the block_info vector.  Null out the copied
         item.  The entry and exit blocks never move.   
 Shuffle the bits in the basic_block indexed arrays.   

Referenced by unlink_block().

void df_compute_regs_ever_live ( bool  )
void df_dump ( FILE *  )
void df_dump_bottom ( basic_block  ,
FILE *   
)
void df_dump_insn_bottom ( const_rtx  ,
FILE *   
)
void df_dump_insn_top ( const_rtx  ,
FILE *   
)
void df_dump_region ( FILE *  )
void df_dump_start ( FILE *  )
void df_dump_top ( basic_block  ,
FILE *   
)
df_ref df_find_def ( rtx  ,
rtx   
)
df_ref df_find_use ( rtx  ,
rtx   
)
void df_finish_pass ( bool  )
static df_ref* df_get_artificial_defs ( )
inlinestatic

Get basic block info. Get the artificial defs for a basic block.

Referenced by invalidate_memory(), and regstat_get_setjmp_crosses().

static df_ref* df_get_artificial_uses ( )
inlinestatic
bool df_get_bb_dirty ( basic_block  )
static bitmap df_get_live_in ( )
inlinestatic

Get the live at in set for BB no matter what problem happens to be defined. This function is used by the register allocators who choose different dataflow problems depending on the optimization level.

Referenced by delete_allocno_from_bucket().

static bitmap df_get_live_out ( )
inlinestatic

Get the live at out set for BB no matter what problem happens to be defined. This function is used by the register allocators who choose different dataflow problems depending on the optimization level.

Referenced by delete_allocno_from_bucket(), df_simulate_fixup_sets(), find_call_crossed_cheap_reg(), and regstat_get_setjmp_crosses().

int df_get_n_blocks ( enum  df_flow_dir)
int* df_get_postorder ( enum  df_flow_dir)
void df_grow_bb_info ( struct dataflow )
void df_grow_reg_info ( void  )

First, grow the reg_info information. If the current size is less than the number of pseudos, grow to 25% more than the number of pseudos.

Second, assure that all of the slots up to max_reg_num have been filled with reg_info structures.

Referenced by df_ref_change_reg_with_loc_1().

void df_hard_reg_init ( void  )

Initialize some platform specific structures.

Record which registers will be eliminated. We use this in mark_used_regs.

References DF_REF_IS_REG_MARKED, DF_REF_REG_UNMARK, and gcc_assert.

unsigned int df_hard_reg_used_count ( unsigned  int)
bool df_hard_reg_used_p ( unsigned  int)
void df_insn_change_bb ( rtx  ,
basic_block   
)
struct df_insn_info* df_insn_create_insn_record ( rtx  )
read
void df_insn_debug ( rtx  ,
bool  ,
FILE *   
)
void df_insn_debug_regno ( rtx  ,
FILE *   
)
void df_insn_delete ( rtx  )
bool df_insn_rescan ( rtx  )
void df_insn_rescan_all ( void  )

Rescan all of the insns in the function. Note that the artificial uses and defs are not touched. This function will destroy def-use or use-def chains.

bool df_insn_rescan_debug_internal ( rtx  )
void df_live_add_problem ( void  )

Create a new DATAFLOW instance and add it to an existing instance of DF. The returned structure is what is used to get at the solution.

These will be initialized when df_scan_blocks processes each block.

References DF_REF_CHAIN, df_link::next, NULL, and df_link::ref.

static struct df_live_bb_info* df_live_get_bb_info ( )
staticread
void df_live_set_all_dirty ( void  )

Set all of the blocks as dirty. This needs to be done if this problem is added after all of the insns have been scanned.

void df_live_verify_transfer_functions ( void  )

Verify that all of the lr related info is consistent and correct.

         Make a copy of the transfer functions and then compute
         new ones to see if the transfer functions have
         changed.   
         If we do not have basic block info, the block must be in
         the list of dirty blocks or else some one has added a
         block behind our backs.  
     Make sure no one created a block without following
     procedures.   
 Make sure there are no dirty bits in blocks that have been deleted.   
void df_lr_add_problem ( void  )

Create a new DATAFLOW instance and add it to an existing instance of DF. The returned structure is what is used to get at the solution.

These will be initialized when df_scan_blocks processes each block.

void df_lr_verify_transfer_functions ( void  )

Verify that all of the lr related info is consistent and correct.

         Make a copy of the transfer functions and then compute
         new ones to see if the transfer functions have
         changed.   
         If we do not have basic block info, the block must be in
         the list of dirty blocks or else some one has added a
         block behind our backs.  
     Make sure no one created a block without following
     procedures.   
 Make sure there are no dirty bits in blocks that have been deleted.   

References df_live_problem_data::in, df_live_problem_data::live_bitmaps, and df_live_problem_data::out.

void df_mark_solutions_dirty ( void  )
void df_maybe_reorganize_def_refs ( enum  df_ref_order)
void df_maybe_reorganize_use_refs ( enum  df_ref_order)
void df_md_add_problem ( void  )

Create a new MD instance and add it to the existing instance of DF.

static struct df_md_bb_info* df_md_get_bb_info ( )
staticread
void df_md_simulate_artificial_defs_at_top ( basic_block  ,
bitmap   
)
void df_md_simulate_one_insn ( basic_block  bb,
rtx  insn,
bitmap  local_md 
)

Add the effect of the defs of INSN to the reaching definitions bitmap LOCAL_MD.

void df_note_add_problem ( void  )

Create a new DATAFLOW instance and add it to an existing instance of DF. The returned structure is what is used to get at the solution.

References bitmap_set_bit, DF_REF_FLAGS, and DF_REF_REGNO.

Referenced by compute_bb_for_insn(), dse_step4(), and split_live_ranges_for_shrink_wrap().

void df_notes_rescan ( rtx  )
void df_print_bb_index ( basic_block  bb,
FILE *  file 
)
void df_print_regset ( FILE *  file,
bitmap  r 
)
void df_print_word_regset ( FILE *  file,
bitmap  r 
)
void df_process_deferred_rescans ( void  )

Process all of the deferred rescans or deletions.

If someone changed regs_ever_live during this pass, fix up the entry and exit blocks.

void df_rd_add_problem ( void  )

Create a new RD instance and add it to the existing instance of DF.

static struct df_rd_bb_info* df_rd_get_bb_info ( )
staticread

Referenced by df_chain_remove_problem().

void df_rd_simulate_artificial_defs_at_top ( basic_block  ,
bitmap   
)
void df_rd_simulate_one_insn ( basic_block  bb,
rtx  insn,
bitmap  local_rd 
)

Add the effect of the defs of INSN to the reaching definitions bitmap LOCAL_RD.

Referenced by df_chain_remove_problem().

bool df_read_modify_subreg_p ( rtx  )
void df_recompute_luids ( basic_block  )
void df_ref_change_reg_with_loc ( int  ,
int  ,
rtx   
)
df_ref df_ref_create ( rtx  reg,
rtx loc,
rtx  insn,
basic_block  bb,
enum df_ref_type  ref_type,
int  ref_flags 
)

Create a new ref of type DF_REF_TYPE for register REG at address LOC within INSN of BB. This function is only used externally.

You cannot hack artificial refs.

void df_ref_debug ( df_ref  ,
FILE *   
)
void df_ref_remove ( df_ref  )
void df_refs_chain_dump ( df_ref ,
bool  ,
FILE *   
)
bool df_reg_defined ( rtx  ,
rtx   
)
bool df_reg_used ( rtx  ,
rtx   
)
void df_regno_debug ( unsigned  int,
FILE *   
)
void df_regs_chain_dump ( df_ref  ,
FILE *   
)
bool df_regs_ever_live_p ( unsigned  int)
void df_remove_problem ( struct dataflow )
void df_scan_add_problem ( void  )

Create a new DATAFLOW instance and add it to an existing instance of DF. The returned structure is what is used to get at the solution.

References df_ref_info::begin, df_ref_info::count, df_d::def_info, df_d::def_regs, df, df_scan, df_d::eq_use_regs, max_reg_num(), df_d::regs_size, df_d::use_info, and df_d::use_regs.

void df_scan_alloc ( bitmap  )

Functions defined in df-scan.c.

void df_scan_blocks ( void  )

Rescan all of the block_to_analyze or all of the blocks in the function if df_set_blocks if blocks_to_analyze is NULL;

ENTRY and EXIT blocks have special defs/uses.

 Regular blocks  

Referenced by duplicate_computed_gotos().

void df_scan_verify ( void  )

Return true if df_ref information for all insns in all blocks are correct and complete.

 Verification is a 4 step process.  
 (1) All of the refs are marked by going through the reg chains.   
 (2) There are various bitmaps whose value may change over the
 course of the compilation.  This step recomputes them to make
 sure that they have not slipped out of date.   
 Check artificial_uses bitmaps didn't change.  
 Verify entry block and exit block. These only verify the bitmaps,
 the refs are verified in df_bb_verify.   
 (3) All of the insns in all of the blocks are traversed and the
 marks are cleared both in the artificial refs attached to the
 blocks and the real refs inside the insns.  It is a failure to
 clear a mark that has not been set as this means that the ref in
 the block or insn was not in the reg chain.   
 (4) See if all reg chains are traversed a second time.  This time
 a check is made that the marks are clear. A set mark would be a
 from a reg that is not in any insn or basic block.   
void df_set_bb_dirty ( basic_block  )
void df_set_blocks ( bitmap  )
int df_set_flags ( int  )
void df_set_regs_ever_live ( unsigned  int,
bool   
)
void df_simple_dataflow ( enum df_flow_dir  dir,
df_init_function  init_fun,
df_confluence_function_0  con_fun_0,
df_confluence_function_n  con_fun_n,
df_transfer_function  trans_fun,
bitmap  blocks,
int *  postorder,
int  n_blocks 
)

Interface for calling iterative dataflow with user defined confluence and transfer functions. All that is necessary is to supply DIR, a direction, CONF_FUN_0, a confluence function for blocks with no logical preds (or NULL), CONF_FUN_N, the normal confluence function, TRANS_FUN, the basic block transfer function, and BLOCKS, the set of blocks to examine, POSTORDER the blocks in postorder, and N_BLOCKS, the number of blocks in POSTORDER.

References df_d::num_problems_defined, df_d::problems_in_order, and dataflow::solutions_dirty.

void df_simulate_defs ( rtx  ,
bitmap   
)
void df_simulate_finalize_backwards ( basic_block  ,
bitmap   
)
void df_simulate_find_defs ( rtx  ,
bitmap   
)
void df_simulate_find_noclobber_defs ( rtx  ,
bitmap   
)
void df_simulate_initialize_backwards ( basic_block  ,
bitmap   
)
void df_simulate_initialize_forwards ( basic_block  ,
bitmap   
)
void df_simulate_one_insn_backwards ( basic_block  ,
rtx  ,
bitmap   
)
void df_simulate_one_insn_forwards ( basic_block  ,
rtx  ,
bitmap   
)
void df_simulate_uses ( rtx  ,
bitmap   
)
void df_update_entry_block_defs ( void  )

Update the defs in the entry block.

Referenced by df_get_exit_block_use_set().

void df_update_entry_exit_and_calls ( void  )

Recompute the parts of scanning that are based on regs_ever_live because something changed in that array.

The call insns need to be rescanned because there may be changes in the set of registers clobbered across the call.

References gcc_assert.

void df_update_exit_block_uses ( void  )

Update the uses in the exit block.

Referenced by df_get_exit_block_use_set().

void df_uses_create ( rtx ,
rtx  ,
int   
)
void df_verify ( void  )

Verify that there is a place for everything and everything is in its place. This is too expensive to run after every pass in the mainline. However this is an excellent debugging tool if the dataflow information is not being updated properly. You can just sprinkle calls in until you find the place that is changing an underlying structure without calling the proper updating routine.

void df_word_lr_add_problem ( void  )

Create a new DATAFLOW instance and add it to an existing instance of DF. The returned structure is what is used to get at the solution.

These will be initialized when df_scan_blocks processes each block.

References bitmap_bit_p, DF_REF_FLAGS, DF_REF_IN_NOTE, DF_REF_LOC, DF_REF_REGNO, loc_mentioned_in_p(), and XEXP.

static struct df_word_lr_bb_info* df_word_lr_get_bb_info ( )
staticread
bool df_word_lr_mark_ref ( df_ref  ,
bool  ,
bitmap   
)
void df_word_lr_simulate_artificial_refs_at_end ( basic_block  ,
bitmap   
)
void df_word_lr_simulate_artificial_refs_at_top ( basic_block  ,
bitmap   
)
bool df_word_lr_simulate_defs ( rtx  ,
bitmap   
)
void df_word_lr_simulate_uses ( rtx  ,
bitmap   
)
void df_worklist_dataflow ( struct dataflow dataflow,
bitmap  blocks_to_consider,
int *  blocks_in_postorder,
int  n_blocks 
)

Worklist-based dataflow solver. It uses sbitmap as a worklist, with "n"-th bit representing the n-th block in the reverse-postorder order. The solver is a double-queue algorithm similar to the "double stack" solver from Cooper, Harvey and Kennedy, "Iterative data-flow analysis, Revisited". The only significant difference is that the worklist in this implementation is always sorted in RPO of the CFG visiting direction.

 BBINDEX_TO_POSTORDER maps the bb->index to the reverse postorder.   
 Initialize the array to an out-of-bound value.   
 Initialize the considered map.   
 Initialize the mapping of block index to postorder.   
     Add all blocks to the worklist.   
 Initialize the problem.  
 Solve it.   

Referenced by df_lr_confluence_0().

void simulate_backwards_to_point ( basic_block  ,
regset  ,
rtx   
)
void union_defs ( df_ref  use,
struct web_entry def_entry,
unsigned int *  used,
struct web_entry use_entry,
bool(*)(struct web_entry *, struct web_entry *)  fun 
)

For each use, all possible defs reaching it must come in the same register, union them. FUN is the function that does the union.

In USED, we keep the DF_REF_ID of the first uninitialized uses of a register, so that all uninitialized uses of the register can be combined into a single web. We actually offset it by 2, because the values 0 and 1 are reserved for use by entry_register.

An artificial use.  It links up with nothing.   
 Union all occurrences of the same register in reg notes.   


 Recognize trivial noop moves and attempt to keep them as noop.   
 UD chains of uninitialized REGs are empty.  Keeping all uses of
 the same uninitialized REG in a single web is not necessary for
 correctness, since the uses are undefined, but it's wasteful to
 allocate one register or slot for each reference.  Furthermore,
 creating new pseudos for uninitialized references in debug insns
 (see PR 42631) causes -fcompare-debug failures.  We record the
 number of the first uninitialized reference we found, and merge
 with it any other uninitialized references to the same
 register.   
 A READ_WRITE use requires the corresponding def to be in the same
 register.  Find it and union.   

References DF_INSN_INFO_DEFS, DF_INSN_INFO_EQ_USES, df_insn_info::insn, and single_set.

struct web_entry* unionfind_root ( struct web_entry )
read
bool unionfind_union ( struct web_entry ,
struct web_entry  
)

Variable Documentation

bitmap_obstack df_bitmap_obstack

An obstack for bitmap not related to specific dataflow problems. This obstack should e.g. be used for bitmaps with a short life time such as temporary bitmaps. This obstack is declared in df-core.c.

An obstack for bitmap not related to specific dataflow problems. This obstack should e.g. be used for bitmaps with a short life time such as temporary bitmaps.

Referenced by df_get_eh_block_artificial_uses(), df_insn_rescan_debug_internal(), and df_lr_verify_solution_end().