GCC Middle and Back End API Reference
cselib.c File Reference
#include "tm_p.h"
#include "regs.h"
Include dependency graph for cselib.c:

Data Structures

struct  elt_list
struct  expand_value_data
struct  cselib_hasher
struct  cselib_record_autoinc_data

Functions

static void promote_debug_loc (struct elt_loc_list *l)
static struct elt_listnew_elt_list (struct elt_list *, cselib_val *)
static void new_elt_loc_list (cselib_val *, rtx)
static void unchain_one_value (cselib_val *)
static void unchain_one_elt_list (struct elt_list **)
static void unchain_one_elt_loc_list (struct elt_loc_list **)
static void remove_useless_values (void)
static int rtx_equal_for_cselib_1 (rtx, rtx, enum machine_mode)
static unsigned int cselib_hash_rtx (rtx, int, enum machine_mode)
static cselib_valnew_cselib_val (unsigned int, enum machine_mode, rtx)
static void add_mem_for_addr (cselib_val *, cselib_val *, rtx)
static cselib_valcselib_lookup_mem (rtx, int)
static void cselib_invalidate_regno (unsigned int, enum machine_mode)
static void cselib_invalidate_mem (rtx)
static void cselib_record_set (rtx, cselib_val *, cselib_val *)
static void cselib_record_sets (rtx)
static rtx cselib_expand_value_rtx_1 (rtx, struct expand_value_data *, int)
static struct elt_listnew_elt_list ()
static void new_elt_loc_list ()
static void promote_debug_loc ()
static void unchain_one_elt_list ()
static void unchain_one_elt_loc_list ()
static void unchain_one_value ()
void cselib_clear_table ()
static bool invariant_or_equiv_p ()
int preserve_constants_and_equivs ()
void cselib_reset_table ()
unsigned int cselib_get_next_uid ()
static cselib_val ** cselib_find_slot (rtx x, hashval_t hash, enum insert_option insert, enum machine_mode memmode)
int references_value_p ()
int discard_useless_locs ()
int discard_useless_values ()
void cselib_preserve_value ()
bool cselib_preserved_value_p ()
void cselib_preserve_cfa_base_value ()
void cselib_preserve_only_values ()
void cselib_set_value_sp_based ()
bool cselib_sp_based_value_p ()
enum machine_mode cselib_reg_set_mode ()
int rtx_equal_for_cselib_p ()
static rtx autoinc_split ()
static int rtx_equal_for_cselib_1 ()
static rtx wrap_constant ()
static unsigned int cselib_hash_rtx ()
static cselib_valnew_cselib_val ()
static void add_mem_for_addr ()
static cselib_valcselib_lookup_mem ()
static rtx expand_loc (struct elt_loc_list *p, struct expand_value_data *evd, int max_depth)
rtx cselib_expand_value_rtx ()
rtx cselib_expand_value_rtx_cb (rtx orig, bitmap regs_active, int max_depth, cselib_expand_callback cb, void *data)
bool cselib_dummy_expand_value_rtx_cb (rtx orig, bitmap regs_active, int max_depth, cselib_expand_callback cb, void *data)
rtx cselib_subst_to_values ()
rtx cselib_subst_to_values_from_insn ()
static cselib_valcselib_lookup_1 (rtx x, enum machine_mode mode, int create, enum machine_mode memmode)
cselib_valcselib_lookup_from_insn (rtx x, enum machine_mode mode, int create, enum machine_mode memmode, rtx insn)
cselib_valcselib_lookup (rtx x, enum machine_mode mode, int create, enum machine_mode memmode)
static void cselib_invalidate_regno ()
static void cselib_invalidate_mem ()
void cselib_invalidate_rtx ()
static void cselib_invalidate_rtx_note_stores (rtx dest, const_rtx ignore, void *data)
static void cselib_record_set ()
void cselib_add_permanent_equiv ()
bool cselib_have_permanent_equivalences ()
static int cselib_record_autoinc_cb (rtx mem, rtx op, rtx dest, rtx src, rtx srcoff, void *arg)
static void cselib_record_sets ()
bool fp_setter_insn ()
void cselib_process_insn ()
void cselib_init ()
void cselib_finish ()
int dump_cselib_val ()
void dump_cselib_table ()

