GCC Middle and Back End API Reference
df-scan.cc File Reference
#include "config.h"
#include "system.h"
#include "coretypes.h"
#include "backend.h"
#include "target.h"
#include "rtl.h"
#include "tree.h"
#include "df.h"
#include "memmodel.h"
#include "tm_p.h"
#include "regs.h"
#include "emit-rtl.h"
#include "dumpfile.h"
#include "calls.h"
#include "function-abi.h"
Include dependency graph for df-scan.cc:

Data Structures

class  df_collection_rec
 
struct  df_scan_problem_data
 

Functions

static void df_ref_record (enum df_ref_class, class df_collection_rec *, rtx, rtx *, basic_block, struct df_insn_info *, enum df_ref_type, int ref_flags)
 
static void df_def_record_1 (class df_collection_rec *, rtx *, basic_block, struct df_insn_info *, int ref_flags)
 
static void df_defs_record (class df_collection_rec *, rtx, basic_block, struct df_insn_info *, int ref_flags)
 
static void df_uses_record (class df_collection_rec *, rtx *, enum df_ref_type, basic_block, struct df_insn_info *, int ref_flags)
 
static void df_install_ref_incremental (df_ref)
 
static void df_insn_refs_collect (class df_collection_rec *, basic_block, struct df_insn_info *)
 
static void df_canonize_collection_rec (class df_collection_rec *)
 
static void df_get_regular_block_artificial_uses (bitmap)
 
static void df_get_eh_block_artificial_uses (bitmap)
 
static void df_record_entry_block_defs (bitmap)
 
static void df_record_exit_block_uses (bitmap)
 
static void df_get_exit_block_use_set (bitmap)
 
static void df_get_entry_block_def_set (bitmap)
 
static void df_grow_ref_info (struct df_ref_info *, unsigned int)
 
static void df_ref_chain_delete_du_chain (df_ref)
 
static void df_ref_chain_delete (df_ref)
 
static void df_refs_add_to_chains (class df_collection_rec *, basic_block, rtx_insn *, unsigned int)
 
static bool df_insn_refs_verify (class df_collection_rec *, basic_block, rtx_insn *, bool)
 
static void df_entry_block_defs_collect (class df_collection_rec *, bitmap)
 
static void df_exit_block_uses_collect (class df_collection_rec *, bitmap)
 
static void df_install_ref (df_ref, struct df_reg_info *, struct df_ref_info *, bool)
 
static int df_ref_compare (df_ref, df_ref)
 
static int df_ref_ptr_compare (const void *, const void *)
 
static int df_mw_compare (const df_mw_hardreg *, const df_mw_hardreg *)
 
static int df_mw_ptr_compare (const void *, const void *)
 
static void df_insn_info_delete (unsigned int)
 
static void df_scan_free_internal (void)
 
static void df_scan_free_bb_info (basic_block bb, void *vbb_info)
 
void df_scan_alloc (bitmap all_blocks)
 
static void df_scan_free (void)
 
static void df_scan_start_dump (FILE *file)
 
static void df_scan_start_block (basic_block bb, FILE *file)
 
void df_scan_add_problem (void)
 
void df_grow_reg_info (void)
 
static void df_check_and_grow_ref_info (struct df_ref_info *ref_info, unsigned bitmap_addend)
 
void df_grow_insn_info (void)
 
void df_scan_blocks (void)
 
void df_uses_create (rtx *loc, rtx_insn *insn, int ref_flags)
 
static void df_free_ref (df_ref ref)
 
static void df_reg_chain_unlink (df_ref ref)
 
static void df_insn_info_init_fields (df_insn_info *insn_info, rtx_insn *insn)
 
struct df_insn_infodf_insn_create_insn_record (rtx_insn *insn)
 
static void df_mw_hardreg_chain_delete (struct df_mw_hardreg *hardregs)
 
static void df_insn_info_free_fields (df_insn_info *insn_info)
 
void df_insn_delete (rtx_insn *insn)
 
static void df_free_collection_rec (class df_collection_rec *collection_rec)
 
bool df_insn_rescan (rtx_insn *insn)
 
bool df_insn_rescan_debug_internal (rtx_insn *insn)
 
void df_insn_rescan_all (void)
 
void df_process_deferred_rescans (void)
 
static unsigned int df_count_refs (bool include_defs, bool include_uses, bool include_eq_uses)
 
static void df_reorganize_refs_by_reg_by_reg (struct df_ref_info *ref_info, bool include_defs, bool include_uses, bool include_eq_uses)
 
static void df_reorganize_refs_by_reg_by_insn (struct df_ref_info *ref_info, bool include_defs, bool include_uses, bool include_eq_uses)
 
static void df_reorganize_refs_by_reg (struct df_ref_info *ref_info, bool include_defs, bool include_uses, bool include_eq_uses)
 
static unsigned int df_add_refs_to_table (unsigned int offset, struct df_ref_info *ref_info, df_ref ref)
 
static unsigned int df_reorganize_refs_by_insn_bb (basic_block bb, unsigned int offset, struct df_ref_info *ref_info, bool include_defs, bool include_uses, bool include_eq_uses)
 
static void df_reorganize_refs_by_insn (struct df_ref_info *ref_info, bool include_defs, bool include_uses, bool include_eq_uses)
 
void df_maybe_reorganize_use_refs (enum df_ref_order order)
 
void df_maybe_reorganize_def_refs (enum df_ref_order order)
 
void df_insn_change_bb (rtx_insn *insn, basic_block new_bb)
 
static void df_ref_change_reg_with_loc_1 (struct df_reg_info *old_df, struct df_reg_info *new_df, unsigned int new_regno, rtx loc)
 
void df_ref_change_reg_with_loc (rtx loc, unsigned int new_regno)
 
static void df_mw_hardreg_chain_delete_eq_uses (struct df_insn_info *insn_info)
 
