GCC Middle and Back End API Reference
regcprop.c File Reference

Data Structures

struct  queued_debug_insn_change
struct  value_data_entry
struct  value_data
struct  kill_set_value_data

Functions

static void kill_value_one_regno (unsigned, struct value_data *)
static void kill_value_regno (unsigned, unsigned, struct value_data *)
static void kill_value (rtx, struct value_data *)
static void set_value_regno (unsigned, enum machine_mode, struct value_data *)
static void init_value_data (struct value_data *)
static void kill_clobbered_value (rtx, const_rtx, void *)
static void kill_set_value (rtx, const_rtx, void *)
static int kill_autoinc_value (rtx *, void *)
static void copy_value (rtx, rtx, struct value_data *)
static bool mode_change_ok (enum machine_mode, enum machine_mode, unsigned int)
static rtx maybe_mode_change (enum machine_mode, enum machine_mode, enum machine_mode, unsigned int, unsigned int)
static rtx find_oldest_value_reg (enum reg_class, rtx, struct value_data *)
static bool replace_oldest_value_reg (rtx *, enum reg_class, rtx, struct value_data *)
static bool replace_oldest_value_addr (rtx *, enum reg_class, enum machine_mode, addr_space_t, rtx, struct value_data *)
static bool replace_oldest_value_mem (rtx, rtx, struct value_data *)
static bool copyprop_hardreg_forward_1 (basic_block, struct value_data *)
void debug_value_data (struct value_data *)
static void validate_value_data (struct value_data *)
static void free_debug_insn_changes ()
static void kill_value_one_regno ()
static void kill_value_regno (unsigned int regno, unsigned int nregs, struct value_data *vd)
static void kill_value ()
static void set_value_regno (unsigned int regno, enum machine_mode mode, struct value_data *vd)
static void init_value_data ()
static void kill_clobbered_value ()
static void kill_set_value ()
static int kill_autoinc_value ()
static void copy_value ()
static rtx find_oldest_value_reg ()
static bool replace_oldest_value_mem ()
static void apply_debug_insn_changes ()
static int cprop_find_used_regs_1 ()
static void cprop_find_used_regs ()
static bool copyprop_hardreg_forward_1 ()
static unsigned int copyprop_hardreg_forward ()
DEBUG_FUNCTION void debug_value_data ()
static void validate_value_data ()
static bool gate_handle_cprop ()
rtl_opt_passmake_pass_cprop_hardreg ()

Variables

static alloc_pool debug_insn_changes_pool

Function Documentation

static void apply_debug_insn_changes ( )
static
static void copy_value ( rtx  ,
rtx  ,
struct value_data  
)
static
static void copy_value ( )
static
Assert that SRC has been copied to DEST.  Adjust the data structures
   to reflect that SRC contains an older copy of the shared value.   

References value_data::e, global_regs, value_data_entry::mode, value_data_entry::next_regno, value_data_entry::oldest_regno, set_value_regno(), and validate_value_data().

static bool copyprop_hardreg_forward_1 ( basic_block  ,
struct value_data  
)
static
static void cprop_find_used_regs ( )
static
Called via note_uses, for all used registers in a real insn
   apply DEBUG_INSN changes that change registers to the used
   registers.   

References cprop_find_used_regs_1(), and for_each_rtx().

Referenced by copyprop_hardreg_forward_1().

static int cprop_find_used_regs_1 ( )
static
Called via for_each_rtx, for all used registers in a real
   insn apply DEBUG_INSN changes that change registers to the
   used register.   

References apply_debug_insn_changes(), value_data_entry::debug_insn_changes, value_data::e, and free_debug_insn_changes().

Referenced by cprop_find_used_regs().

void debug_value_data ( struct value_data )
DEBUG_FUNCTION void debug_value_data ( )
static rtx find_oldest_value_reg ( enum  reg_class,
rtx  ,
struct value_data  
)
static
static rtx find_oldest_value_reg ( )
static
Find the oldest copy of the value contained in REGNO that is in
   register class CL and has mode MODE.  If found, return an rtx
   of that oldest register, otherwise return NULL.   

References value_data::e, in_hard_reg_set_p(), maybe_mode_change(), value_data_entry::mode, value_data_entry::next_regno, and value_data_entry::oldest_regno.

static void free_debug_insn_changes ( )
static
Free all queued updates for DEBUG_INSNs that change some reg to
   register REGNO.   

References value_data_entry::debug_insn_changes, value_data::e, value_data::n_debug_insn_changes, queued_debug_insn_change::next, and pool_free().

Referenced by cprop_find_used_regs_1(), and kill_value_one_regno().