Variables

static enum machine_mode find_slot_memmode
static bool cselib_record_memory
static bool cselib_preserve_constants
static bool cselib_any_perm_equivs
static hash_table< cselib_hashercselib_hash_table
static rtx cselib_current_insn
static unsigned int next_uid
static unsigned int cselib_nregs
static int n_useless_values
static int n_useless_debug_values
static int n_debug_values
static struct elt_list ** reg_values
static unsigned int reg_values_size
static unsigned int max_value_regs
static unsigned int * used_regs
static unsigned int n_used_regs
static rtx callmem
static int values_became_useless
static cselib_val dummy_val
static cselib_valcfa_base_preserved_val
static unsigned int cfa_base_preserved_regno = INVALID_REGNUM
static cselib_valfirst_containing_mem = &dummy_val
static alloc_pool elt_loc_list_pool
static alloc_pool elt_list_pool
static alloc_pool cselib_val_pool
static alloc_pool value_pool
void(* cselib_discard_hook )(cselib_val *)
void(* cselib_record_sets_hook )(rtx insn, struct cselib_set *sets, int n_sets)

Function Documentation

static void add_mem_for_addr ( cselib_val ,
cselib_val ,
rtx   
)
static
static void add_mem_for_addr ( )
static
ADDR_ELT is a value that is used as address.  MEM_ELT is the value that
   contains the data at this address.  X is a MEM that represents the
   value.  Update the two value structures to represent this situation.   

References cselib_val_struct::addr_list, canonical_cselib_val(), first_containing_mem, elt_loc_list::loc, cselib_val_struct::locs, new_elt_list(), new_elt_loc_list(), elt_loc_list::next, cselib_val_struct::next_containing_mem, promote_debug_loc(), replace_equiv_address_nv(), and cselib_val_struct::val_rtx.

static rtx autoinc_split ( )
static
If x is a PLUS or an autoinc operation, expand the operation,
   storing the offset, if any, in *OFF.   

Referenced by rtx_equal_for_cselib_1().

void cselib_add_permanent_equiv ( )
void cselib_clear_table ( void  )
Remove all entries from the hash table.  Also used during
   initialization.   

References cselib_reset_table().

Referenced by cselib_finish(), dse_step1(), and local_cprop_pass().

bool cselib_dummy_expand_value_rtx_cb ( rtx  orig,
bitmap  regs_active,
int  max_depth,
cselib_expand_callback  cb,
void *  data 
)
Similar to cselib_expand_value_rtx_cb, but no rtxs are actually copied
   or simplified.  Useful to find out whether cselib_expand_value_rtx_cb
   would return NULL or non-NULL, without allocating new rtx.   

References expand_value_data::callback, expand_value_data::callback_arg, cselib_expand_value_rtx_1(), expand_value_data::dummy, and expand_value_data::regs_active.