void df_notes_rescan (rtx_insn *insn)
 
static bool df_ref_equal_p (df_ref ref1, df_ref ref2)
 
static void df_sort_and_compress_refs (vec< df_ref, va_heap > *ref_vec)
 
static bool df_mw_equal_p (struct df_mw_hardreg *mw1, struct df_mw_hardreg *mw2)
 
static void df_sort_and_compress_mws (vec< df_mw_hardreg *, va_heap > *mw_vec)
 
static df_ref df_install_refs (basic_block bb, const vec< df_ref, va_heap > *old_vec, struct df_reg_info **reg_info, struct df_ref_info *ref_info, bool is_notes)
 
static struct df_mw_hardregdf_install_mws (const vec< df_mw_hardreg *, va_heap > *old_vec)
 
static df_ref df_ref_create_structure (enum df_ref_class cl, class df_collection_rec *collection_rec, rtx reg, rtx *loc, basic_block bb, struct df_insn_info *info, enum df_ref_type ref_type, int ref_flags)
 
static void df_find_hard_reg_defs_1 (rtx dst, HARD_REG_SET *defs)
 
static void df_find_hard_reg_defs (rtx x, HARD_REG_SET *defs)
 
static void df_get_conditional_uses (class df_collection_rec *collection_rec)
 
static void df_get_call_refs (class df_collection_rec *collection_rec, basic_block bb, struct df_insn_info *insn_info, int flags)
 
void df_recompute_luids (basic_block bb)
 
static void df_bb_refs_collect (class df_collection_rec *collection_rec, basic_block bb)
 
void df_bb_refs_record (int bb_index, bool scan_insns)
 
static void df_mark_reg (rtx reg, void *vset)
 
void df_update_entry_block_defs (void)
 
bool df_epilogue_uses_p (unsigned int regno)
 
void df_update_exit_block_uses (void)
 
void df_hard_reg_init (void)
 
void df_update_entry_exit_and_calls (void)
 
bool df_hard_reg_used_p (unsigned int reg)
 
unsigned int df_hard_reg_used_count (unsigned int reg)
 
bool df_regs_ever_live_p (unsigned int regno)
 
void df_set_regs_ever_live (unsigned int regno, bool value)
 
void df_compute_regs_ever_live (bool reset)
 
static unsigned int df_reg_chain_mark (df_ref refs, unsigned int regno, bool is_def, bool is_eq_use)
 
static void df_reg_chain_verify_unmarked (df_ref refs)
 
static bool df_refs_verify (const vec< df_ref, va_heap > *new_rec, df_ref old_rec, bool abort_if_fail)
 
static bool df_mws_verify (const vec< df_mw_hardreg *, va_heap > *new_rec, struct df_mw_hardreg *old_rec, bool abort_if_fail)
 
static bool df_bb_verify (basic_block bb)
 
static bool df_entry_block_bitmap_verify (bool abort_if_fail)
 
static bool df_exit_block_bitmap_verify (bool abort_if_fail)
 
void df_scan_verify (void)
 

Variables

static HARD_REG_SET elim_reg_set
 
static bool regs_ever_live [FIRST_PSEUDO_REGISTER]
 
static const unsigned int copy_defs = 0x1
 
static const unsigned int copy_uses = 0x2
 
static const unsigned int copy_eq_uses = 0x4
 
static const unsigned int copy_mw = 0x8
 
static const unsigned int copy_all
 
static const struct df_problem problem_SCAN
 
static bool initialized = false
 

Function Documentation

◆ df_add_refs_to_table()

static unsigned int df_add_refs_to_table ( unsigned int offset,
struct df_ref_info * ref_info,
df_ref ref )
static
Add the refs in REF_VEC to the table in REF_INFO starting at OFFSET.   

References df_d::changeable_flags, df, DF_NO_HARD_REGS, DF_REF_ID, DF_REF_NEXT_LOC, DF_REF_REGNO, ggc_alloc(), and offset.

Referenced by df_reorganize_refs_by_insn_bb().

◆ df_bb_refs_collect()

◆ df_bb_refs_record()

◆ df_bb_verify()

static bool df_bb_verify ( basic_block bb)
static
Return true if all refs in the basic block are correct and complete.
Due to df_ref_chain_verify, it will cause all refs
that are verified to have DF_REF_MARK bit set.   

References df_bb_refs_collect(), df_free_collection_rec(), df_get_artificial_defs(), df_get_artificial_uses(), df_insn_refs_verify(), df_refs_verify(), df_scan_get_bb_info(), FOR_BB_INSNS_REVERSE, gcc_assert, ggc_alloc(), basic_block_def::index, df_insn_info::insn, and INSN_P.

Referenced by df_scan_verify().

◆ df_canonize_collection_rec()

static void df_canonize_collection_rec ( class df_collection_rec * collection_rec)
static

◆ df_check_and_grow_ref_info()

static void df_check_and_grow_ref_info ( struct df_ref_info * ref_info,
unsigned bitmap_addend )
static
Check and grow the ref information if necessary.  This routine
guarantees total_size + BITMAP_ADDEND amount of entries in refs
array.  It updates ref_info->refs_size only and does not change
ref_info->total_size.   

References df_grow_ref_info(), and ggc_alloc().

Referenced by df_install_ref(), df_reorganize_refs_by_insn(), df_reorganize_refs_by_reg_by_insn(), and df_reorganize_refs_by_reg_by_reg().

◆ df_compute_regs_ever_live()

void df_compute_regs_ever_live ( bool reset)
Compute "regs_ever_live" information from the underlying df
information.  Set the vector to all false if RESET.   

References changed, df, df_hard_reg_used_p(), df_update_entry_exit_and_calls(), ggc_alloc(), i, df_d::redo_entry_and_exit, and regs_ever_live.

