GCC Middle and Back End API Reference
|
Data Structures | |
struct | elt_list |
struct | expand_value_data |
struct | cselib_hasher |
struct | cselib_record_autoinc_data |
|
static |
Referenced by cselib_lookup_mem(), and cselib_record_set().
|
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 |
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 | ( | ) |
Make ELT and X's VALUE equivalent to each other at INSN.
References cselib_any_perm_equivs, cselib_current_insn, cselib_lookup(), cselib_preserve_value(), new_elt_loc_list(), side_effects_p(), and cselib_val_struct::val_rtx.
Referenced by record_entry_value(), reverse_op(), and vt_initialize().
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().
|
static |
Internal implementation of cselib_expand_value_rtx and cselib_expand_value_rtx_cb.
References bitmap_clear_bit(), bitmap_set_bit(), expand_value_data::callback, expand_value_data::callback_arg, cfa_base_preserved_regno, copy(), expand_value_data::dummy, dump_file, dump_flags, elt_list::elt, expand_loc(), cselib_val_struct::locs, elt_list::next, print_rtl_single(), expand_value_data::regs_active, rtvec_alloc(), RTX_BIN_ARITH, RTX_BITFIELD_OPS, RTX_COMM_ARITH, RTX_COMM_COMPARE, RTX_COMPARE, RTX_TERNARY, RTX_UNARY, shared_const_p(), simplify_gen_subreg(), simplify_relational_operation(), simplify_rtx(), simplify_ternary_operation(), simplify_unary_operation(), and cselib_val_struct::val_rtx.
Referenced by cselib_dummy_expand_value_rtx_cb(), cselib_expand_value_rtx(), cselib_expand_value_rtx_cb(), and expand_loc().
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 |
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().
void cselib_finish | ( | void | ) |
Called when the current user is done with cselib.
References cfa_base_preserved_regno, cselib_any_perm_equivs, cselib_clear_table(), cselib_discard_hook, cselib_preserve_constants, hash_table< Descriptor, Allocator >::dispose(), free(), free_alloc_pool(), n_debug_values, n_useless_debug_values, n_useless_values, next_uid, and used_regs.
Referenced by dse_step1(), local_cprop_pass(), reload_cse_regs_1(), sched_analyze(), thread_jump(), and vt_finalize().
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 |
Referenced by cselib_hash_rtx(), and cselib_lookup_1().
|
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().
void cselib_init | ( | ) |
Initialize cselib for one pass. The caller must also call init_alias_analysis.
References hash_table< Descriptor, Allocator >::create(), create_alloc_pool(), cselib_any_perm_equivs, cselib_nregs, cselib_preserve_constants, CSELIB_PRESERVE_CONSTANTS, cselib_record_memory, CSELIB_RECORD_MEMORY, free(), gen_rtx_MEM(), max_reg_num(), n_used_regs, next_uid, reg_values_size, and used_regs.
Referenced by dse_step1(), local_cprop_pass(), reload_cse_regs_1(), sched_analyze(), thread_jump(), and vt_initialize().
|
static |
Referenced by cselib_invalidate_rtx(), cselib_preserve_only_values(), and cselib_process_insn().
|
static |
Invalidate any locations in the table which are changed because of a store to MEM_RTX. If this is called because of a non-const call instruction, MEM_RTX is (mem:BLK const0_rtx).
References cselib_val_struct::addr_list, canon_anti_dependence(), canon_rtx(), canonical_cselib_val(), cselib_lookup(), dummy_val, first_containing_mem, get_addr(), cselib_val_struct::locs, n_useless_debug_values, n_useless_values, elt_loc_list::next, elt_list::next, cselib_val_struct::next_containing_mem, elt_loc_list::setting_insn, unchain_one_elt_list(), unchain_one_elt_loc_list(), and cselib_val_struct::val_rtx.
|
static |
Referenced by cselib_invalidate_rtx(), cselib_preserve_only_values(), and cselib_process_insn().
|
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 | ( | ) |
Invalidate DEST, which is being assigned to or clobbered.
References cselib_invalidate_mem(), and cselib_invalidate_regno().
Referenced by cselib_invalidate_rtx_note_stores(), cselib_process_insn(), cselib_record_sets(), reload_cse_simplify(), variable_post_merge_new_vals(), and vt_initialize().
A wrapper for cselib_invalidate_rtx to be called via note_stores.
References cselib_invalidate_rtx().
Referenced by cselib_record_sets().
cselib_val* cselib_lookup | ( | rtx | x, |
enum machine_mode | mode, | ||
int | create, | ||
enum machine_mode | memmode | ||
) |
Wrapper for cselib_lookup_1, that logs the lookup result and maintains invariants related with debug insns.
References cselib_lookup_1(), dump_file, dump_flags, cselib_val_struct::hash, print_inline_rtx(), and cselib_val_struct::uid.
Referenced by add_stores(), add_uses(), canon_address(), cselib_add_permanent_equiv(), cselib_hash_rtx(), cselib_invalidate_mem(), cselib_lookup_from_insn(), cselib_lookup_mem(), cselib_record_sets(), cselib_subst_to_values(), debug_mem_addr_value(), do_local_cprop(), find_use_val(), prepare_call_arguments(), reload_cse_simplify_operands(), reload_cse_simplify_set(), replace_expr_with_values(), reverse_op(), rtx_equal_for_cselib_1(), use_narrower_mode_test(), use_type(), variable_post_merge_new_vals(), and vt_initialize().
|
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 |
Referenced by cselib_lookup_1(), and cselib_subst_to_values().
|
static |
Subroutine of cselib_lookup. Return a value for X, which is a MEM rtx. If CREATE, make a new one if we haven't seen it before.
References add_mem_for_addr(), cselib_val_struct::addr_list, canonical_cselib_val(), cselib_find_slot(), cselib_lookup(), cselib_record_memory, elt_list::elt, cselib_val_struct::hash, cselib_val_struct::locs, new_cselib_val(), elt_list::next, next_uid, promote_debug_loc(), cselib_val_struct::val_rtx, and wrap_constant().
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 | ( | ) |
Test whether a value is preserved.
References cselib_val_struct::val_rtx.
Referenced by add_stores(), add_uses(), prepare_call_arguments(), reverse_op(), use_type(), val_store(), vt_expand_var_loc_chain(), and vt_initialize().
void cselib_process_insn | ( | ) |
Record the effects of INSN.
References cselib_current_insn, cselib_invalidate_mem(), cselib_invalidate_regno(), cselib_invalidate_rtx(), cselib_preserve_constants, cselib_preserve_only_values(), cselib_record_sets(), cselib_reset_table(), hash_table< Descriptor, Allocator >::elements(), find_reg_note(), fp_setter_insn(), n_debug_values, n_useless_values, next_uid, reload_completed, remove_useless_values(), and volatile_insn_p().
Referenced by deps_analyze_insn(), dse_step1(), local_cprop_pass(), reload_cse_regs_1(), thread_jump(), and vt_initialize().
|
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 |
Referenced by cselib_record_sets().
|
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 |
Referenced by cselib_process_insn().
|
static |
Record the effects of any sets and autoincs in INSN.
References asm_noperands(), cselib_invalidate_rtx(), cselib_invalidate_rtx_note_stores(), cselib_lookup(), cselib_record_autoinc_cb(), cselib_record_memory, cselib_record_set(), cselib_record_sets_hook, cselib_set::dest, cselib_set::dest_addr_elt, find_reg_equal_equiv_note(), for_each_inc_dec(), get_address_mode(), cselib_record_autoinc_data::n_sets, note_stores(), pc_rtx, rtx_equal_p(), SET, cselib_record_autoinc_data::sets, cselib_set::src, and cselib_set::src_elt.
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_reset_table | ( | ) |
Remove all entries from the hash table, arranging for the next value to be numbered NUM.
References cfa_base_preserved_regno, cselib_any_perm_equivs, cselib_preserve_constants, dummy_val, hash_table< Descriptor, Allocator >::empty(), first_containing_mem, max_value_regs, n_debug_values, n_used_regs, n_useless_debug_values, n_useless_values, next_uid, preserve_constants_and_equivs(), hash_table< Descriptor, Allocator >::traverse(), and used_regs.
Referenced by cselib_clear_table(), cselib_process_insn(), and vt_initialize().
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 | ( | ) |
If X is a value with no locations, remove it from the hashtable.
References hash_table< Descriptor, Allocator >::clear_slot(), cselib_discard_hook, cselib_val_struct::locs, n_useless_values, unchain_one_value(), and cselib_val_struct::val_rtx.
Referenced by remove_useless_values().
void dump_cselib_table | ( | ) |
Dump to OUT everything in the CSELIB table.
References dump_cselib_val(), first_containing_mem, next_uid, print_inline_rtx(), hash_table< Descriptor, Allocator >::traverse(), and cselib_val_struct::val_rtx.
Referenced by vt_initialize().
int dump_cselib_val | ( | ) |
Dump the cselib_val *X to FILE *OUT.
References cselib_val_struct::addr_list, elt_list::elt, elt_loc_list::loc, cselib_val_struct::locs, elt_loc_list::next, elt_list::next, cselib_val_struct::next_containing_mem, print_inline_rtx(), elt_loc_list::setting_insn, and cselib_val_struct::val_rtx.
Referenced by dump_cselib_table().
|
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 |
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 |
Referenced by cselib_lookup_1(), cselib_lookup_mem(), and cselib_subst_to_values().
|
inlinestatic |
Create a new value structure for VALUE and initialize it. The mode of the value is MODE.
References cselib_val_struct::addr_list, dump_file, dump_flags, flag_dump_unnumbered, cselib_val_struct::hash, cselib_val_struct::locs, memset(), cselib_val_struct::next_containing_mem, next_uid, pool_alloc(), print_rtl_single(), cselib_val_struct::uid, and cselib_val_struct::val_rtx.
|
staticread |
Referenced by add_mem_for_addr(), cselib_lookup_1(), and cselib_record_set().
|
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 |
Referenced by add_mem_for_addr(), cselib_add_permanent_equiv(), cselib_lookup_1(), cselib_record_set(), and new_elt_loc_list().
|
inlinestatic |
Allocate a struct elt_loc_list with LOC and prepend it to VAL's loc list.
References cselib_val_struct::addr_list, canonical_cselib_val(), cselib_current_insn, last, elt_loc_list::loc, cselib_val_struct::locs, n_debug_values, new_elt_loc_list(), elt_loc_list::next, elt_list::next, cselib_val_struct::next_containing_mem, pool_alloc(), elt_loc_list::setting_insn, cselib_val_struct::uid, and cselib_val_struct::val_rtx.
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().
|
inlinestatic |
Referenced by add_mem_for_addr(), cselib_lookup_1(), cselib_lookup_mem(), and cselib_hasher::equal().
|
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 |
Clean out useless values (i.e. those which no longer have locations associated with them) from the hash table.
References canonical_cselib_val(), discard_useless_locs(), discard_useless_values(), dummy_val, first_containing_mem, cselib_val_struct::locs, n_debug_values, n_useless_debug_values, n_useless_values, cselib_val_struct::next_containing_mem, and hash_table< Descriptor, Allocator >::traverse().
Referenced by cselib_preserve_only_values(), and cselib_process_insn().
Referenced by cselib_hasher::equal(), rtx_equal_for_cselib_1(), and rtx_equal_for_cselib_p().
|
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 |
Referenced by cselib_invalidate_mem(), cselib_invalidate_regno(), and unchain_one_value().
|
inlinestatic |
The elt_list at *PL is no longer needed. Unchain it and free its storage.
References elt_list::next, and pool_free().
|
static |
Referenced by cselib_invalidate_mem(), cselib_invalidate_regno(), and discard_useless_locs().
|
static |
Likewise for elt_loc_lists.
References elt_loc_list::next, and pool_free().
|
static |
Referenced by discard_useless_values().
|
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 |
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().
|
static |
We pass this to cselib_invalidate_mem to invalidate all of memory for a non-const call instruction.
|
static |
|
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.
|
static |
|
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().
|
static |
A table that enables us to look up elts by their value.
|
static |
The number of registers we had when the varrays were last resized.
Referenced by cselib_init().
|
static |
|
static |
Referenced by cselib_init(), cselib_lookup_mem(), cselib_record_set(), and cselib_record_sets().
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().
|
static |
|
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().
|
static |
|
static |
|
static |
See the documentation of cselib_find_slot below.
Referenced by cselib_find_slot(), and cselib_hasher::equal().
|
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().
|
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().
|
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().
|
static |
Referenced by cselib_init(), cselib_lookup_1(), cselib_record_set(), and cselib_reset_table().
|
static |
|
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().
|
static |
The unique id that the next create value will take.
Referenced by cselib_finish(), cselib_get_next_uid(), cselib_init(), cselib_lookup_1(), cselib_lookup_mem(), cselib_process_insn(), cselib_reset_table(), cselib_subst_to_values(), dump_cselib_table(), and new_cselib_val().
|
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.
|
static |
Referenced by cselib_init().
|
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().
|
static |
|
static |
Set by discard_useless_locs if it deleted the last location of any value.