rtx cselib_expand_value_rtx ( )
Forward substitute and expand an expression out to its roots.
   This is the opposite of common subexpression.  Because local value
   numbering is such a weak optimization, the expanded expression is
   pretty much unique (not from a pointer equals point of view but
   from a tree shape point of view.

   This function returns NULL if the expansion fails.  The expansion
   will fail if there is no value number for one of the operands or if
   one of the operands has been overwritten between the current insn
   and the beginning of the basic block.  For instance x has no
   expansion in:

   r1 <- r1 + 3
   x <- r1 + 8

   REGS_ACTIVE is a scratch bitmap that should be clear when passing in.
   It is clear on return.   

References expand_value_data::callback, expand_value_data::callback_arg, cselib_expand_value_rtx_1(), expand_value_data::dummy, and expand_value_data::regs_active.

Referenced by canon_address(), get_call_args(), record_store(), and reverse_op().

rtx cselib_expand_value_rtx_cb ( rtx  orig,
bitmap  regs_active,
int  max_depth,
cselib_expand_callback  cb,
void *  data 
)
Same as cselib_expand_value_rtx, but using a callback to try to
   resolve some expressions.  The CB function should return ORIG if it
   can't or does not want to deal with a certain RTX.  Any other
   return value, including NULL, will be used as the expansion for
   VALUE, without any further changes.   

References expand_value_data::callback, expand_value_data::callback_arg, cselib_expand_value_rtx_1(), expand_value_data::dummy, and expand_value_data::regs_active.

Referenced by vt_expand_loc(), vt_expand_loc_callback(), and vt_expand_var_loc_chain().

static cselib_val** cselib_find_slot ( rtx  x,
hashval_t  hash,
enum insert_option  insert,
enum machine_mode  memmode 
)
static
Search for X, whose hashcode is HASH, in CSELIB_HASH_TABLE,
   INSERTing if requested.  When X is part of the address of a MEM,
   MEMMODE should specify the mode of the MEM.  While searching the
   table, MEMMODE is held in FIND_SLOT_MEMMODE, so that autoinc RTXs
   in X can be resolved.   

References find_slot_memmode, and hash_table< Descriptor, Allocator >::find_slot_with_hash().

Referenced by cselib_lookup_1(), and cselib_lookup_mem().

unsigned int cselib_get_next_uid ( void  )
Return the number of the next value that will be generated.   

References next_uid.

Referenced by vt_emit_notes(), and vt_initialize().

static unsigned int cselib_hash_rtx ( rtx  ,
int  ,
enum  machine_mode 
)
static

Referenced by cselib_hash_rtx(), and cselib_lookup_1().

static unsigned int cselib_hash_rtx ( )
static
Hash an rtx.  Return 0 if we couldn't hash the rtx.
   For registers and memory locations, we look up their cselib_val structure
   and return its VALUE element.
   Possible reasons for return 0 are: the object is volatile, or we couldn't
   find a register or memory location in the table and CREATE is zero.  If
   CREATE is nonzero, table elts are created for regs and mem.
   N.B. this hash function returns the same hash value for RTXes that
   differ only in the order of operands, thus it is suitable for comparisons
   that take commutativity into account.
   If we wanted to also support associative rules, we'd have to use a different
   strategy to avoid returning spurious 0, e.g. return ~(~0U >> 1) .
   MEMMODE indicates the mode of an enclosing MEM, and it's only
   used to compute autoinc values.
   We used to have a MODE argument for hashing for CONST_INTs, but that
   didn't make sense, since it caused spurious hash differences between
    (set (reg:SI 1) (const_int))
    (plus:SI (reg:SI 2) (reg:SI 1))
   and
    (plus:SI (reg:SI 2) (const_int))
   If the mode is important in any context, it must be checked specifically
   in a comparison anyway, since relying on hash differences is unsafe.   

References cselib_hash_rtx(), cselib_lookup(), fixed_hash(), cselib_val_struct::hash, and real_hash().

bool cselib_have_permanent_equivalences ( void  )
Return TRUE if any permanent equivalences have been recorded since
   the table was last initialized.   

References cselib_any_perm_equivs.

Referenced by get_addr().

static void cselib_invalidate_mem ( rtx  )
static
static void cselib_invalidate_mem ( )
static
static void cselib_invalidate_regno ( unsigned  int,
enum  machine_mode 
)
static
static void cselib_invalidate_regno ( )
static
Invalidate any entries in reg_values that overlap REGNO.  This is called
   if REGNO is changing.  MODE is the mode of the assignment to REGNO, which
   is used to determine how many hard registers are being changed.  If MODE
   is VOIDmode, then only REGNO is being changed; this is used when
   invalidating call clobbered registers across a call.   

References canonical_cselib_val(), cfa_base_preserved_regno, elt_list::elt, end_hard_regno(), cselib_val_struct::locs, max_value_regs, n_useless_debug_values, n_useless_values, elt_loc_list::next, elt_list::next, reg_renumber, reload_completed, elt_loc_list::setting_insn, unchain_one_elt_list(), unchain_one_elt_loc_list(), and cselib_val_struct::val_rtx.

void cselib_invalidate_rtx ( )
static void cselib_invalidate_rtx_note_stores ( rtx  dest,
const_rtx  ignore,
void *  data 
)
static
A wrapper for cselib_invalidate_rtx to be called via note_stores.   

References cselib_invalidate_rtx().

Referenced by cselib_record_sets().

static cselib_val* cselib_lookup_1 ( rtx  x,
enum machine_mode  mode,
int  create,
enum machine_mode  memmode 
)
static
Look up the rtl expression X in our tables and return the value it
   has.  If CREATE is zero, we return NULL if we don't know the value.
   Otherwise, we create a new one if possible, using mode MODE if X
   doesn't have a mode (i.e. because it's a constant).  When X is part
   of an address, MEMMODE should be the mode of the enclosing MEM if
   we're tracking autoinc expressions.   