Referenced by df_analyze_1(), reginfo_init(), and rest_of_handle_df_initialize().

◆ df_count_refs()

static unsigned int df_count_refs ( bool include_defs,
bool include_uses,
bool include_eq_uses )
static
Count the number of refs. Include the defs if INCLUDE_DEFS. Include
the uses if INCLUDE_USES. Include the eq_uses if
INCLUDE_EQ_USES.   

References df, DF_REG_DEF_COUNT, DF_REG_EQ_USE_COUNT, DF_REG_USE_COUNT, ggc_alloc(), and df_d::regs_inited.

Referenced by df_reorganize_refs_by_insn(), df_reorganize_refs_by_reg_by_insn(), and df_reorganize_refs_by_reg_by_reg().

◆ df_def_record_1()

static void df_def_record_1 ( class df_collection_rec * collection_rec,
rtx * loc,
basic_block bb,
struct df_insn_info * insn_info,
int flags )
static
Process all the registers defined in the rtx pointed by LOC.
Autoincrement/decrement definitions will be picked up by df_uses_record.
Any change here has to be matched in df_find_hard_reg_defs_1.   

References df_def_record_1(), DF_REF_BASE, DF_REF_PARTIAL, DF_REF_READ_WRITE, df_ref_record(), DF_REF_REG_DEF, DF_REF_REG_USE, DF_REF_REGULAR, DF_REF_STRICT_LOW_PART, DF_REF_SUBREG, DF_REF_ZERO_EXTRACT, gcc_assert, GET_CODE, ggc_alloc(), i, NULL, read_modify_subreg_p(), REG_P, REGNO, SUBREG_REG, XEXP, XVECEXP, and XVECLEN.

Referenced by df_def_record_1(), and df_defs_record().

◆ df_defs_record()

static void df_defs_record ( class df_collection_rec * collection_rec,
rtx x,
basic_block bb,
struct df_insn_info * insn_info,
int flags )
static
Process all the registers defined in the pattern rtx, X.  Any change
here has to be matched in df_find_hard_reg_defs.   

References COND_EXEC_CODE, df_def_record_1(), df_defs_record(), DF_REF_CONDITIONAL, DF_REF_MUST_CLOBBER, GET_CODE, ggc_alloc(), i, RTX_CODE, SET, SET_DEST, XEXP, XVECEXP, and XVECLEN.

Referenced by df_defs_record(), df_get_call_refs(), and df_insn_refs_collect().

◆ df_entry_block_bitmap_verify()

static bool df_entry_block_bitmap_verify ( bool abort_if_fail)
static
Returns true if the entry block has correct and complete df_ref set.
If not it either aborts if ABORT_IF_FAIL is true or returns false.   

References bitmap_equal_p(), df, df_bitmap_obstack, df_get_entry_block_def_set(), df_print_regset(), df_d::entry_block_defs, gcc_assert, and ggc_alloc().

Referenced by df_scan_verify().

◆ df_entry_block_defs_collect()

static void df_entry_block_defs_collect ( class df_collection_rec * collection_rec,
bitmap entry_block_defs )
static
Return the (conservative) set of hard registers that are defined on
entry to the function.
It uses df->entry_block_defs to determine which register
reference to include.   

References cfun, df_canonize_collection_rec(), DF_REF_ARTIFICIAL, df_ref_record(), DF_REF_REG_DEF, ENTRY_BLOCK_PTR_FOR_FN, EXECUTE_IF_SET_IN_BITMAP, ggc_alloc(), i, NULL, and regno_reg_rtx.

Referenced by df_bb_refs_collect(), and df_record_entry_block_defs().

◆ df_epilogue_uses_p()

bool df_epilogue_uses_p ( unsigned int regno)
Return true if REGNO is used by the epilogue.   

References crtl, EPILOGUE_USES, and TEST_HARD_REG_BIT.

Referenced by df_get_exit_block_use_set(), and init_resource_info().

◆ df_exit_block_bitmap_verify()

static bool df_exit_block_bitmap_verify ( bool abort_if_fail)
static
Returns true if the exit block has correct and complete df_ref set.
If not it either aborts if ABORT_IF_FAIL is true or returns false.  

References bitmap_equal_p(), df, df_bitmap_obstack, df_get_exit_block_use_set(), df_print_regset(), df_d::exit_block_uses, gcc_assert, and ggc_alloc().

Referenced by df_scan_verify().

◆ df_exit_block_uses_collect()

static void df_exit_block_uses_collect ( class df_collection_rec * collection_rec,
bitmap exit_block_uses )
static
Return the refs of hard registers that are used in the exit block.
It uses df->exit_block_uses to determine register to include.   

References bb_has_eh_pred(), bitmap_bit_p, cfun, df_canonize_collection_rec(), DF_REF_ARTIFICIAL, df_ref_record(), DF_REF_REG_USE, EXECUTE_IF_SET_IN_BITMAP, EXIT_BLOCK_PTR_FOR_FN, fixed_regs, ggc_alloc(), i, NULL, regno_reg_rtx, and reload_completed.

Referenced by df_bb_refs_collect(), and df_record_exit_block_uses().

◆ df_find_hard_reg_defs()

static void df_find_hard_reg_defs ( rtx x,
HARD_REG_SET * defs )
static
Set bits in *DEFS for hard registers defined in the pattern X.  This
has to match the logic in df_defs_record.   

References COND_EXEC_CODE, defs, df_find_hard_reg_defs(), df_find_hard_reg_defs_1(), GET_CODE, ggc_alloc(), i, RTX_CODE, SET, SET_DEST, XEXP, XVECEXP, and XVECLEN.

Referenced by df_find_hard_reg_defs(), and df_get_call_refs().

◆ df_find_hard_reg_defs_1()