static bool gate_handle_cprop ( )
static
static void init_value_data ( struct value_data )
static
static void init_value_data ( )
static
static int kill_autoinc_value ( rtx ,
void *   
)
static
static int kill_autoinc_value ( )
static
Called through for_each_rtx.  Kill any register used as the base of an
   auto-increment expression, and install that register as the root of its
   own value list.   

References kill_value(), RTX_AUTOINC, and set_value_regno().

static void kill_clobbered_value ( rtx  ,
const_rtx  ,
void *   
)
static
static void kill_clobbered_value ( )
static
Called through note_stores.  If X is clobbered, kill its value.   

References kill_value().

static void kill_set_value ( rtx  ,
const_rtx  ,
void *   
)
static
static void kill_set_value ( )
static
Called through note_stores.  If X is set, not clobbered, kill its
   current value and install it as the root of its own value list.   

References kill_set_value_data::ignore_set_reg, kill_value(), rtx_equal_p(), set_value_regno(), and kill_set_value_data::vd.

static void kill_value ( rtx  ,
struct value_data  
)
static
static void kill_value ( )
static
Kill X.  This is a convenience function wrapping kill_value_regno
   so that we mind the mode the register is in.   

References kill_value_regno(), and simplify_subreg().

static void kill_value_one_regno ( unsigned  ,
struct value_data  
)
static

Referenced by kill_value_regno().

static void kill_value_one_regno ( )
static
Kill register REGNO.  This involves removing it from any value
   lists, and resetting the value mode to VOIDmode.  This is only a
   helper function; it does not handle any hard registers overlapping
   with REGNO.   

References value_data_entry::debug_insn_changes, value_data::e, free_debug_insn_changes(), value_data_entry::mode, queued_debug_insn_change::next, value_data_entry::next_regno, value_data_entry::oldest_regno, and validate_value_data().

static void kill_value_regno ( unsigned  ,
unsigned  ,
struct value_data  
)
static
static void kill_value_regno ( unsigned int  regno,
unsigned int  nregs,
struct value_data vd 
)
static
Kill the value in register REGNO for NREGS, and any other registers
   whose values overlap.   

References value_data::e, kill_value_one_regno(), value_data::max_value_regs, max_value_regs, and value_data_entry::mode.

rtl_opt_pass* make_pass_cprop_hardreg ( )
static rtx maybe_mode_change ( enum machine_mode  orig_mode,
enum machine_mode  copy_mode,
enum machine_mode  new_mode,
unsigned int  regno,
unsigned int  copy_regno 
)
static
Register REGNO was originally set in ORIG_MODE.  It - or a copy of it -
   was copied in COPY_MODE to COPY_REGNO, and then COPY_REGNO was accessed
   in NEW_MODE.
   Return a NEW_MODE rtx for REGNO if that's OK, otherwise return NULL_RTX.   

References mode_change_ok(), new_mode(), offset, and subreg_regno_offset().

Referenced by copyprop_hardreg_forward_1(), and find_oldest_value_reg().

static bool mode_change_ok ( enum machine_mode  orig_mode,
enum machine_mode  new_mode,
unsigned int  regno 
)
static
Return true if a mode change from ORIG to NEW is allowed for REGNO.   

Referenced by maybe_mode_change().

static bool replace_oldest_value_addr ( rtx loc,
enum reg_class  cl,
enum machine_mode  mode,
addr_space_t  as,
rtx  insn,
struct value_data vd 
)
static
Similar to replace_oldest_value_reg, but *LOC contains an address.
   Adapted from find_reloads_address_1.  CL is INDEX_REG_CLASS or
   BASE_REG_CLASS depending on how the register is being considered.   

References base_reg_class(), changed, queued_debug_insn_change::loc, regno_ok_for_base_p(), replace_oldest_value_mem(), and replace_oldest_value_reg().

Referenced by copyprop_hardreg_forward_1(), and replace_oldest_value_mem().

static bool replace_oldest_value_mem ( rtx  ,
rtx  ,
struct value_data  
)
static
static bool replace_oldest_value_mem ( )
static
Similar to replace_oldest_value_reg, but X contains a memory.   

References base_reg_class(), and replace_oldest_value_addr().

static bool replace_oldest_value_reg ( rtx loc,
enum reg_class  cl,
rtx  insn,
struct value_data vd 
)
static
static void set_value_regno ( unsigned  ,
enum  machine_mode,
struct value_data  
)
static
static void set_value_regno ( unsigned int  regno,
enum machine_mode  mode,
struct value_data vd 
)
static
Remember that REGNO is valid in MODE.   

References value_data::e, value_data::max_value_regs, and value_data_entry::mode.

static void validate_value_data ( struct value_data )
static

Referenced by copy_value(), and kill_value_one_regno().


Variable Documentation

alloc_pool debug_insn_changes_pool
static