References cselib_find_slot(), cselib_hash_rtx(), cselib_lookup_mem(), cselib_preserve_constants, cselib_subst_to_values(), elt_list::elt, cselib_val_struct::hash, elt_loc_list::loc, cselib_val_struct::locs, lowpart_subreg(), max_value_regs, n_used_regs, new_cselib_val(), new_elt_list(), new_elt_loc_list(), elt_loc_list::next, elt_list::next, next_uid, promote_debug_loc(), used_regs, cselib_val_struct::val_rtx, and wrap_constant().

Referenced by cselib_lookup().

cselib_val* cselib_lookup_from_insn ( rtx  x,
enum machine_mode  mode,
int  create,
enum machine_mode  memmode,
rtx  insn 
)
Wrapper for cselib_lookup, that indicates X is in INSN.   

References cselib_current_insn, and cselib_lookup().

Referenced by sched_analyze_1(), sched_analyze_2(), vt_add_function_parameter(), vt_init_cfa_base(), and vt_initialize().

static cselib_val* cselib_lookup_mem ( rtx  ,
int   
)
static
static cselib_val* cselib_lookup_mem ( )
static
void cselib_preserve_cfa_base_value ( )
Arrange for a REG value to be assumed constant through the whole function,
   never invalidated and preserved across cselib_reset_table calls.   

References cfa_base_preserved_regno, cselib_preserve_constants, elt_loc_list::loc, and cselib_val_struct::locs.

Referenced by vt_init_cfa_base(), and vt_initialize().

void cselib_preserve_only_values ( void  )
Clean all non-constant expressions in the hash table, but retain
   their values.   

References cselib_invalidate_mem(), cselib_invalidate_regno(), first_containing_mem, and remove_useless_values().

Referenced by cselib_process_insn(), and vt_initialize().

void cselib_preserve_value ( )
Arrange for a value to not be removed from the hash table even if
   it becomes useless.   

References cselib_val_struct::val_rtx.

Referenced by cselib_add_permanent_equiv(), preserve_value(), and variable_post_merge_new_vals().

bool cselib_preserved_value_p ( )
static int cselib_record_autoinc_cb ( rtx  mem,
rtx  op,
rtx  dest,
rtx  src,
rtx  srcoff,
void *  arg 
)
static
Callback for for_each_inc_dec.  Records in ARG the SETs implied by
   autoinc RTXs: SRC plus SRCOFF if non-NULL is stored in DEST.   

References cselib_set::dest, cselib_record_autoinc_data::n_sets, cselib_record_autoinc_data::sets, and cselib_set::src.

Referenced by cselib_record_sets().

static void cselib_record_set ( rtx  ,
cselib_val ,
cselib_val  
)
static

Referenced by cselib_record_sets().

static void cselib_record_set ( )
static
Record the result of a SET instruction.  DEST is being set; the source
   contains the value described by SRC_ELT.  If DEST is a MEM, DEST_ADDR_ELT
   describes its address.   

References add_mem_for_addr(), cselib_record_memory, elt_list::elt, cselib_val_struct::locs, max_value_regs, n_used_regs, n_useless_values, new_elt_list(), new_elt_loc_list(), side_effects_p(), used_regs, and cselib_val_struct::val_rtx.

static void cselib_record_sets ( rtx  )
static

Referenced by cselib_process_insn().

enum machine_mode cselib_reg_set_mode ( )
Return the mode in which a register was last set.  If X is not a
   register, return its mode.  If the mode in which the register was
   set is not known, or the value was already clobbered, return
   VOIDmode.   

Referenced by reload_cse_noop_set_p().

void cselib_set_value_sp_based ( )
Arrange for a value to be marked as based on stack pointer
   for find_base_term purposes.   