static void df_find_hard_reg_defs_1 ( rtx dst,
HARD_REG_SET * defs )
static
Set bits in *DEFS for hard registers found in the rtx DST, which is the
destination of a set or clobber.  This has to match the logic in
df_defs_record_1.   

References defs, df_find_hard_reg_defs_1(), gcc_assert, GET_CODE, ggc_alloc(), HARD_REGISTER_P, i, REG_P, REGNO, SET_HARD_REG_BIT, SUBREG_REG, XEXP, XVECEXP, and XVECLEN.

Referenced by df_find_hard_reg_defs(), and df_find_hard_reg_defs_1().

◆ df_free_collection_rec()

static void df_free_collection_rec ( class df_collection_rec * collection_rec)
static
Free all of the refs and the mw_hardregs in COLLECTION_REC.   

References df_free_ref(), df_scan, FOR_EACH_VEC_ELT, ggc_alloc(), df_scan_problem_data::mw_reg_pool, and object_allocator< T >::remove().

Referenced by df_bb_verify(), and df_insn_rescan().

◆ df_free_ref()

◆ df_get_call_refs()

◆ df_get_conditional_uses()

static void df_get_conditional_uses ( class df_collection_rec * collection_rec)
static

◆ df_get_eh_block_artificial_uses()

static void df_get_eh_block_artificial_uses ( bitmap eh_block_artificial_uses)
static

◆ df_get_entry_block_def_set()

◆ df_get_exit_block_use_set()

◆ df_get_regular_block_artificial_uses()

static void df_get_regular_block_artificial_uses ( bitmap regular_block_artificial_uses)
static

◆ df_grow_insn_info()

void df_grow_insn_info ( void )
Grow the ref information.  If the current size is less than the
number of instructions, grow to 25% more than the number of
instructions.   

References df, DF_INSN_SIZE, get_max_uid(), ggc_alloc(), df_d::insns, and df_d::insns_size.

Referenced by df_insn_create_insn_record(), df_live_local_compute(), df_live_verify_transfer_functions(), df_mir_local_compute(), df_recompute_luids(), and df_scan_alloc().

◆ df_grow_ref_info()

static void df_grow_ref_info ( struct df_ref_info * ref_info,
unsigned int new_size )
static
Grow the ref information.   

References ggc_alloc().

Referenced by df_check_and_grow_ref_info().

◆ df_grow_reg_info()

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.   

References object_allocator< T >::allocate(), df_ref_info::begin, df_ref_info::count, df_d::def_info, df_d::def_regs, df, df_scan, df_d::eq_use_regs, ggc_alloc(), i, max_reg_num(), df_scan_problem_data::reg_pool, df_d::regs_inited, df_d::regs_size, df_d::use_info, and df_d::use_regs.

Referenced by df_insn_delete(), df_insn_rescan(), df_notes_rescan(), df_ref_change_reg_with_loc(), df_scan_alloc(), and regstat_init_n_sets_and_refs().

◆ df_hard_reg_init()

void df_hard_reg_init ( void )
Initialize some platform specific structures.   

References CLEAR_HARD_REG_SET, elim_reg_set, ggc_alloc(), i, initialized, and SET_HARD_REG_BIT.

Referenced by rest_of_handle_df_initialize().

◆ df_hard_reg_used_count()

unsigned int df_hard_reg_used_count ( unsigned int reg)
A count of the number of times REG is actually used in the some
instruction.  There are a fair number of conditions that affect the
setting of this array.  See the comment in df.h for
df->hard_regs_live_count for the conditions that this array is
set.  

References df, and df_d::hard_regs_live_count.

◆ df_hard_reg_used_p()

bool df_hard_reg_used_p ( unsigned int reg)
Return true if hard REG is actually used in the some instruction.
There are a fair number of conditions that affect the setting of
this array.  See the comment in df.h for df->hard_regs_live_count
for the conditions that this array is set.  

References df, and df_d::hard_regs_live_count.

Referenced by df_compute_regs_ever_live().

◆ df_insn_change_bb()

void df_insn_change_bb ( rtx_insn * insn,
basic_block new_bb )
Change all of the basic block references in INSN to use the insn's
current basic block.  This function is called from routines that move
instructions from one block to another.   

References BLOCK_FOR_INSN(), DEBUG_INSN_P, df, df_insn_rescan(), DF_INSN_UID_SAFE_GET, df_set_bb_dirty(), dump_file, ggc_alloc(), basic_block_def::index, df_insn_info::insn, INSN_P, INSN_UID(), NULL, and set_block_for_insn().

Referenced by reorder_insns(), and update_bb_for_insn_chain().

◆ df_insn_create_insn_record()

◆ df_insn_delete()

◆ df_insn_info_delete()

static void df_insn_info_delete ( unsigned int uid)
static
Delete all of the refs information from the insn with UID.
Internal helper for df_insn_delete, df_insn_rescan, and other
df-scan routines that don't have to work in deferred mode
and do not have to mark basic blocks for re-processing.   

References bitmap_clear_bit(), df, df_insn_info_free_fields(), DF_INSN_UID_SAFE_GET, DF_INSN_UID_SET, df_scan, df_scan_problem_data::insn_pool, df_d::insns_to_delete, df_d::insns_to_notes_rescan, df_d::insns_to_rescan, NULL, and object_allocator< T >::remove().

Referenced by df_insn_delete(), df_insn_rescan_all(), df_process_deferred_rescans(), and df_scan_free_bb_info().

◆ df_insn_info_free_fields()

static void df_insn_info_free_fields ( df_insn_info * insn_info)
static

◆ df_insn_info_init_fields()

static void df_insn_info_init_fields ( df_insn_info * insn_info,
rtx_insn * insn )
static
Initialize INSN_INFO to describe INSN.   

References ggc_alloc(), and df_insn_info::insn.

Referenced by df_insn_create_insn_record(), and df_insn_rescan().

◆ df_insn_refs_collect()