References cselib_val_struct::val_rtx.

Referenced by add_stores(), and vt_initialize().

bool cselib_sp_based_value_p ( )
Test whether a value is based on stack pointer for
   find_base_term purposes.   

References cselib_val_struct::val_rtx.

Referenced by find_base_term().

rtx cselib_subst_to_values ( )
Walk rtx X and replace all occurrences of REG and MEM subexpressions
   with VALUE expressions.  This way, it becomes independent of changes
   to registers and memory.
   X isn't actually modified; if modifications are needed, new rtl is
   allocated.  However, the return value can share rtl with X.
   If X is within a MEM, MEMMODE must be the mode of the MEM.   

References copy(), cselib_lookup(), cselib_lookup_mem(), elt_list::elt, new_cselib_val(), elt_list::next, next_uid, plus_constant(), shallow_copy_rtvec(), and cselib_val_struct::val_rtx.

Referenced by cselib_lookup_1(), cselib_subst_to_values_from_insn(), debug_mem_addr_value(), and replace_expr_with_values().

rtx cselib_subst_to_values_from_insn ( )
Wrapper for cselib_subst_to_values, that indicates X is in INSN.   

References cselib_current_insn, and cselib_subst_to_values().

Referenced by add_insn_mem_dependence(), sched_analyze_1(), and sched_analyze_2().

int discard_useless_locs ( )
For all locations found in X, delete locations that reference useless
   values (i.e. values without any location).  Called through
   htab_traverse.   

References cselib_val_struct::locs, n_useless_debug_values, n_useless_values, elt_loc_list::next, references_value_p(), elt_loc_list::setting_insn, unchain_one_elt_loc_list(), and cselib_val_struct::val_rtx.

Referenced by remove_useless_values().

int discard_useless_values ( )
void dump_cselib_table ( )
static rtx expand_loc ( struct elt_loc_list p,
struct expand_value_data evd,
int  max_depth 
)
static
Search through the possible substitutions in P.  We prefer a non reg
   substitution because this allows us to expand the tree further.  If
   we find, just a reg, take the lowest regno.  There may be several
   non-reg results, we just take the first one because they will all
   expand to the same place.   

References bitmap_bit_p(), cfa_base_preserved_regno, cselib_expand_value_rtx_1(), dump_file, dump_flags, find_reg_note(), elt_loc_list::loc, elt_loc_list::next, print_inline_rtx(), expand_value_data::regs_active, and elt_loc_list::setting_insn.

Referenced by cselib_expand_value_rtx_1().

bool fp_setter_insn ( )
Return true if INSN in the prologue initializes hard_frame_pointer_rtx.   

References find_reg_note(), and modified_in_p().

Referenced by cselib_process_insn(), and vt_initialize().

static bool invariant_or_equiv_p ( )
static
Return TRUE if V is a constant, a function invariant or a VALUE
   equivalence; FALSE otherwise.   

References elt_loc_list::loc, cselib_val_struct::locs, elt_loc_list::next, and references_value_p().

Referenced by preserve_constants_and_equivs().

static cselib_val* new_cselib_val ( unsigned  int,
enum  machine_mode,
rtx   
)
static
static cselib_val* new_cselib_val ( )
inlinestatic
static struct elt_list* new_elt_list ( struct elt_list ,
cselib_val  
)
staticread
static struct elt_list* new_elt_list ( )
staticread
Allocate a struct elt_list and fill in its two elements with the
   arguments.   

References elt_list::elt, elt_list::next, and pool_alloc().

static void new_elt_loc_list ( cselib_val ,
rtx   
)
static
int preserve_constants_and_equivs ( )
Remove from hash table all VALUEs except constants, function
   invariants and VALUE equivalences.   

References hash_table< Descriptor, Allocator >::clear_slot(), and invariant_or_equiv_p().

Referenced by cselib_reset_table().

static void promote_debug_loc ( struct elt_loc_list l)
inlinestatic
static void promote_debug_loc ( )
inlinestatic
Promote loc L to a nondebug cselib_current_insn if L is marked as
   originating from a debug insn, maintaining the debug values
   count.   

References cselib_current_insn, cselib_preserve_constants, n_debug_values, elt_loc_list::next, and elt_loc_list::setting_insn.

int references_value_p ( )
Return true if X contains a VALUE rtx.  If ONLY_USELESS is set, we
   only return true for values which point to a cselib_val whose value
   element has been set to zero, which implies the cselib_val will be
   removed.   

Referenced by discard_useless_locs(), invariant_or_equiv_p(), reload_cse_simplify_set(), and reverse_op().

static void remove_useless_values ( )
static
static int rtx_equal_for_cselib_1 ( rtx  ,
rtx  ,
enum  machine_mode 
)
static
static int rtx_equal_for_cselib_1 ( )
static
Return nonzero if we can prove that X and Y contain the same value,
   taking our gathered information into account.  MEMMODE holds the
   mode of the enclosing MEM, if any, as required to deal with autoinc
   addressing modes.  If X and Y are not (known to be) part of
   addresses, MEMMODE should be VOIDmode.   

References autoinc_split(), canonical_cselib_val(), cselib_lookup(), elt_loc_list::loc, cselib_val_struct::locs, elt_loc_list::next, rtx_equal_for_cselib_1(), rtx_equal_p(), targetm, and cselib_val_struct::val_rtx.

int rtx_equal_for_cselib_p ( )
Return nonzero if we can prove that X and Y contain the same value, taking
   our gathered information into account.   

References rtx_equal_for_cselib_1().

Referenced by mark_effect(), and reload_cse_noop_set_p().

static void unchain_one_elt_list ( struct elt_list **  )
static
static void unchain_one_elt_list ( )
inlinestatic
The elt_list at *PL is no longer needed.  Unchain it and free its
   storage.   

References elt_list::next, and pool_free().

static void unchain_one_elt_loc_list ( struct elt_loc_list **  )
static
static void unchain_one_elt_loc_list ( )
static
Likewise for elt_loc_lists.   

References elt_loc_list::next, and pool_free().

static void unchain_one_value ( cselib_val )
static

Referenced by discard_useless_values().

static void unchain_one_value ( )
static
Likewise for cselib_vals.  This also frees the addr_list associated with
   V.   

References cselib_val_struct::addr_list, pool_free(), and unchain_one_elt_list().

static rtx wrap_constant ( )
static
We need to pass down the mode of constants through the hash table
   functions.  For that purpose, wrap them in a CONST of the appropriate
   mode.   

Referenced by cselib_lookup_1(), and cselib_lookup_mem().


Variable Documentation

rtx callmem
static
We pass this to cselib_invalidate_mem to invalidate all of
   memory for a non-const call instruction.   
unsigned int cfa_base_preserved_regno = INVALID_REGNUM
static
cselib_val* cfa_base_preserved_val
static
If non-NULL, value of the eliminated arg_pointer_rtx or frame_pointer_rtx
   that is constant through the whole function and should never be
   eliminated.   
rtx cselib_current_insn
static
This is a global so we don't have to pass this through every function.
   It is used in new_elt_loc_list to set SETTING_INSN.   

Referenced by cselib_add_permanent_equiv(), cselib_lookup_from_insn(), cselib_process_insn(), cselib_subst_to_values_from_insn(), new_elt_loc_list(), and promote_debug_loc().

void(* cselib_discard_hook)(cselib_val *)
If nonnull, cselib will call this function before freeing useless
   VALUEs.  A VALUE is deemed useless if its "locs" field is null.   

Referenced by cselib_finish(), discard_useless_values(), and dse_step1().

hash_table<cselib_hasher> cselib_hash_table
static
A table that enables us to look up elts by their value.   
unsigned int cselib_nregs
static
The number of registers we had when the varrays were last resized.   

Referenced by cselib_init().

bool cselib_record_memory
static
void(* cselib_record_sets_hook)(rtx insn, struct cselib_set *sets, int n_sets)
If nonnull, cselib will call this function before recording sets or
   even clobbering outputs of INSN.  All the recorded sets will be
   represented in the array sets[n_sets].  new_val_min can be used to
   tell whether values present in sets are introduced by this
   instruction.   

Referenced by cselib_record_sets(), and vt_initialize().