static void df_insn_refs_collect ( class df_collection_rec * collection_rec,
basic_block bb,
struct df_insn_info * insn_info )
static
Collect all refs in the INSN. This function is free of any
side-effect - it will create and return a lists of df_ref's in the
COLLECTION_REC without putting those refs into existing ref chains
and reg chains.  

References CALL_P, df_canonize_collection_rec(), df_defs_record(), df_get_call_refs(), df_get_conditional_uses(), DF_REF_BASE, DF_REF_CONDITIONAL, DF_REF_IN_NOTE, df_ref_record(), DF_REF_REG_USE, df_uses_record(), GET_CODE, ggc_alloc(), HARD_FRAME_POINTER_IS_FRAME_POINTER, HARD_FRAME_POINTER_REGNUM, df_insn_info::insn, NULL, PATTERN(), REG_NOTE_KIND, REG_NOTES, regno_reg_rtx, and XEXP.

Referenced by df_bb_refs_record(), df_insn_refs_verify(), and df_insn_rescan().

◆ df_insn_refs_verify()

static bool df_insn_refs_verify ( class df_collection_rec * collection_rec,
basic_block bb,
rtx_insn * insn,
bool abort_if_fail )
static
Return true if the existing insn refs information is complete and
correct. Otherwise (i.e. if there's any missing or extra refs),
return the correct df_ref chain in REFS_RETURN.

If ABORT_IF_FAIL, leave the refs that are verified (already in the
ref chain) as DF_REF_MARKED(). If it's false, then it's a per-insn
verification mode instead of the whole function, so unmark
everything.

If ABORT_IF_FAIL is set, this function never returns false.   

References DF_INSN_INFO_GET, df_insn_refs_collect(), DF_INSN_UID_DEFS, DF_INSN_UID_EQ_USES, DF_INSN_UID_MWS, DF_INSN_UID_USES, df_mws_verify(), df_refs_verify(), ggc_alloc(), df_insn_info::insn, and INSN_UID().

Referenced by df_bb_verify(), and df_insn_rescan().

◆ df_insn_rescan()

bool df_insn_rescan ( rtx_insn * insn)
Rescan INSN.  Return TRUE if the rescanning produced any changes.   

References bitmap_clear_bit(), bitmap_set_bit, BLOCK_FOR_INSN(), df_d::changeable_flags, copy_all, DEBUG_INSN_P, df_insn_info::defs, df, DF_DEFER_INSN_RESCAN, df_free_collection_rec(), df_grow_bb_info(), df_grow_reg_info(), df_insn_create_insn_record(), df_insn_info_free_fields(), df_insn_info_init_fields(), DF_INSN_LUID, df_insn_refs_collect(), df_insn_refs_verify(), DF_INSN_UID_SAFE_GET, DF_NO_INSN_RESCAN, df_refs_add_to_chains(), df_scan, df_set_bb_dirty(), dump_file, df_insn_info::eq_uses, ggc_alloc(), df_insn_info::insn, INSN_P, INSN_UID(), df_d::insns_to_delete, df_d::insns_to_notes_rescan, df_d::insns_to_rescan, df_insn_info::mw_hardregs, NULL, and df_insn_info::uses.

Referenced by add_insn_after(), add_insn_before(), adjust_for_new_dest(), can_move_invariant_reg(), change_loop(), cleanup_subreg_operands(), combine_and_move_insns(), confirm_change_group(), copyprop_hardreg_forward_1(), dead_debug_global_replace_temp(), dead_debug_local_finish(), delete_trivially_dead_insns(), delete_unmarked_insns(), df_insn_change_bb(), df_insn_rescan_all(), df_notes_rescan(), df_process_deferred_rescans(), df_update_entry_exit_and_calls(), emit_insn_after_1(), make_more_copies(), match_asm_constraints_1(), peep2_update_life(), propagate_for_debug(), propagate_for_debug_subst(), remove_insn_scratches(), remove_scratches(), replace_ref(), resolve_clobber(), resolve_debug(), restore_operands(), try_combine(), and update_ld_motion_stores().

◆ df_insn_rescan_all()

◆ df_insn_rescan_debug_internal()

◆ df_install_mws()

static struct df_mw_hardreg * df_install_mws ( const vec< df_mw_hardreg *, va_heap > * old_vec)
static
This function takes the mws installs the entire group into the
insn.   

References count, DF_MWS_NEXT, ggc_alloc(), and i.

Referenced by df_refs_add_to_chains().

◆ df_install_ref()

static void df_install_ref ( df_ref this_ref,
struct df_reg_info * reg_info,
struct df_ref_info * ref_info,
bool add_to_table )
static

◆ df_install_ref_incremental()

◆ df_install_refs()

static df_ref df_install_refs ( basic_block bb,
const vec< df_ref, va_heap > * old_vec,
struct df_reg_info ** reg_info,
struct df_ref_info * ref_info,
bool is_notes )
static
This function takes one of the groups of refs (defs, uses or
eq_uses) and installs the entire group into the insn.  It also adds
each of these refs into the appropriate chains.   

References df_d::analyze_subset, bitmap_bit_p, df_d::blocks_to_analyze, count, df, df_install_ref(), DF_REF_NEXT_LOC, DF_REF_ORDER_BY_INSN, DF_REF_ORDER_BY_INSN_WITH_NOTES, DF_REF_ORDER_BY_REG, DF_REF_ORDER_BY_REG_WITH_NOTES, DF_REF_ORDER_UNORDERED, DF_REF_ORDER_UNORDERED_WITH_NOTES, DF_REF_REGNO, FOR_EACH_VEC_ELT, ggc_alloc(), basic_block_def::index, and NULL.

Referenced by df_refs_add_to_chains().

◆ df_mark_reg()

static void df_mark_reg ( rtx reg,
void * vset )
static
Mark a register in SET.  Hard registers in large modes get all
of their component registers set as well.   

References bitmap_set_range(), REG_NREGS, and REGNO.

Referenced by df_get_exit_block_use_set().

◆ df_maybe_reorganize_def_refs()

◆ df_maybe_reorganize_use_refs()

◆ df_mw_compare()

static int df_mw_compare ( const df_mw_hardreg * mw1,
const df_mw_hardreg * mw2 )
static
Compare MW1 and MW2 for sorting.   

References ggc_alloc().

Referenced by df_mw_ptr_compare(), df_notes_rescan(), and df_sort_and_compress_mws().

◆ df_mw_equal_p()

static bool df_mw_equal_p ( struct df_mw_hardreg * mw1,
struct df_mw_hardreg * mw2 )
static
Return true if the contents of two df_ref's are identical.
It ignores DF_REF_MARKER.   

References ggc_alloc().

Referenced by df_mws_verify(), and df_sort_and_compress_mws().

◆ df_mw_hardreg_chain_delete()

static void df_mw_hardreg_chain_delete ( struct df_mw_hardreg * hardregs)
static

◆ df_mw_hardreg_chain_delete_eq_uses()

static void df_mw_hardreg_chain_delete_eq_uses ( struct df_insn_info * insn_info)
static

◆ df_mw_ptr_compare()

static int df_mw_ptr_compare ( const void * m1,
const void * m2 )
static
Like df_mw_compare, but compare two df_mw_hardreg** pointers R1 and R2.   

References df_mw_compare().

Referenced by df_sort_and_compress_mws().

◆ df_mws_verify()

static bool df_mws_verify ( const vec< df_mw_hardreg *, va_heap > * new_rec,
struct df_mw_hardreg * old_rec,
bool abort_if_fail )
static
Verify that NEW_REC and OLD_REC have exactly the same members.  

References df_mw_equal_p(), DF_MWS_NEXT, FOR_EACH_VEC_ELT, gcc_assert, ggc_alloc(), and NULL.

Referenced by df_insn_refs_verify().

◆ df_notes_rescan()

◆ df_process_deferred_rescans()

◆ df_recompute_luids()

◆ df_record_entry_block_defs()

static void df_record_entry_block_defs ( bitmap entry_block_defs)
static
Record the (conservative) set of hard registers that are defined on
entry to the function.   

References BASIC_BLOCK_FOR_FN, cfun, copy_defs, df_entry_block_defs_collect(), df_refs_add_to_chains(), ENTRY_BLOCK, ggc_alloc(), and NULL.

Referenced by df_scan_blocks(), and df_update_entry_block_defs().

◆ df_record_exit_block_uses()

static void df_record_exit_block_uses ( bitmap exit_block_uses)
static
Record the set of hard registers that are used in the exit block.
It uses df->exit_block_uses to determine which bit to include.   

References BASIC_BLOCK_FOR_FN, cfun, copy_uses, df_exit_block_uses_collect(), df_refs_add_to_chains(), EXIT_BLOCK, ggc_alloc(), and NULL.

Referenced by df_scan_blocks(), and df_update_exit_block_uses().

◆ df_ref_chain_delete()

◆ df_ref_chain_delete_du_chain()

static void df_ref_chain_delete_du_chain ( df_ref ref)
static

◆ df_ref_change_reg_with_loc()

void df_ref_change_reg_with_loc ( rtx loc,
unsigned int new_regno )
Change the regno of register LOC to NEW_REGNO and update the df
information accordingly.  Refs that do not match LOC are not changed
which means that artificial refs are not changed since they have no loc.
This call is to support the SET_REGNO macro.  

References df, df_grow_reg_info(), df_ref_change_reg_with_loc_1(), DF_REG_DEF_GET, DF_REG_EQ_USE_GET, DF_REG_USE_GET, GET_MODE, ggc_alloc(), REGNO, and set_mode_and_regno().

◆ df_ref_change_reg_with_loc_1()

◆ df_ref_compare()

static int df_ref_compare ( df_ref ref1,
df_ref ref2 )
static
Compare REF1 and REF2 for sorting.  This is only called from places
where all of the refs are of the same type, in the same insn, and
have the same bb.  So these fields are not checked.   

References DF_REF_ARTIFICIAL, DF_REF_CLASS, DF_REF_FLAGS, DF_REF_FLAGS_IS_SET, DF_REF_LOC, DF_REF_MW_HARDREG, DF_REF_ORDER, DF_REF_REG, DF_REF_REGNO, DF_REF_TYPE, and ggc_alloc().

Referenced by df_install_ref_incremental(), df_ref_change_reg_with_loc_1(), df_ref_ptr_compare(), and df_sort_and_compress_refs().

◆ df_ref_create_structure()

◆ df_ref_equal_p()

static bool df_ref_equal_p ( df_ref ref1,
df_ref ref2 )
static

◆ df_ref_ptr_compare()

static int df_ref_ptr_compare ( const void * r1,
const void * r2 )
static
Like df_ref_compare, but compare two df_ref* pointers R1 and R2.   

References df_ref_compare(), and ggc_alloc().

Referenced by df_sort_and_compress_refs().

◆ df_ref_record()

◆ df_refs_add_to_chains()

◆ df_refs_verify()

static bool df_refs_verify ( const vec< df_ref, va_heap > * new_rec,
df_ref old_rec,
bool abort_if_fail )
static
Verify that NEW_REC and OLD_REC have exactly the same members.  

References df_ref_equal_p(), DF_REF_IS_REG_MARKED, DF_REF_NEXT_LOC, DF_REF_REG_UNMARK, FOR_EACH_VEC_ELT, gcc_assert, ggc_alloc(), and NULL.

Referenced by df_bb_verify(), and df_insn_refs_verify().

◆ df_reg_chain_mark()

static unsigned int df_reg_chain_mark ( df_ref refs,
unsigned int regno,
bool is_def,
bool is_eq_use )
static
Mark all refs in the reg chain.  Verify that all of the registers
are in the correct chain.   

References count, df_chain, DF_REF_CHAIN, DF_REF_FLAGS, DF_REF_IN_NOTE, DF_REF_IS_REG_MARKED, DF_REF_NEXT_REG, DF_REF_PREV_REG, DF_REF_REG_DEF_P, DF_REF_REG_MARK, DF_REF_REGNO, gcc_assert, ggc_alloc(), and refs.

Referenced by df_scan_verify().

◆ df_reg_chain_unlink()

◆ df_reg_chain_verify_unmarked()

static void df_reg_chain_verify_unmarked ( df_ref refs)
static
Verify that all of the registers in the chain are unmarked.   

References DF_REF_IS_REG_MARKED, DF_REF_NEXT_REG, gcc_assert, and refs.

Referenced by df_scan_verify().

◆ df_regs_ever_live_p()

◆ df_reorganize_refs_by_insn()

static void df_reorganize_refs_by_insn ( struct df_ref_info * ref_info,
bool include_defs,
bool include_uses,
bool include_eq_uses )
static
Organize the refs by insn into the table in REF_INFO.  If
blocks_to_analyze is defined, use that set, otherwise the entire
program.  Include the defs if INCLUDE_DEFS. Include the uses if
INCLUDE_USES. Include the eq_uses if INCLUDE_EQ_USES.   

References BASIC_BLOCK_FOR_FN, df_d::blocks_to_analyze, cfun, df, df_check_and_grow_ref_info(), df_count_refs(), df_reorganize_refs_by_insn_bb(), EXECUTE_IF_SET_IN_BITMAP, FOR_ALL_BB_FN, ggc_alloc(), and offset.

Referenced by df_maybe_reorganize_def_refs(), and df_maybe_reorganize_use_refs().

◆ df_reorganize_refs_by_insn_bb()

static unsigned int df_reorganize_refs_by_insn_bb ( basic_block bb,
unsigned int offset,
struct df_ref_info * ref_info,
bool include_defs,
bool include_uses,
bool include_eq_uses )
static
Count the number of refs in all of the insns of BB. Include the
defs if INCLUDE_DEFS. Include the uses if INCLUDE_USES. Include the
eq_uses if INCLUDE_EQ_USES.   

References df_add_refs_to_table(), df_get_artificial_defs(), df_get_artificial_uses(), DF_INSN_UID_DEFS, DF_INSN_UID_EQ_USES, DF_INSN_UID_USES, FOR_BB_INSNS, ggc_alloc(), basic_block_def::index, df_insn_info::insn, INSN_P, INSN_UID(), and offset.

Referenced by df_reorganize_refs_by_insn().

◆ df_reorganize_refs_by_reg()

static void df_reorganize_refs_by_reg ( struct df_ref_info * ref_info,
bool include_defs,
bool include_uses,
bool include_eq_uses )
static
Take build ref table for either the uses or defs from the reg-use
or reg-def chains.   

References df_d::analyze_subset, df, df_reorganize_refs_by_reg_by_insn(), df_reorganize_refs_by_reg_by_reg(), and ggc_alloc().

Referenced by df_maybe_reorganize_def_refs(), and df_maybe_reorganize_use_refs().

◆ df_reorganize_refs_by_reg_by_insn()

static void df_reorganize_refs_by_reg_by_insn ( struct df_ref_info * ref_info,
bool include_defs,
bool include_uses,
bool include_eq_uses )
static
Take build ref table for either the uses or defs from the reg-use
or reg-def chains.  This version processes the refs in insn order
which is likely to be best if processing some segment of the
function.   

References BASIC_BLOCK_FOR_FN, df_d::blocks_to_analyze, cfun, df_d::changeable_flags, df, df_check_and_grow_ref_info(), df_count_refs(), DF_INSN_INFO_GET, DF_NO_HARD_REGS, DF_REF_ID, DF_REF_REGNO, EXECUTE_IF_SET_IN_BITMAP, FOR_BB_INSNS, FOR_EACH_ARTIFICIAL_DEF, FOR_EACH_ARTIFICIAL_USE, FOR_EACH_INSN_INFO_DEF, FOR_EACH_INSN_INFO_EQ_USE, FOR_EACH_INSN_INFO_USE, ggc_alloc(), df_insn_info::insn, INSN_P, offset, r, and df_d::regs_inited.

Referenced by df_reorganize_refs_by_reg().

◆ df_reorganize_refs_by_reg_by_reg()

static void df_reorganize_refs_by_reg_by_reg ( struct df_ref_info * ref_info,
bool include_defs,
bool include_uses,
bool include_eq_uses )
static
Take build ref table for either the uses or defs from the reg-use
or reg-def chains.  This version processes the refs in reg order
which is likely to be best if processing the whole function.   

References df_d::changeable_flags, count, df, df_check_and_grow_ref_info(), df_count_refs(), DF_NO_HARD_REGS, DF_REF_ID, DF_REF_NEXT_REG, DF_REG_DEF_CHAIN, DF_REG_EQ_USE_CHAIN, DF_REG_USE_CHAIN, gcc_checking_assert, ggc_alloc(), offset, and df_d::regs_inited.

Referenced by df_reorganize_refs_by_reg().

◆ df_scan_add_problem()

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_add_problem(), and problem_SCAN.

Referenced by rest_of_handle_df_initialize().

◆ df_scan_alloc()

◆ df_scan_blocks()

◆ df_scan_free()

static void df_scan_free ( void )
static
Free all of the data associated with the scan problem.   

References BITMAP_FREE, df_d::blocks_to_analyze, df, df_scan, df_scan_free_internal(), free(), and NULL.

◆ df_scan_free_bb_info()

◆ df_scan_free_internal()

◆ df_scan_start_block()

static void df_scan_start_block ( basic_block bb,
FILE * file )
static
Dump the bb_info for a given basic block.  

References df_insn_debug(), df_refs_chain_dump(), df_scan_get_bb_info(), FOR_BB_INSNS, ggc_alloc(), basic_block_def::index, and INSN_P.

◆ df_scan_start_dump()

◆ df_scan_verify()

◆ df_set_regs_ever_live()

void df_set_regs_ever_live ( unsigned int regno,
bool value )
Set regs_ever_live[REGNO] to VALUE.  If this cause regs_ever_live
to change, schedule that change for the next update.   

References df, df_d::redo_entry_and_exit, and regs_ever_live.

Referenced by assign_hard_regno(), assign_spill_hard_regs(), finish_spills(), ira_setup_eliminable_regset(), lra(), lra_constraints(), mark_home_live_1(), reload(), rename_chains(), spill_hard_reg(), and update_equiv_regs_prescan().

◆ df_sort_and_compress_mws()

static void df_sort_and_compress_mws ( vec< df_mw_hardreg *, va_heap > * mw_vec)
static

◆ df_sort_and_compress_refs()

static void df_sort_and_compress_refs ( vec< df_ref, va_heap > * ref_vec)
static
Sort and compress a set of refs.   

References count, df_free_ref(), df_ref_compare(), df_ref_equal_p(), df_ref_ptr_compare(), ggc_alloc(), and i.

Referenced by df_canonize_collection_rec().

◆ df_update_entry_block_defs()

◆ df_update_entry_exit_and_calls()

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.   

References CALL_P, cfun, df_insn_rescan(), df_update_entry_block_defs(), df_update_exit_block_uses(), FOR_BB_INSNS, FOR_EACH_BB_FN, and INSN_P.

Referenced by df_compute_regs_ever_live(), df_process_deferred_rescans(), thread_prologue_and_epilogue_insns(), and try_shrink_wrapping_separate().

◆ df_update_exit_block_uses()

◆ df_uses_create()

void df_uses_create ( rtx * loc,
rtx_insn * insn,
int ref_flags )
Create new refs under address LOC within INSN.  This function is
only used externally.  REF_FLAGS must be either 0 or DF_REF_IN_NOTE,
depending on whether LOC is inside PATTERN (INSN) or a note.   

References BLOCK_FOR_INSN(), DF_INSN_INFO_GET, DF_REF_IN_NOTE, DF_REF_REG_USE, df_uses_record(), gcc_assert, ggc_alloc(), and NULL.

◆ df_uses_record()

Variable Documentation

◆ copy_all

const unsigned int copy_all
static
Initial value:
static const unsigned int copy_mw
Definition df-scan.cc:118
static const unsigned int copy_eq_uses
Definition df-scan.cc:117
static const unsigned int copy_defs
Definition df-scan.cc:115
static const unsigned int copy_uses
Definition df-scan.cc:116

Referenced by df_bb_refs_record(), and df_insn_rescan().

◆ copy_defs

const unsigned int copy_defs = 0x1
static
Flags used to tell df_refs_add_to_chains() which vectors it should copy.  

Referenced by df_record_entry_block_defs(), and df_refs_add_to_chains().

◆ copy_eq_uses

const unsigned int copy_eq_uses = 0x4
static

◆ copy_mw

const unsigned int copy_mw = 0x8
static

Referenced by df_refs_add_to_chains().

◆ copy_uses

const unsigned int copy_uses = 0x2
static

◆ elim_reg_set

HARD_REG_SET elim_reg_set
static
Scanning of rtl for dataflow analysis.
   Copyright (C) 1999-2024 Free Software Foundation, Inc.
   Originally contributed by Michael P. Hayes
             (m.hayes@elec.canterbury.ac.nz, mhayes@redhat.com)
   Major rewrite contributed by Danny Berlin (dberlin@dberlin.org)
             and Kenneth Zadeck (zadeck@naturalbridge.com).

This file is part of GCC.

GCC is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Software Foundation; either version 3, or (at your option) any later
version.

GCC is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
for more details.

You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3.  If not see
<http://www.gnu.org/licenses/>.   
The set of hard registers in eliminables[i].from.  

Referenced by df_hard_reg_init(), and df_ref_create_structure().

◆ initialized

bool initialized = false
static

Referenced by df_hard_reg_init().

◆ problem_SCAN

const struct df_problem problem_SCAN
static
Initial value:
=
{
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
sizeof (struct df_scan_bb_info),
}
void df_scan_alloc(bitmap all_blocks)
Definition df-scan.cc:230
static void df_scan_free(void)
Definition df-scan.cc:288
static void df_scan_start_block(basic_block bb, FILE *file)
Definition df-scan.cc:378
static void df_scan_start_dump(FILE *file)
Definition df-scan.cc:304
static void df_scan_free_bb_info(basic_block bb, void *vbb_info)
Definition df-scan.cc:203
@ DF_SCAN
Definition df.h:48
@ DF_NONE
Definition df.h:64
T * ggc_alloc(ALONE_CXX_MEM_STAT_INFO)
Definition ggc.h:184
Definition df.h:810
#define NULL
Definition system.h:50
#define false
Definition system.h:895

Referenced by df_scan_add_problem().

◆ regs_ever_live

bool regs_ever_live[FIRST_PSEUDO_REGISTER]
static
Indexed by hardware reg number, is true if that register is ever
used in the current function.

In df-scan.cc, this is set up to record the hard regs used
explicitly.  Reload adds in the hard regs used for holding pseudo
regs.  Final uses it to generate the code in the function prologue
and epilogue to save and restore registers as needed.   

Referenced by df_compute_regs_ever_live(), df_regs_ever_live_p(), and df_set_regs_ever_live().