alloc_pool cselib_val_pool
static
cselib_val dummy_val
static
Used as stop element of the containing_mem list so we can check
   presence in the list by checking the next pointer.   

Referenced by cselib_invalidate_mem(), cselib_reset_table(), and remove_useless_values().

alloc_pool elt_list_pool
static
alloc_pool elt_loc_list_pool
static
enum machine_mode find_slot_memmode
static
See the documentation of cselib_find_slot below.   

Referenced by cselib_find_slot(), and cselib_hasher::equal().

cselib_val* first_containing_mem = &dummy_val
static
Used to list all values that contain memory reference.
   May or may not contain the useless values - the list is compacted
   each time memory is invalidated.   

Referenced by add_mem_for_addr(), cselib_invalidate_mem(), cselib_preserve_only_values(), cselib_reset_table(), dump_cselib_table(), and remove_useless_values().

unsigned int max_value_regs
static
The largest number of hard regs used by any entry added to the
   REG_VALUES table.  Cleared on each cselib_clear_table() invocation.   

Referenced by cselib_invalidate_regno(), cselib_lookup_1(), cselib_record_set(), cselib_reset_table(), and kill_value_regno().

int n_debug_values
static
Count values whose locs have been taken exclusively from debug
   insns for the entire life of the value.   

Referenced by cselib_finish(), cselib_process_insn(), cselib_reset_table(), new_elt_loc_list(), promote_debug_loc(), and remove_useless_values().

unsigned int n_used_regs
static
int n_useless_values
static
Count values without known locations, or with only locations that
   wouldn't have been known except for debug insns.  Whenever this
   grows too big, we remove these useless values from the table.

   Counting values with only debug values is a bit tricky.  We don't
   want to increment n_useless_values when we create a value for a
   debug insn, for this would get n_useless_values out of sync, but we
   want increment it if all locs in the list that were ever referenced
   in nondebug insns are removed from the list.

   In the general case, once we do that, we'd have to stop accepting
   nondebug expressions in the loc list, to avoid having two values
   equivalent that, without debug insns, would have been made into
   separate values.  However, because debug insns never introduce
   equivalences themselves (no assignments), the only means for
   growing loc lists is through nondebug assignments.  If the locs
   also happen to be referenced in debug insns, it will work just fine.

   A consequence of this is that there's at most one debug-only loc in
   each loc list.  If we keep it in the first entry, testing whether
   we have a debug-only loc list takes O(1).

   Furthermore, since any additional entry in a loc list containing a
   debug loc would have to come from an assignment (nondebug) that
   references both the initial debug loc and the newly-equivalent loc,
   the initial debug loc would be promoted to a nondebug loc, and the
   loc list would not contain debug locs any more.

   So the only case we have to be careful with in order to keep
   n_useless_values in sync between debug and nondebug compilations is
   to avoid incrementing n_useless_values when removing the single loc
   from a value that turns out to not appear outside debug values.  We
   increment n_useless_debug_values instead, and leave such values
   alone until, for other reasons, we garbage-collect useless
   values.   

Referenced by cselib_finish(), cselib_invalidate_mem(), cselib_invalidate_regno(), cselib_process_insn(), cselib_record_set(), cselib_reset_table(), discard_useless_locs(), discard_useless_values(), and remove_useless_values().

struct elt_list** reg_values
static
This table maps from register number to values.  It does not
   contain pointers to cselib_val structures, but rather elt_lists.
   The purpose is to be able to refer to the same register in
   different modes.  The first element of the list defines the mode in
   which the register was set; if the mode is unknown or the value is
   no longer valid in that mode, ELT will be NULL for the first
   element.   
unsigned int reg_values_size
static

Referenced by cselib_init().

unsigned int* used_regs
static
Here the set of indices I with REG_VALUES(I) != 0 is saved.  This is used
   in cselib_clear_table() for fast emptying.   

Referenced by cselib_finish(), cselib_init(), cselib_lookup_1(), cselib_record_set(), cselib_reset_table(), find_best_reg_for_expr(), find_used_regs(), mark_unavailable_hard_regs(), and setup_save_areas().

alloc_pool value_pool
static
int values_became_useless
static
Set by discard_useless_locs if it deleted the last location of any
   value.