GCC Middle and Back End API Reference
|
Data Structures | |
struct | micro_operation_def |
struct | attrs_def |
struct | location_chain_def |
struct | loc_exp_dep_s |
struct | expand_depth_struct |
struct | onepart_aux |
struct | variable_part_def |
union | variable_part_def::variable_aux |
struct | variable_def |
struct | variable_hasher |
struct | emit_note_data_def |
struct | shared_hash_def |
struct | dataflow_set_def |
struct | variable_tracking_info_def |
struct | parm_reg |
struct | adjust_mem_data |
struct | overlapping_mems |
struct | variable_union_info |
struct | dfset_merge |
struct | dfset_post_merge |
struct | count_use_info |
struct | expand_loc_callback_data |
Typedefs | |
typedef struct micro_operation_def | micro_operation |
typedef void * | decl_or_value |
typedef struct attrs_def * | attrs |
typedef struct location_chain_def * | location_chain |
typedef struct loc_exp_dep_s | loc_exp_dep |
typedef struct expand_depth_struct | expand_depth |
typedef struct variable_part_def | variable_part |
typedef enum onepart_enum | onepart_enum_t |
typedef struct variable_def * | variable |
typedef struct variable_def * | const_variable |
typedef unsigned int | dvuid |
typedef hash_table < variable_hasher > | variable_table_type |
typedef variable_table_type::iterator | variable_iterator_type |
typedef struct emit_note_data_def | emit_note_data |
typedef struct shared_hash_def * | shared_hash |
typedef struct dataflow_set_def | dataflow_set |
typedef struct variable_tracking_info_def * | variable_tracking_info |
typedef struct parm_reg | parm_reg_t |
Enumerations | |
enum | micro_operation_type { MO_USE, MO_USE_NO_VAR, MO_VAL_USE, MO_VAL_LOC, MO_VAL_SET, MO_SET, MO_COPY, MO_CLOBBER, MO_CALL, MO_ADJUST } |
enum | emit_note_where { EMIT_NOTE_BEFORE_INSN, EMIT_NOTE_AFTER_INSN, EMIT_NOTE_AFTER_CALL_INSN } |
enum | onepart_enum { NOT_ONEPART = 0, ONEPART_VDECL = 1, ONEPART_DEXPR = 2, ONEPART_VALUE = 3 } |
Variables | |
char | check_value_val [(int) VALUE==(int) IDENTIFIER_NODE?1:-1] |
static const char *const | micro_operation_type_name [] |
static alloc_pool | attrs_pool |
static alloc_pool | var_pool |
static alloc_pool | valvar_pool |
static alloc_pool | loc_chain_pool |
static alloc_pool | shared_hash_pool |
static alloc_pool | loc_exp_dep_pool |
static variable_table_type | changed_variables |
static bool | emit_notes |
static variable_table_type | dropped_values |
static shared_hash | empty_shared_hash |
static bitmap | scratch_regs = NULL |
static vec< parm_reg_t, va_gc > * | windowed_parm_regs = NULL |
static bool | cselib_hook_called |
static rtx | cfa_base_rtx |
static HOST_WIDE_INT | cfa_base_offset |
static HOST_WIDE_INT | hard_frame_pointer_adjustment = -1 |
static bool | dst_can_be_shared |
static struct pointer_map_t * | global_get_addr_cache |
static struct pointer_map_t * | local_get_addr_cache |
static struct variable_union_info * | vui_vec |
static int | vui_allocated |
static vec< rtx > | preserved_values |
static rtx | call_arguments |
static int | debug_label_num = 1 |
Description of location of a part of a variable. The content of a physical register is described by a chain of these structures. The chains are pretty short (usually 1 or 2 elements) and thus chain is the best data structure.
typedef struct variable_def* const_variable |
typedef struct dataflow_set_def dataflow_set |
Structure holding the IN or OUT set for a basic block.
typedef void* decl_or_value |
A declaration of a variable, or an RTL value being handled like a declaration.
typedef unsigned int dvuid |
typedef struct emit_note_data_def emit_note_data |
Structure for passing some other parameters to function emit_note_insn_var_location.
typedef struct expand_depth_struct expand_depth |
This data structure holds information about the depth of a variable expansion.
typedef struct loc_exp_dep_s loc_exp_dep |
A vector of loc_exp_dep holds the active dependencies of a one-part DV on VALUEs, i.e., the VALUEs expanded so as to form the current location of DV. Each entry is also part of VALUE' s linked-list of backlinks back to DV.
typedef struct location_chain_def * location_chain |
Structure for chaining the locations.
typedef struct micro_operation_def micro_operation |
Structure holding information about micro operation.
typedef enum onepart_enum onepart_enum_t |
Enumeration type used to discriminate various types of one-part variables.
typedef struct parm_reg parm_reg_t |
typedef struct shared_hash_def * shared_hash |
Structure holding a refcounted hash table. If refcount > 1, it must be first unshared before modified.
typedef struct variable_def * variable |
Structure describing where the variable is located.
typedef variable_table_type::iterator variable_iterator_type |
typedef struct variable_part_def variable_part |
Structure describing one part of variable.
typedef hash_table<variable_hasher> variable_table_type |
typedef struct variable_tracking_info_def * variable_tracking_info |
The structure (one for each basic block) containing the information needed for variable tracking.
enum emit_note_where |
enum micro_operation_type |
enum onepart_enum |
Referenced by add_with_sets().
|
static |
Add stores (register and memory references) LOC which will be tracked to VTI (bb)->mos. EXPR is the RTL expression containing the store. CUIP->insn is instruction which the LOC is part of.
References count_use_info::bb, cfa_base_rtx, cselib_lookup(), cselib_preserved_value_p(), cselib_set_value_sp_based(), dump_file, dump_flags, find_use_val(), get_address_mode(), hard_frame_pointer_adjustment, micro_operation_def::insn, count_use_info::insn, micro_operation_def::loc, log_op_type(), MO_CLOBBER, MO_COPY, MO_SET, MO_USE, MO_VAL_SET, MO_VAL_USE, preserve_value(), replace_expr_with_values(), reverse_op(), same_variable_part_p(), SET, count_use_info::sets, micro_operation_def::type, micro_operation_def::u, unsuitable_loc(), cselib_val_struct::val_rtx, and var_lowpart().
|
static |
Referenced by add_uses_1().
|
static |
Add uses (register and memory references) LOC which will be tracked to VTI (bb)->mos. INSN is instruction which the LOC is part of.
References count_use_info::bb, cselib_lookup(), cselib_preserved_value_p(), dump_file, dump_flags, find_use_val(), for_each_rtx(), get_address_mode(), micro_operation_def::insn, count_use_info::insn, micro_operation_def::loc, log_op_type(), MO_CLOBBER, MO_USE, MO_USE_NO_VAR, MO_VAL_LOC, MO_VAL_USE, non_suitable_const(), preserve_value(), replace_expr_with_values(), count_use_info::sets, micro_operation_def::type, type(), micro_operation_def::u, unsuitable_loc(), cselib_val_struct::val_rtx, and var_lowpart().
|
static |
Referenced by add_with_sets().
|
static |
Helper function for finding all uses of REG/MEM in X in insn INSN.
References add_uses(), and for_each_rtx().
|
static |
Callback for cselib_record_sets_hook, that records as micro operations uses and stores in an insn after cselib_record_sets has analyzed the sets in an insn, but before it modifies the stored values in the internal tables, unless cselib_record_sets doesn't call it directly (perhaps because we're not doing cselib in the first place, in which case sets and n_sets will be 0).
References add_stores(), add_uses_1(), count_use_info::bb, call_arguments, cselib_hook_called, dump_file, dump_flags, micro_operation_def::insn, count_use_info::insn, micro_operation_def::loc, log_op_type(), MO_CALL, MO_CLOBBER, MO_USE, MO_VAL_LOC, MO_VAL_USE, count_use_info::n_sets, note_stores(), note_uses(), count_use_info::sets, count_use_info::store_p, micro_operation_def::type, and micro_operation_def::u.
Referenced by vt_initialize().
|
static |
Simplify INSN. Remove all {PRE,POST}_{INC,DEC,MODIFY} rtxes, replace them with their value in the insn and add the side-effects as other sets to the insn.
References adjust_mem_stores(), adjust_mem_uses(), asm_noperands(), find_reg_equal_equiv_note(), find_reg_note(), free_EXPR_LIST_list(), gen_raw_REG(), parm_reg::incoming, adjust_mem_data::mem_mode, note_stores(), note_uses(), parm_reg::outgoing, rtvec_alloc(), SET, adjust_mem_data::side_effects, adjust_mem_data::stack_adjust, adjust_mem_data::store, validate_change(), vec_safe_length(), and windowed_parm_regs.
Referenced by vt_initialize().
|
static |
Helper function for replacement of stores.
References adjust_mems(), simplify_replace_fn_rtx(), and validate_change().
Referenced by adjust_insn().
|
static |
Helper function for replacement of uses.
References adjust_mems(), simplify_replace_fn_rtx(), and validate_change().
Referenced by adjust_insn().
|
static |
Helper function for adjusting used MEMs.
References alloc_EXPR_LIST(), avoid_constant_pool_reference(), cfa_base_rtx, compute_cfa_pointer(), for_each_rtx(), hard_frame_pointer_adjustment, adjust_mem_data::mem_mode, replace_equiv_address_nv(), adjust_mem_data::side_effects, simplify_gen_subreg(), simplify_replace_fn_rtx(), adjust_mem_data::stack_adjust, adjust_mem_data::store, subreg_lowpart_p(), targetm, use_narrower_mode(), and use_narrower_mode_test().
Referenced by adjust_mem_stores(), adjust_mem_uses(), and prepare_call_arguments().
|
static |
Referenced by attrs_list_copy(), dataflow_set_clear(), and dataflow_set_destroy().
|
static |
Make the list *LISTP empty.
References attrs_pool, attrs_def::next, and pool_free().
Referenced by dataflow_set_copy().
|
static |
Copy all nodes from SRC and create a list *DSTP of the copies.
References attrs_list_clear(), attrs_pool, attrs_def::dv, attrs_def::loc, attrs_def::next, attrs_def::offset, and pool_alloc().
|
static |
Insert the triplet DECL, OFFSET, LOC to the list *LISTP.
References attrs_pool, attrs_def::dv, variable_def::dv, attrs_def::loc, attrs_def::next, attrs_def::offset, offset, and pool_alloc().
Referenced by attrs_list_mpdv_union(), attrs_list_union(), var_reg_decl_set(), variable_merge_over_cur(), variable_post_merge_perm_vals(), and vt_add_function_parameter().
|
static |
Referenced by attrs_list_mpdv_union(), and attrs_list_union().
|
static |
Return true if the pair of DECL and OFFSET is the member of the LIST.
References attrs_def::dv, dv_as_opaque(), attrs_def::next, and attrs_def::offset.
|
static |
Combine nodes that are not onepart nodes from SRC and SRC2 into *DSTP.
References attrs_list_insert(), attrs_list_member(), attrs_def::dv, dv_onepart_p(), attrs_def::loc, attrs_def::next, and attrs_def::offset.
Referenced by dataflow_set_merge().
Referenced by dataflow_set_union().
|
static |
Add all nodes from SRC which are not in *DSTP to *DSTP.
References attrs_list_insert(), attrs_list_member(), attrs_def::dv, attrs_def::loc, attrs_def::next, and attrs_def::offset.
|
inlinestatic |
Return true if TVAL is better than CVAL as a canonival value. We choose lowest-numbered VALUEs, using the RTX address as a tie-breaker. The idea is to arrange them into a star topology, such that all of them are at most one step away from the canonical value, and the canonical value has backlinks to all of them, in addition to all the actual locations. We don't enforce this topology throughout the entire dataflow analysis, though.
int canonicalize_loc_order_check | ( | variable_def ** | slot, |
dataflow_set * | data | ||
) |
Check the order of entries in one-part variables.
References location_chain_def::loc, loc_cmp(), variable_def::n_var_parts, and location_chain_def::next.
Referenced by compute_bb_dataflow(), and vt_find_locations().
int canonicalize_values_mark | ( | ) |
Mark with VALUE_RECURSED_INTO values that have neighbors that are more likely to be chosen as canonical for an equivalence set. Ensure less likely values can reach more likely neighbors, making the connections bidirectional.
References canon_value_cmp(), variable_def::dv, dv_as_value(), dv_from_value(), dv_is_value_p(), location_chain_def::init, location_chain_def::loc, variable_def::n_var_parts, location_chain_def::next, set_slot_part(), and shared_hash_find_slot_noinsert().
Referenced by compute_bb_dataflow().
int canonicalize_values_star | ( | ) |
Remove redundant entries from equivalence lists in onepart variables, canonicalizing equivalence sets into star shapes.
References attrs_pool, canon_value_cmp(), clobber_slot_part(), clobber_variable_part(), attrs_def::dv, variable_def::dv, dv_as_opaque(), dv_as_value(), dv_from_value(), dv_is_decl_p(), dv_is_value_p(), location_chain_def::init, location_chain_def::loc, variable_def::n_var_parts, attrs_def::next, location_chain_def::next, attrs_def::offset, pool_free(), set_slot_part(), set_variable_part(), shared_hash_find_slot_noinsert(), and VAR_INIT_STATUS_INITIALIZED.
Referenced by compute_bb_dataflow(), dataflow_post_merge_adjust(), dataflow_set_equiv_regs(), and variable_merge_over_cur().
int canonicalize_vars_star | ( | ) |
Bind one-part variables to the canonical value in an equivalence set. Not doing this causes dataflow convergence failure in rare circumstances, see PR42873. Unfortunately we can't do this efficiently as part of canonicalize_values_star, since we may not have determined or even seen the canonical value of a set when we get to a variable that references another member of the set.
References canon_value_cmp(), clobber_slot_part(), variable_def::dv, dv_from_value(), location_chain_def::init, location_chain_def::loc, variable_def::n_var_parts, location_chain_def::next, ONEPART_VALUE, set_slot_part(), location_chain_def::set_src, and shared_hash_find_slot_noinsert().
Referenced by dataflow_post_merge_adjust().
|
static |
Remove from SET all VALUE bindings to MEMs that overlap with LOC.
References overlapping_mems::addr, canon_rtx(), drop_overlapping_mem_locs(), overlapping_mems::loc, overlapping_mems::set, shared_hash_htab(), hash_table< Descriptor, Allocator >::traverse(), and vt_canonicalize_addr().
Referenced by compute_bb_dataflow(), emit_notes_in_bb(), val_bind(), var_mem_delete(), and var_mem_delete_and_set().
|
static |
Remove all recorded register locations for the given variable part from dataflow set SET, except for those that are identical to loc. The variable part is specified by variable's declaration or value DV and offset OFFSET.
References attrs_pool, delete_slot_part(), attrs_def::dv, variable_def::dv, dv_as_opaque(), find_variable_location_part(), location_chain_def::loc, attrs_def::next, location_chain_def::next, attrs_def::offset, pool_free(), rtx_equal_p(), and location_chain_def::set_src.
Referenced by canonicalize_values_star(), canonicalize_vars_star(), and clobber_variable_part().
|
static |
Remove all recorded register locations for the given variable part from dataflow set SET, except for those that are identical to loc. The variable part is specified by variable's declaration or value DV and offset OFFSET.
References clobber_slot_part(), dv_as_decl(), dv_as_opaque(), dv_is_value_p(), and shared_hash_find_slot_noinsert().
Referenced by canonicalize_values_star(), compute_bb_dataflow(), emit_notes_in_bb(), val_reset(), var_mem_delete(), var_mem_delete_and_set(), var_reg_delete(), and var_reg_delete_and_set().
|
static |
Referenced by vt_find_locations().
|
static |
Compute the changes of variable locations in the basic block BB.
References micro_operation_def::adjust, canonicalize_loc_order_check(), canonicalize_values_mark(), canonicalize_values_star(), changed, clobber_overlapping_mems(), clobber_variable_part(), dataflow_set_clear_at_call(), dataflow_set_copy(), dataflow_set_destroy(), dataflow_set_different(), dataflow_set_equiv_regs(), dataflow_set_init(), dv_from_decl(), find_src_set_src(), find_src_status(), micro_operation_def::insn, count_use_info::insn, micro_operation_def::loc, local_get_addr_cache, MO_ADJUST, MO_CALL, MO_CLOBBER, MO_COPY, MO_SET, MO_USE, MO_USE_NO_VAR, MO_VAL_LOC, MO_VAL_SET, MO_VAL_USE, pointer_map_create(), pointer_map_destroy(), SET, set_variable_part(), shared_hash_htab(), dataflow_set_def::stack_adjust, hash_table< Descriptor, Allocator >::traverse(), micro_operation_def::type, micro_operation_def::u, val_resolve(), val_store(), VAR_INIT_STATUS_INITIALIZED, VAR_INIT_STATUS_UNINITIALIZED, VAR_INIT_STATUS_UNKNOWN, var_mem_delete(), var_mem_delete_and_set(), var_mem_set(), var_reg_delete(), var_reg_delete_and_set(), var_reg_set(), var_regno_delete(), and dataflow_set_def::vars.
|
inlinestatic |
Compute a CFA-based value for an ADJUSTMENT made to stack_pointer_rtx or hard_frame_pointer_rtx.
References cfa_base_offset, cfa_base_rtx, and plus_constant().
Referenced by adjust_mems().
|
static |
Referenced by contains_symbol_ref(), and track_expr_p().
|
static |
Return true if RTL X contains a SYMBOL_REF.
References contains_symbol_ref().
|
static |
Just checking stuff and registering register attributes for now.
References canonicalize_values_star(), canonicalize_vars_star(), dfset_post_merge::permp, dfset_post_merge::set, shared_hash_htab(), hash_table< Descriptor, Allocator >::traverse(), variable_post_merge_new_vals(), and variable_post_merge_perm_vals().
Referenced by vt_find_locations().
|
static |
Referenced by emit_notes_in_bb(), vt_emit_notes(), and vt_find_locations().
|
static |
Delete the contents of dataflow set SET.
References attrs_list_clear(), empty_shared_hash, shared_hash_copy(), and shared_hash_destroy().
|
static |
Remove all variable-location information about call-clobbered registers, as well as associations between MEMs and VALUEs.
References dataflow_set_preserve_mem_locs(), dataflow_set_remove_mem_locs(), shared_hash_htab(), hash_table< Descriptor, Allocator >::traverse(), and var_regno_delete().
Referenced by compute_bb_dataflow(), and emit_notes_in_bb().
|
static |
Referenced by compute_bb_dataflow(), emit_notes_in_bb(), and vt_find_locations().
|
static |
Copy the contents of dataflow set SRC to DST.
References attrs_list_copy(), dataflow_set_def::regs, shared_hash_copy(), shared_hash_destroy(), dataflow_set_def::stack_adjust, and dataflow_set_def::vars.
|
static |
Referenced by compute_bb_dataflow(), dataflow_set_merge(), vt_emit_notes(), and vt_finalize().
|
static |
Free the contents of dataflow set SET.
References attrs_list_clear(), and shared_hash_destroy().
|
static |
Referenced by compute_bb_dataflow().
|
static |
Return true if dataflow sets OLD_SET and NEW_SET differ.
References dump_file, dump_flags, dump_var(), variable_def::dv, dv_htab_hash(), hash_table< Descriptor, Allocator >::elements(), hash_table< Descriptor, Allocator >::find_with_hash(), shared_hash_htab(), variable_different_p(), and dataflow_set_def::vars.
|
static |
Mark register equivalences.
References canon_value_cmp(), canonicalize_values_star(), attrs_def::dv, dv_as_value(), dv_from_value(), dv_is_value_p(), dv_onepart_p(), attrs_def::loc, memset(), attrs_def::next, attrs_def::offset, set_variable_part(), shared_hash_find_slot_noinsert(), and VAR_INIT_STATUS_INITIALIZED.
Referenced by compute_bb_dataflow().
|
static |
Referenced by compute_bb_dataflow(), dataflow_set_merge(), variable_post_merge_new_vals(), vt_emit_notes(), and vt_initialize().
|
static |
Initialize dataflow set SET to be empty. VARS_SIZE is the initial size of hash table VARS.
References empty_shared_hash, init_attrs_list_set(), and shared_hash_copy().
|
static |
Combine dataflow set information from SRC2 into DST, using PDST to carry over information across passes.
References attrs_list_mpdv_union(), hash_table< Descriptor, Allocator >::create(), dfset_merge::cur, dataflow_set_destroy(), dataflow_set_init(), dfset_merge::dst, dst_can_be_shared, hash_table< Descriptor, Allocator >::elements(), shared_hash_def::htab, pool_alloc(), shared_hash_def::refcount, dataflow_set_def::regs, shared_hash_destroy(), shared_hash_htab(), shared_hash_pool, dfset_merge::src, dfset_merge::src_onepart_cnt, dataflow_set_def::stack_adjust, variable_merge_over_cur(), variable_merge_over_src(), and dataflow_set_def::vars.
Referenced by vt_find_locations().
int dataflow_set_preserve_mem_locs | ( | ) |
Remove all MEMs from the location list of a hash table entry for a one-part variable, except those whose MEM attributes map back to the variable itself, directly or within a VALUE.
References changed, variable_def::dv, dv_as_decl(), emit_notes, find_mem_expr_in_1pdv(), location_chain_def::init, location_chain_def::loc, loc_chain_pool, mem_dies_at_call(), variable_def::n_var_parts, location_chain_def::next, ONEPART_DEXPR, ONEPART_VDECL, pool_free(), location_chain_def::set_src, shared_hash_htab(), shared_var_p(), unshare_variable(), VAR_INIT_STATUS_UNKNOWN, and variable_was_changed().
Referenced by dataflow_set_clear_at_call().
int dataflow_set_remove_mem_locs | ( | ) |
Remove all MEMs from the location list of a hash table entry for a value.
References changed, location_chain_def::loc, loc_chain_pool, mem_dies_at_call(), variable_def::n_var_parts, location_chain_def::next, ONEPART_VALUE, pool_free(), shared_var_p(), unshare_variable(), VAR_INIT_STATUS_UNKNOWN, and variable_was_changed().
Referenced by dataflow_set_clear_at_call().
|
static |
Referenced by vt_find_locations().
|
static |
Compute union of dataflow sets SRC and DST and store it to DST.
References attrs_list_union(), empty_shared_hash, dataflow_set_def::regs, shared_hash_copy(), shared_hash_destroy(), shared_hash_htab(), variable_union(), and dataflow_set_def::vars.
void debug_dv | ( | decl_or_value | dv | ) |
DEBUG_FUNCTION void debug_dv | ( | ) |
References debug_generic_stmt(), debug_rtx(), dv_as_decl(), dv_as_value(), and dv_is_value_p().
|
static |
Get rid of all debug insns from the insn stream.
References debug_label_num, and delete_insn().
Referenced by variable_tracking_main_1(), and vt_debug_insns_local().
|
static |
Delete the part of variable's location from dataflow set SET. The variable part is specified by its SET->vars slot SLOT and offset OFFSET and the part's location by LOC.
References changed, find_variable_location_part(), location_chain_def::loc, loc_chain_pool, variable_def::n_var_parts, location_chain_def::next, pool_free(), rtx_equal_p(), shared_var_p(), unshare_variable(), VAR_INIT_STATUS_UNKNOWN, and variable_was_changed().
Referenced by clobber_slot_part(), delete_variable_part(), and variable_merge_over_cur().
|
static |
Delete the part of variable's location from dataflow set SET. The variable part is specified by variable's declaration or value DV and offset OFFSET and the part's location by LOC.
References delete_slot_part(), and shared_hash_find_slot_noinsert().
Referenced by val_reset(), var_mem_delete(), var_reg_delete(), var_reg_delete_and_set(), and var_regno_delete().
int drop_overlapping_mem_locs | ( | ) |
Remove all MEMs that overlap with COMS->LOC from the location list of a hash table entry for a value. COMS->ADDR must be a canonicalized form of COMS->LOC's address, and COMS->LOC must be canonicalized itself.
References overlapping_mems::addr, changed, location_chain_def::loc, overlapping_mems::loc, loc_chain_pool, variable_def::n_var_parts, location_chain_def::next, ONEPART_VALUE, pool_free(), overlapping_mems::set, shared_var_p(), unshare_variable(), VAR_INIT_STATUS_UNKNOWN, variable_was_changed(), and vt_canon_true_dep().
Referenced by clobber_overlapping_mems().
|
static |
Referenced by dump_dataflow_set().
|
static |
Print the content of the LIST to dump file.
References dump_file, attrs_def::dv, dv_as_decl(), dv_as_value(), dv_is_decl_p(), HOST_WIDE_INT_PRINT_DEC, attrs_def::next, attrs_def::offset, print_mem_expr(), and print_rtl_single().
|
static |
Referenced by dump_dataflow_sets(), and vt_find_locations().
|
static |
Print the dataflow set SET to dump file.
References dump_attrs_list(), dump_file, dump_vars(), HOST_WIDE_INT_PRINT_DEC, and shared_hash_htab().
|
static |
Print the IN and OUT sets for each basic block to dump file.
References count_use_info::bb, dump_dataflow_set(), dump_file, and basic_block_def::index.
Referenced by variable_tracking_main_1().
|
static |
Referenced by dataflow_set_different(), and dump_var_tracking_slot().
|
static |
Print the information about variable VAR to dump file.
References dump_file, dump_flags, variable_def::dv, dv_as_decl(), dv_as_value(), dv_is_decl_p(), location_chain_def::init, location_chain_def::loc, variable_def::n_var_parts, location_chain_def::next, print_rtl_single(), and VAR_INIT_STATUS_UNINITIALIZED.
int dump_var_tracking_slot | ( | ) |
Print the information about variable *SLOT to dump file.
References dump_var().
Referenced by dump_vars().
|
static |
Referenced by dump_dataflow_set().
|
static |
Print the information about variables from hash table VARS to dump file.
References dump_file, dump_var_tracking_slot(), hash_table< Descriptor, Allocator >::elements(), and hash_table< Descriptor, Allocator >::traverse().
|
inlinestatic |
Return the decl in the decl_or_value.
References dv_is_decl_p().
Referenced by clobber_variable_part(), dataflow_set_preserve_mem_locs(), debug_dv(), dump_attrs_list(), dump_var(), dv_as_rtx(), dv_changed_p(), dv_onepart_p(), dv_uid(), emit_note_insn_var_location(), set_dv_changed(), set_slot_part(), var_mem_decl_set(), var_reg_decl_set(), and var_track_values_to_stack().
|
inlinestatic |
Return the opaque pointer in the decl_or_value.
Referenced by attrs_list_member(), canonicalize_values_star(), clobber_slot_part(), clobber_variable_part(), variable_hasher::equal(), find_loc_in_1pdv(), set_slot_part(), var_reg_decl_set(), var_reg_delete_and_set(), variable_different_p(), and variable_post_merge_new_vals().
|
inlinestatic |
Return the DEBUG_EXPR of a DEBUG_EXPR_DECL or the VALUE in DV.
References dv_as_decl(), dv_as_value(), and dv_is_value_p().
Referenced by notify_dependents_of_changed_value().
|
inlinestatic |
Return the value in the decl_or_value.
References dv_is_value_p().
Referenced by canonicalize_values_mark(), canonicalize_values_star(), dataflow_set_equiv_regs(), debug_dv(), dump_attrs_list(), dump_var(), dv_as_rtx(), dv_changed_p(), dv_uid(), find_loc_in_1pdv(), notify_dependents_of_resolved_value(), set_dv_changed(), val_reset(), val_resolve(), var_track_values_to_stack(), variable_merge_over_cur(), variable_post_merge_new_vals(), variable_post_merge_perm_vals(), vt_add_function_parameter(), and vt_expand_var_loc_chain().
|
inlinestatic |
Return true if DV needs to have its cur_loc recomputed.
References dv_as_decl(), dv_as_value(), and dv_is_value_p().
Referenced by notify_dependents_of_changed_value(), notify_dependents_of_resolved_value(), resolve_expansions_pending_recursion(), vt_expand_1pvar(), and vt_expand_loc_callback().
|
inlinestatic |
Build a decl_or_value out of a decl.
References variable_def::dv, and dv_is_decl_p().
Referenced by compute_bb_dataflow(), dv_from_rtx(), emit_notes_in_bb(), find_src_set_src(), find_src_status(), var_mem_decl_set(), var_mem_delete(), var_mem_delete_and_set(), var_mem_set(), var_reg_decl_set(), var_reg_delete(), var_reg_delete_and_set(), var_reg_set(), and vt_add_function_parameter().
|
inlinestatic |
Return a value or the decl of a debug_expr as a decl_or_value.
References variable_def::dv, dv_from_decl(), and dv_from_value().
Referenced by get_addr_from_local_cache(), loc_exp_insert_dep(), notify_dependents_of_changed_value(), remove_value_from_changed_variables(), resolve_expansions_pending_recursion(), and vt_expand_loc_callback().
|
inlinestatic |
Build a decl_or_value out of a value.
References variable_def::dv, and dv_is_value_p().
Referenced by canonicalize_values_mark(), canonicalize_values_star(), canonicalize_vars_star(), dataflow_set_equiv_regs(), dv_from_rtx(), find_loc_in_1pdv(), find_mem_expr_in_1pdv(), intersect_loc_chains(), val_bind(), val_reset(), val_resolve(), variable_merge_over_cur(), variable_post_merge_new_vals(), and vt_add_function_parameter().
|
inlinestatic |
The hash function for a mask table in a shared_htab chain.
References dv_uid(), and dv_uid2hash().
Referenced by dataflow_set_different(), emit_notes_for_differences_1(), emit_notes_for_differences_2(), find_loc_in_1pdv(), find_mem_expr_in_1pdv(), variable_hasher::hash(), loc_exp_insert_dep(), notify_dependents_of_changed_value(), notify_dependents_of_resolved_value(), remove_value_from_changed_variables(), shared_hash_find(), shared_hash_find_slot(), shared_hash_find_slot_noinsert(), shared_hash_find_slot_unshare(), unshare_variable(), variable_from_dropped(), variable_merge_over_cur(), variable_was_changed(), vars_copy(), and vt_expand_loc_callback().
|
inlinestatic |
Return true if a decl_or_value DV is a DECL or NULL.
Referenced by canonicalize_values_star(), dump_attrs_list(), dump_var(), dv_as_decl(), dv_from_decl(), dv_is_value_p(), var_mem_decl_set(), var_reg_decl_set(), and variable_post_merge_new_vals().
|
inlinestatic |
Return true if a decl_or_value is a VALUE rtl.
References dv_is_decl_p().
Referenced by canonicalize_values_mark(), canonicalize_values_star(), clobber_variable_part(), dataflow_set_equiv_regs(), debug_dv(), dv_as_rtx(), dv_as_value(), dv_changed_p(), dv_from_value(), dv_onepart_p(), dv_uid(), find_loc_in_1pdv(), notify_dependents_of_resolved_value(), val_resolve(), variable_merge_over_cur(), variable_post_merge_new_vals(), variable_post_merge_perm_vals(), and vt_add_function_parameter().
|
inlinestatic |
Return nonzero if a decl_or_value must not have more than one variable part. The returned value discriminates among various kinds of one-part DVs ccording to enum onepart_enum.
References dv_as_decl(), dv_is_value_p(), NOT_ONEPART, ONEPART_DEXPR, ONEPART_VALUE, ONEPART_VDECL, and target_for_debug_bind().
Referenced by attrs_list_mpdv_union(), dataflow_set_equiv_regs(), notify_dependents_of_changed_value(), notify_dependents_of_resolved_value(), set_dv_changed(), set_slot_part(), var_reg_delete(), and variable_from_dropped().
|
inlinestatic |
Return the uid of DV.
References dv_as_decl(), dv_as_value(), and dv_is_value_p().
Referenced by dv_htab_hash().
|
inlinestatic |
Compute the hash from the uid.
Referenced by dv_htab_hash().
int emit_note_insn_var_location | ( | ) |
Emit the NOTE_INSN_VAR_LOCATION for variable *VARP. DATA contains additional parameters: WHERE specifies whether the note shall be emitted before or after instruction INSN.
References changed_variables, hash_table< Descriptor, Allocator >::clear_slot(), variable_def::dv, dv_as_decl(), emit_note_after(), EMIT_NOTE_AFTER_CALL_INSN, emit_note_before(), EMIT_NOTE_BEFORE_INSN, end_hard_regno(), gen_rtvec_v(), HOST_WIDE_INT, location_chain_def::init, initialized, emit_note_data_def::insn, location_chain_def::loc, loc_exp_insert_dep(), variable_def::n_var_parts, location_chain_def::next, NOT_ONEPART, offset, ONEPART_VDECL, rtx_equal_p(), set_dv_changed(), simplify_subreg(), VAR_INIT_STATUS_INITIALIZED, VAR_INIT_STATUS_UNINITIALIZED, emit_note_data_def::vars, expand_loc_callback_data::vars, vt_expand_1pvar(), vt_expand_loc(), and emit_note_data_def::where.
Referenced by emit_notes_for_changes().
|
static |
Emit NOTE_INSN_VAR_LOCATION note for each variable from a chain CHANGED_VARIABLES and delete this chain. WHERE specifies whether the notes shall be emitted before of after instruction INSN.
References changed_variables, hash_table< Descriptor, Allocator >::elements(), emit_note_insn_var_location(), emit_note_data_def::insn, process_changed_values(), shared_hash_htab(), hash_table< Descriptor, Allocator >::traverse(), emit_note_data_def::vars, and emit_note_data_def::where.
Referenced by emit_notes_for_differences(), and emit_notes_in_bb().
|
static |
Emit notes before INSN for differences between dataflow sets OLD_SET and NEW_SET.
References EMIT_NOTE_BEFORE_INSN, emit_notes_for_changes(), emit_notes_for_differences_1(), emit_notes_for_differences_2(), shared_hash_htab(), hash_table< Descriptor, Allocator >::traverse(), and dataflow_set_def::vars.
Referenced by vt_emit_notes().
int emit_notes_for_differences_1 | ( | ) |
Add variable *SLOT to the chain CHANGED_VARIABLES if it differs from the same variable in hash table DATA or is not there at all.
References variable_def::dv, dv_htab_hash(), hash_table< Descriptor, Allocator >::find_with_hash(), variable_def::n_var_parts, ONEPART_DEXPR, onepart_pool(), ONEPART_VALUE, pool_alloc(), variable_def::refcount, variable_different_p(), variable_from_dropped(), and variable_was_changed().
Referenced by emit_notes_for_differences(), and vt_emit_notes().
int emit_notes_for_differences_2 | ( | ) |
Add variable *SLOT to the chain CHANGED_VARIABLES if it is not in hash table DATA.
References variable_def::dv, dv_htab_hash(), hash_table< Descriptor, Allocator >::find_with_hash(), variable_def::n_var_parts, and variable_was_changed().
Referenced by emit_notes_for_differences().
|
static |
Referenced by vt_emit_notes().
|
static |
Emit the notes for changes of location parts in the basic block BB.
References micro_operation_def::adjust, clobber_overlapping_mems(), clobber_variable_part(), dataflow_set_clear(), dataflow_set_clear_at_call(), dataflow_set_copy(), dv_from_decl(), emit_note_after(), EMIT_NOTE_AFTER_CALL_INSN, EMIT_NOTE_AFTER_INSN, EMIT_NOTE_BEFORE_INSN, emit_notes_for_changes(), find_src_set_src(), find_src_status(), micro_operation_def::insn, micro_operation_def::loc, MO_ADJUST, MO_CALL, MO_CLOBBER, MO_COPY, MO_SET, MO_USE, MO_USE_NO_VAR, MO_VAL_LOC, MO_VAL_SET, MO_VAL_USE, next_insn(), next_non_note_insn_var_location(), SET, set_variable_part(), shared_hash_htab(), micro_operation_def::type, micro_operation_def::u, val_resolve(), val_store(), VAR_INIT_STATUS_INITIALIZED, VAR_INIT_STATUS_UNINITIALIZED, var_mem_delete(), var_mem_delete_and_set(), var_mem_set(), var_reg_delete(), var_reg_delete_and_set(), var_reg_set(), var_regno_delete(), and vt_expand_loc().
|
static |
Referenced by find_loc_in_1pdv(), intersect_loc_chains(), and variable_post_merge_perm_vals().
|
static |
Return a location list node whose loc is rtx_equal to LOC, in the location list of a one-part variable or value VAR, or in that of any values recursively mentioned in the location lists. VARS must be in star-canonical form.
References canon_value_cmp(), variable_def::dv, dv_as_opaque(), dv_as_value(), dv_from_value(), dv_htab_hash(), dv_is_value_p(), find_loc_in_1pdv(), hash_table< Descriptor, Allocator >::find_with_hash(), location_chain_def::loc, variable_def::n_var_parts, location_chain_def::next, and rtx_equal_p().
|
static |
Return a node whose loc is a MEM that refers to EXPR in the location list of a one-part variable or value VAR, or in that of any values recursively mentioned in the location lists.
References variable_def::dv, dv_from_value(), dv_htab_hash(), hash_table< Descriptor, Allocator >::find_with_hash(), location_chain_def::loc, variable_def::n_var_parts, and location_chain_def::next.
Referenced by dataflow_set_preserve_mem_locs().
|
static |
SRC is the source of an assignment. Use SET to try to find what was ultimately assigned to SRC. Return that value if known, otherwise return SRC itself.
References variable_def::dv, dv_from_decl(), location_chain_def::loc, variable_def::n_var_parts, location_chain_def::next, rtx_equal_p(), location_chain_def::set_src, shared_hash_find(), and var_debug_decl().
Referenced by compute_bb_dataflow(), and emit_notes_in_bb().
|
static |
References dv_from_decl(), get_init_value(), var_debug_decl(), VAR_INIT_STATUS_INITIALIZED, and VAR_INIT_STATUS_UNINITIALIZED.
Referenced by compute_bb_dataflow(), and emit_notes_in_bb().
|
inlinestatic |
Find a VALUE corresponding to X.
References cselib_lookup(), cselib_set::dest, count_use_info::n_sets, count_use_info::sets, cselib_set::src_elt, and count_use_info::store_p.
Referenced by add_stores(), add_uses(), and use_type().
|
inlinestatic |
Look for the index in VAR->var_part corresponding to OFFSET. Return -1 if not found. If INSERTION_POINT is non-NULL, the referenced int will be set to the index that the part has or should have, if it should be inserted.
References variable_def::n_var_parts, and offset.
Referenced by clobber_slot_part(), delete_slot_part(), and set_slot_part().
|
static |
References targetm.
|
static |
Return the canonical address for LOC, that must be a VALUE, using a cached global equivalence or computing it and storing it in the global cache.
References canon_rtx(), get_addr(), global_get_addr_cache, pointer_map_contains(), pointer_map_insert(), and vt_canonicalize_addr().
Referenced by get_addr_from_local_cache(), and vt_canonicalize_addr().
|
static |
Return the canonical address for LOC, that must be a VALUE, using a cached local equivalence or computing it and storing it in the local cache.
References canon_value_cmp(), variable_def::dv, dv_from_rtx(), get_addr_from_global_cache(), location_chain_def::loc, local_get_addr_cache, location_chain_def::next, pointer_map_contains(), pointer_map_insert(), shared_hash_find(), vt_canonicalize_addr(), and vt_get_canonicalize_base().
Referenced by vt_canonicalize_addr().
|
static |
|
static |
Referenced by dataflow_set_init().
|
static |
Initialize the set (array) SET of attrs to empty lists.
|
static |
Insert LOC in *DNODE, if it's not there yet. The list must be in loc_cmp order, and it is maintained as such.
References location_chain_def::init, location_chain_def::loc, loc_chain_pool, loc_cmp(), location_chain_def::next, pool_alloc(), and location_chain_def::set_src.
Referenced by intersect_loc_chains().
|
static |
Given an INSN, calculate the amount of stack adjustment it contains PRE- and POST-modifying stack pointer.
References find_reg_note(), SET, and stack_adjust_offset_pre_post().
Referenced by vt_initialize(), and vt_stack_adjustments().
|
static |
Insert in DEST the intersection of the locations present in both S1NODE and S2VAR, directly or indirectly. S1NODE is from a variable in DSM->cur, whereas S2VAR is from DSM->src. dvar is in DSM->dst.
References dfset_merge::cur, variable_def::dv, dv_from_value(), find_loc_in_1pdv(), location_chain_def::init, insert_into_intersection(), location_chain_def::loc, variable_def::n_var_parts, location_chain_def::next, shared_hash_find(), shared_hash_htab(), dfset_merge::src, and dataflow_set_def::vars.
Referenced by variable_merge_over_cur().
|
static |
Return -1 if X should be before Y in a location list for a 1-part variable, 1 if Y should be before X, and 0 if they're equivalent and should not appear in the list.
References canon_value_cmp(), and loc_cmp().
|
static |
Allocate the one-part auxiliary data structure for VAR, with enough room for COUNT dependencies.
References deps, and is_empty().
Referenced by loc_exp_dep_set(), and loc_exp_insert_dep().
|
static |
Referenced by variable_htab_free(), and vt_expand_var_loc_chain().
|
static |
Remove all entries from the vector of active dependencies of VAR, removing them from the back-links lists too.
References is_empty(), loc_exp_dep_s::next, and loc_exp_dep_s::pprev.
|
static |
Create active dependencies of VAR on COUNT values starting at VALUE, and corresponding back-links to the entries in VARS. Return true if we found any pending-recursion results.
References is_empty(), loc_exp_dep_alloc(), and loc_exp_insert_dep().
Referenced by vt_expand_var_loc_chain().
|
static |
Insert an active dependency from VAR on X to the vector of dependencies, and add the corresponding back-link to X's list of back-links in VARS.
References loc_exp_dep_s::dv, variable_def::dv, dv_from_rtx(), dv_htab_hash(), hash_table< Descriptor, Allocator >::find_with_hash(), loc_exp_dep_alloc(), loc_exp_dep_pool, memset(), loc_exp_dep_s::next, NOT_ONEPART, pool_alloc(), loc_exp_dep_s::pprev, loc_exp_dep_s::value, and variable_from_dropped().
Referenced by emit_note_insn_var_location(), and loc_exp_dep_set().
|
static |
Clear (canonical address) slots that reference X.
References vt_get_canonicalize_base().
Referenced by val_reset().
|
inlinestatic |
Log to OUT information about micro-operation MOPT involving X in INSN of BB.
References basic_block_def::index, micro_operation_type_name, and print_inline_rtx().
Referenced by add_stores(), add_uses(), add_with_sets(), and vt_initialize().
rtl_opt_pass* make_pass_variable_tracking | ( | ) |
|
static |
Return TRUE if the value of MEM may vary across a call.
References get_base_address(), is_global_var(), and may_be_aliased().
Referenced by dataflow_set_preserve_mem_locs(), and dataflow_set_remove_mem_locs().
|
static |
Return true if I is the negated value of a power of two.
References HOST_WIDE_INT.
Referenced by vt_canonicalize_addr(), and vt_get_canonicalize_base().
|
static |
Return the next insn after INSN that is not a NOTE_INSN_VAR_LOCATION.
Referenced by emit_notes_in_bb().
|
static |
Helper function for MO_VAL_LOC handling. Return non-zero if any rtxes not suitable for CONST use not replaced by VALUEs are discovered.
Referenced by add_uses().
|
static |
If VAL (a value or debug_expr) has backlinks to variables actively dependent on it in HTAB or in CHANGED_VARIABLES, mark them as changed, adding to CHANGED_VALUES_STACK any dependencies that may have dependencies of their own to notify.
References changed_variables, dropped_values, loc_exp_dep_s::dv, variable_def::dv, dv_as_rtx(), dv_changed_p(), dv_from_rtx(), dv_htab_hash(), dv_onepart_p(), hash_table< Descriptor, Allocator >::find_slot_with_hash(), hash_table< Descriptor, Allocator >::find_with_hash(), loc_exp_dep_pool, variable_def::n_var_parts, loc_exp_dep_s::next, NOT_ONEPART, ONEPART_DEXPR, ONEPART_VALUE, ONEPART_VDECL, pool_free(), loc_exp_dep_s::pprev, set_dv_changed(), and variable_was_changed().
Referenced by process_changed_values().
|
static |
Notify the back-links of IVAR that are pending recursion that we have found a non-NIL value for it, so they are cleared for another attempt to compute a current location.
References loc_exp_dep_s::dv, variable_def::dv, dv_as_value(), dv_changed_p(), dv_htab_hash(), dv_is_value_p(), dv_onepart_p(), hash_table< Descriptor, Allocator >::find_with_hash(), loc_exp_dep_s::next, NOT_ONEPART, loc_exp_dep_s::pprev, and variable_from_dropped().
Referenced by vt_expand_loc_callback().
|
inlinestatic |
Return the variable pool to be used for a dv of type ONEPART.
References valvar_pool, and var_pool.
Referenced by emit_notes_for_differences_1(), set_slot_part(), unshare_variable(), variable_from_dropped(), variable_htab_free(), variable_merge_over_cur(), and variable_was_changed().
Referenced by variable_different_p(), and variable_merge_over_cur().
|
static |
Return true if one-part variables VAR1 and VAR2 are different. They must be in canonical order.
References location_chain_def::loc, loc_cmp(), variable_def::n_var_parts, and location_chain_def::next.
|
static |
Compute call_arguments.
References adjust_mems(), aggregate_value_p(), build_pointer_type(), call_arguments, cselib_lookup(), cselib_preserved_value_p(), decl_debug_args_lookup(), gen_rtx_MEM(), get_call_rtx_from(), host_integerp(), HOST_WIDE_INT, int_mode_for_mode(), list_length(), elt_loc_list::loc, cselib_val_struct::locs, lowpart_subreg(), adjust_mem_data::mem_mode, memset(), elt_loc_list::next, pack_cumulative_args(), pass_by_reference(), pc_rtx, plus_constant(), adjust_mem_data::side_effects, simplify_replace_fn_rtx(), simplify_subreg(), adjust_mem_data::stack_adjust, adjust_mem_data::store, targetm, tree_low_cst(), cselib_val_struct::val_rtx, and vec_safe_iterate().
Referenced by vt_initialize().
|
static |
Ensure VAL is preserved and remember it in a vector for vt_emit_notes.
References cselib_preserve_value(), preserved_values, and cselib_val_struct::val_rtx.
Referenced by add_stores(), add_uses(), vt_add_function_parameter(), vt_init_cfa_base(), and vt_initialize().
|
static |
Take out of changed_variables any entries that don't refer to use variables. Back-propagate change notifications from values and debug_exprs to their active dependencies in HTAB or in CHANGED_VARIABLES.
References changed_variables, notify_dependents_of_changed_value(), remove_value_from_changed_variables(), hash_table< Descriptor, Allocator >::traverse(), and var_track_values_to_stack().
Referenced by emit_notes_for_changes().
|
static |
Record the value for the ENTRY_VALUE of RTL as a global equivalence of VAL.
References cselib_add_permanent_equiv(), and get_insns().
Referenced by vt_add_function_parameter().
|
staticread |
Recover the one-part aux from dropped_values.
References variable_def::dv, ONEPART_VDECL, and variable_from_dropped().
Referenced by variable_was_changed().
|
static |
Remove any redundant values in the location list of VAR, which must be unshared and 1-part.
References location_chain_def::loc, loc_chain_pool, variable_def::n_var_parts, location_chain_def::next, pool_free(), and variable_def::refcount.
Referenced by variable_post_merge_new_vals().
|
static |
Remove from changed_variables the entry whose DV corresponds to value or debug_expr VAL.
References changed_variables, hash_table< Descriptor, Allocator >::clear_slot(), variable_def::dv, dv_from_rtx(), dv_htab_hash(), and hash_table< Descriptor, Allocator >::find_slot_with_hash().
Referenced by process_changed_values().
|
static |
Replace all registers and addresses in an expression with VALUE expressions that map back to them, unless the expression is a register. If no mapping is or can be performed, returns NULL.
References cselib_lookup(), cselib_subst_to_values(), get_address_mode(), replace_equiv_address_nv(), and cselib_val_struct::val_rtx.
Referenced by add_stores(), and add_uses().
|
static |
While expanding variables, we may encounter recursion cycles because of mutual (possibly indirect) dependencies between two particular variables (or values), say A and B. If we're trying to expand A when we get to B, which in turn attempts to expand A, if we can't find any other expansion for B, we'll add B to this pending-recursion stack, and tentatively return NULL for its location. This tentative value will be used for any other occurrences of B, unless A gets some other location, in which case it will notify B that it is worth another try at computing a location for it, and it will use the location computed for A then. At the end of the expansion, the tentative NULL locations become final for all members of PENDING that didn't get a notification. This function performs this finalization of NULL locations.
References variable_def::dv, dv_changed_p(), dv_from_rtx(), and set_dv_changed().
|
static |
Attempt to reverse the EXPR operation in the debug info and record it in the cselib table. Say for reg1 = reg2 + 6 even when reg2 is no longer live we can express its value as VAL - 6.
References canonical_cselib_val(), cfa_base_rtx, count, cselib_add_permanent_equiv(), cselib_expand_value_rtx(), cselib_lookup(), cselib_preserved_value_p(), gen_lowpart_SUBREG(), elt_loc_list::loc, cselib_val_struct::locs, elt_loc_list::next, references_value_p(), scratch_regs, SET, simplify_gen_binary(), and cselib_val_struct::val_rtx.
Referenced by add_stores().
|
static |
Return true if *X is a DEBUG_EXPR. Usable as an argument to for_each_rtx to tell whether there are any DEBUG_EXPRs within RTX.
Referenced by use_type().
|
static |
Referenced by add_stores().
|
static |
Determine whether a given LOC refers to the same variable part as EXPR+OFFSET.
References HOST_WIDE_INT, and var_debug_decl().
|
static |
|
inlinestatic |
Record (if NEWV) that DV needs to have its cur_loc recomputed. For user DECLs, this means they're in changed_variables. Values and debug exprs may be left with this flag set if no user variable requires them to be evaluated.
References dv_as_decl(), dv_as_value(), dv_onepart_p(), ONEPART_DEXPR, and ONEPART_VALUE.
|
static |
References canon_value_cmp(), variable_def::dv, dv_as_decl(), dv_as_opaque(), dv_onepart_p(), find_variable_location_part(), location_chain_def::init, initialized, location_chain_def::loc, loc_chain_pool, loc_cmp(), variable_def::n_var_parts, location_chain_def::next, offset, onepart_pool(), pool_alloc(), pool_free(), variable_def::refcount, rtx_equal_p(), location_chain_def::set_src, shared_var_p(), unshare_variable(), VAR_INIT_STATUS_INITIALIZED, and variable_was_changed().
Referenced by canonicalize_values_mark(), canonicalize_values_star(), canonicalize_vars_star(), set_variable_part(), and variable_merge_over_cur().
|
static |
Set the part of variable's location in the dataflow set SET. The variable part is specified by variable's declaration in DV and offset OFFSET and the part's location by LOC. IOPT should be NO_INSERT if the variable is known to be in SET already and the variable hash table must not be resized, and INSERT otherwise.
References set_slot_part(), shared_hash_find_slot(), shared_hash_find_slot_noinsert(), and shared_hash_find_slot_unshare().
Referenced by canonicalize_values_star(), compute_bb_dataflow(), dataflow_set_equiv_regs(), emit_notes_in_bb(), val_bind(), val_reset(), val_resolve(), var_mem_decl_set(), var_reg_decl_set(), variable_merge_over_cur(), variable_post_merge_perm_vals(), and vt_add_function_parameter().
|
inlinestatic |
Increment reference counter on VARS and return it.
References shared_hash_def::refcount.
Referenced by dataflow_set_clear(), dataflow_set_copy(), dataflow_set_init(), dataflow_set_union(), and vt_find_locations().
|
static |
Decrement reference counter and destroy hash table if not shared anymore.
References hash_table< Descriptor, Allocator >::dispose(), shared_hash_def::htab, pool_free(), shared_hash_def::refcount, and shared_hash_pool.
Referenced by dataflow_set_clear(), dataflow_set_copy(), dataflow_set_destroy(), dataflow_set_merge(), dataflow_set_union(), and vt_find_locations().
|
inlinestatic |
References dv_htab_hash(), and shared_hash_find_1().
Referenced by find_src_set_src(), get_addr_from_local_cache(), get_init_value(), intersect_loc_chains(), val_reset(), and variable_post_merge_perm_vals().
|
inlinestatic |
Return variable for DV or NULL if not already present in the hash table.
References hash_table< Descriptor, Allocator >::find_with_hash(), and shared_hash_htab().
Referenced by shared_hash_find(), and variable_merge_over_cur().
|
inlinestatic |
References dv_htab_hash(), and shared_hash_find_slot_1().
Referenced by set_variable_part(), variable_merge_over_src(), and variable_union().
|
inlinestatic |
Return slot for DV, if it is already present in the hash table. If it is not present, insert it only VARS is not shared, otherwise return NULL.
References hash_table< Descriptor, Allocator >::find_slot_with_hash(), shared_hash_htab(), and shared_hash_shared().
Referenced by shared_hash_find_slot().
|
inlinestatic |
References dv_htab_hash(), and shared_hash_find_slot_noinsert_1().
Referenced by canonicalize_values_mark(), canonicalize_values_star(), canonicalize_vars_star(), clobber_variable_part(), dataflow_set_equiv_regs(), delete_variable_part(), set_variable_part(), unshare_variable(), variable_merge_over_cur(), and variable_was_changed().
|
inlinestatic |
Return slot for DV only if it is already present in the hash table.
References hash_table< Descriptor, Allocator >::find_slot_with_hash(), and shared_hash_htab().
Referenced by shared_hash_find_slot_noinsert(), and variable_merge_over_cur().
|
inlinestatic |
References dv_htab_hash(), and shared_hash_find_slot_unshare_1().
Referenced by set_variable_part(), unshare_variable(), variable_merge_over_cur(), variable_union(), and variable_was_changed().
|
inlinestatic |
Unshare *PVARS if shared and return slot for DV. If INS is INSERT, insert it if not already present.
References hash_table< Descriptor, Allocator >::find_slot_with_hash(), shared_hash_htab(), shared_hash_shared(), and shared_hash_unshare().
Referenced by shared_hash_find_slot_unshare(), and variable_merge_over_cur().
|
inlinestatic |
Return the hash table for VARS.
References shared_hash_def::htab.
Referenced by clobber_overlapping_mems(), compute_bb_dataflow(), dataflow_post_merge_adjust(), dataflow_set_clear_at_call(), dataflow_set_different(), dataflow_set_merge(), dataflow_set_preserve_mem_locs(), dataflow_set_union(), dump_dataflow_set(), emit_notes_for_changes(), emit_notes_for_differences(), emit_notes_in_bb(), intersect_loc_chains(), shared_hash_find_1(), shared_hash_find_slot_1(), shared_hash_find_slot_noinsert_1(), shared_hash_find_slot_unshare_1(), variable_post_merge_perm_vals(), variable_was_changed(), vt_emit_notes(), and vt_find_locations().
|
inlinestatic |
Shared hashtable support.
Return true if VARS is shared.
References shared_hash_def::refcount.
Referenced by shared_hash_find_slot_1(), shared_hash_find_slot_unshare_1(), shared_var_p(), unshare_variable(), variable_merge_over_cur(), and variable_was_changed().
|
static |
Copy variables into a new hash table.
References hash_table< Descriptor, Allocator >::create(), hash_table< Descriptor, Allocator >::elements(), shared_hash_def::htab, pool_alloc(), shared_hash_def::refcount, shared_hash_pool, and vars_copy().
Referenced by shared_hash_find_slot_unshare_1().
|
inlinestatic |
Return true if VAR is shared, or maybe because VARS is shared.
References variable_def::refcount, and shared_hash_shared().
Referenced by dataflow_set_preserve_mem_locs(), dataflow_set_remove_mem_locs(), delete_slot_part(), drop_overlapping_mem_locs(), set_slot_part(), and variable_union().
|
static |
Local function prototypes.
Given a SET, calculate the amount of stack adjustment it contains PRE- and POST-modifying stack pointer. This function is similar to stack_adjust_offset.
Referenced by insn_stack_adjust_offset_pre_post().
|
static |
Referenced by track_loc_p(), and use_type().
|
static |
Shall EXPR be tracked?
References contains_symbol_ref(), get_ref_base_and_extent(), handled_component_p(), and HOST_WIDE_INT.
|
static |
LOC is a REG or MEM that we would like to track if possible. If EXPR is null, we don't know what expression LOC refers to, otherwise it refers to EXPR + OFFSET. STORE_REG_P is true if LOC is an lvalue register. Return true if EXPR is nonnull and if LOC, or some lowpart of it, is something we can track. When returning true, store the mode of the lowpart we can track in *MODE_OUT (if nonnull) and its offset from EXPR in *OFFSET_OUT (if nonnull).
References byte_lowpart_offset(), offset, and track_expr_p().
Referenced by use_type(), and vt_add_function_parameter().
|
static |
Return a copy of a variable VAR and insert it to dataflow set SET.
References changed_variables, dst_can_be_shared, variable_def::dv, dv_htab_hash(), emit_notes, hash_table< Descriptor, Allocator >::find_slot_with_hash(), location_chain_def::init, initialized, location_chain_def::loc, loc_chain_pool, variable_def::n_var_parts, location_chain_def::next, onepart_pool(), pool_alloc(), variable_def::refcount, location_chain_def::set_src, shared_hash_find_slot_noinsert(), shared_hash_find_slot_unshare(), shared_hash_shared(), VAR_INIT_STATUS_INITIALIZED, and variable_htab_free().
Referenced by dataflow_set_preserve_mem_locs(), dataflow_set_remove_mem_locs(), delete_slot_part(), drop_overlapping_mem_locs(), set_slot_part(), variable_post_merge_new_vals(), and variable_union().
|
inlinestatic |
Return true if LOC should not be expanded for location expressions, or used in them.
Referenced by add_stores(), add_uses(), val_resolve(), val_store(), and vt_expand_var_loc_chain().
|
inlinestatic |
Return the combined depth, when one sub-expression evaluated to BEST_DEPTH and the previous known depth was SAVED_DEPTH.
References expand_depth_struct::complexity, and expand_depth_struct::entryvals.
Referenced by vt_expand_loc_callback(), and vt_expand_var_loc_chain().
|
static |
Transform X into narrower mode MODE from wider mode WMODE.
References lowpart_subreg(), and simplify_gen_binary().
Referenced by adjust_mems().
|
static |
Helper for adjust_mems. Return 1 if *loc is unsuitable for transformation of wider mode arithmetics to narrower mode, -1 if it is suitable and subexpressions shouldn't be traversed and 0 if it is suitable and subexpressions should be traversed. Called through for_each_rtx.
References cselib_lookup(), for_each_rtx(), subreg_lowpart_offset(), and validate_subreg().
Referenced by adjust_mems().
|
static |
Determine what kind of micro operation to choose for a USE. Return MO_CLOBBER if no micro operation is to be generated.
References cfa_base_rtx, cselib_lookup(), cselib_preserved_value_p(), find_use_val(), for_each_rtx(), get_address_mode(), MO_CLOBBER, MO_USE, MO_USE_NO_VAR, MO_VAL_LOC, MO_VAL_SET, MO_VAL_USE, rtx_debug_expr_p(), count_use_info::sets, count_use_info::store_p, target_for_debug_bind(), track_expr_p(), track_loc_p(), and var_debug_decl().
|
inlinestatic |
Bind VAL to LOC in SET. If MODIFIED, detach LOC from any values bound to it.
References canonical_cselib_val(), clobber_overlapping_mems(), dv_from_value(), elt_loc_list::loc, cselib_val_struct::locs, elt_loc_list::next, set_variable_part(), VAR_INIT_STATUS_INITIALIZED, var_mem_decl_set(), var_reg_decl_set(), and var_regno_delete().
Referenced by val_resolve(), and val_store().
|
static |
Reset this node, detaching all its equivalences. Return the slot in the variable hash table that holds dv, if there is one.
References canon_value_cmp(), clobber_variable_part(), delete_variable_part(), dv_as_value(), dv_from_value(), location_chain_def::init, location_chain_def::loc, local_get_addr_cache, local_get_addr_clear_given_value(), variable_def::n_var_parts, location_chain_def::next, ONEPART_VALUE, pointer_map_contains(), pointer_map_traverse(), location_chain_def::set_src, set_variable_part(), shared_hash_find(), var_mem_decl_set(), and var_reg_decl_set().
Referenced by val_resolve(), variable_post_merge_new_vals(), and variable_post_merge_perm_vals().
|
static |
Find the values in a given location and map the val to another value, if it is unique, or add the location as one holding the value.
References dump_file, dump_flags, attrs_def::dv, variable_def::dv, dv_as_value(), dv_from_value(), dv_is_value_p(), attrs_def::next, attrs_def::offset, print_inline_rtx(), set_variable_part(), unsuitable_loc(), val_bind(), val_reset(), and VAR_INIT_STATUS_INITIALIZED.
Referenced by compute_bb_dataflow(), and emit_notes_in_bb().
|
static |
Bind a value to a location it was just stored in. If MODIFIED holds, assume the location was modified, detaching it from any values bound to it.
References cselib_preserved_value_p(), dump_file, elt_loc_list::loc, cselib_val_struct::locs, elt_loc_list::next, print_inline_rtx(), elt_loc_list::setting_insn, unsuitable_loc(), and val_bind().
Referenced by compute_bb_dataflow(), and emit_notes_in_bb().
|
inlinestatic |
Map a decl to its main debug decl.
|
static |
Return the MODE lowpart of LOC, or null if LOC is not something we want to track. When returning nonnull, make sure that the attributes on the returned value are updated.
References byte_lowpart_offset(), gen_rtx_REG_offset(), offset, reg_offset, subreg_lowpart_offset(), and subreg_regno_offset().
Referenced by add_stores(), add_uses(), and vt_add_function_parameter().
|
static |
Set the location of DV, OFFSET as the MEM LOC.
References dv_as_decl(), dv_from_decl(), dv_is_decl_p(), set_variable_part(), and var_debug_decl().
Referenced by val_bind(), val_reset(), and var_mem_set().
|
static |
Referenced by compute_bb_dataflow(), and emit_notes_in_bb().
|
static |
Delete the location part LOC from dataflow set SET. If CLOBBER is true, also delete any other live copies of the same variable part. Adjust the address first if it is stack pointer based.
References clobber_overlapping_mems(), clobber_variable_part(), delete_variable_part(), dv_from_decl(), HOST_WIDE_INT, offset, and var_debug_decl().
|
static |
Delete and set the location part of variable MEM_EXPR (LOC) in dataflow set SET to LOC. If MODIFY is true, any other live copies of the same variable part are also deleted from the dataflow set, otherwise the variable part is assumed to be copied from another location holding the same part. Adjust the address first if it is stack pointer based.
References clobber_overlapping_mems(), clobber_variable_part(), dv_from_decl(), get_init_value(), HOST_WIDE_INT, offset, var_debug_decl(), VAR_INIT_STATUS_UNKNOWN, and var_mem_set().
Referenced by compute_bb_dataflow(), and emit_notes_in_bb().
|
static |
Set the location part of variable MEM_EXPR (LOC) in dataflow set SET to LOC. Adjust the address first if it is stack pointer based.
References dv_from_decl(), HOST_WIDE_INT, offset, and var_mem_decl_set().
Referenced by compute_bb_dataflow(), emit_notes_in_bb(), and var_mem_delete_and_set().
|
static |
Set the register LOC to contain DV, OFFSET.
References attrs_list_insert(), attrs_def::dv, dv_as_decl(), dv_as_opaque(), dv_from_decl(), dv_is_decl_p(), attrs_def::next, attrs_def::offset, set_variable_part(), and var_debug_decl().
Referenced by val_bind(), val_reset(), var_reg_set(), and variable_post_merge_new_vals().
|
static |
Referenced by compute_bb_dataflow(), and emit_notes_in_bb().
|
static |
Delete the association of register LOC in dataflow set SET with any variables that aren't onepart. If CLOBBER is true, also delete any other live copies of the same variable part, and delete the association with onepart dvs too.
References attrs_pool, clobber_variable_part(), delete_variable_part(), attrs_def::dv, dv_from_decl(), dv_onepart_p(), HOST_WIDE_INT, attrs_def::loc, attrs_def::next, attrs_def::offset, offset, pool_free(), and var_debug_decl().
|
static |
Delete current content of register LOC in dataflow set SET and set the register to contain REG_EXPR (LOC), REG_OFFSET (LOC). If MODIFY is true, any other live copies of the same variable part are also deleted from the dataflow set, otherwise the variable part is assumed to be copied from another location holding the same part.
References attrs_pool, clobber_variable_part(), delete_variable_part(), attrs_def::dv, dv_as_opaque(), dv_from_decl(), get_init_value(), HOST_WIDE_INT, attrs_def::loc, attrs_def::next, attrs_def::offset, offset, pool_free(), var_debug_decl(), VAR_INIT_STATUS_UNKNOWN, and var_reg_set().
Referenced by compute_bb_dataflow(), and emit_notes_in_bb().
|
static |
Set the register to contain REG_EXPR (LOC), REG_OFFSET (LOC).
References dv_from_decl(), HOST_WIDE_INT, offset, and var_reg_decl_set().
Referenced by compute_bb_dataflow(), emit_notes_in_bb(), and var_reg_delete_and_set().
|
static |
Referenced by compute_bb_dataflow(), dataflow_set_clear_at_call(), emit_notes_in_bb(), and val_bind().
|
static |
Delete content of register with number REGNO in dataflow set SET.
References attrs_pool, delete_variable_part(), attrs_def::dv, attrs_def::loc, attrs_def::next, attrs_def::offset, and pool_free().
int var_track_values_to_stack | ( | variable_def ** | slot, |
vec< rtx, va_stack > * | changed_values_stack | ||
) |
While traversing changed_variables, push onto DATA (a stack of RTX values) entries that aren't user variables.
References variable_def::dv, dv_as_decl(), dv_as_value(), ONEPART_DEXPR, and ONEPART_VALUE.
Referenced by process_changed_values().
Referenced by dataflow_set_different(), and emit_notes_for_differences_1().
|
static |
Return true if variables VAR1 and VAR2 are different.
References variable_def::dv, dv_as_opaque(), variable_def::n_var_parts, onepart_variable_different_p(), and variable_part_different_p().
|
inlinestatic |
Return the variable for DV in dropped_values, inserting one if requested with INSERT.
References dropped_values, variable_def::dv, dv_htab_hash(), dv_onepart_p(), hash_table< Descriptor, Allocator >::find_slot_with_hash(), variable_def::n_var_parts, ONEPART_DEXPR, onepart_pool(), ONEPART_VALUE, pool_alloc(), variable_def::refcount, and set_dv_changed().
Referenced by emit_notes_for_differences_1(), loc_exp_insert_dep(), notify_dependents_of_resolved_value(), recover_dropped_1paux(), and vt_expand_loc_callback().
|
static |
Referenced by variable_hasher::remove(), unshare_variable(), variable_merge_over_cur(), and variable_was_changed().
|
static |
Free the element of VARIABLE_HTAB (its type is struct variable_def).
References variable_def::dv, loc_chain_pool, loc_exp_dep_clear(), variable_def::n_var_parts, location_chain_def::next, ONEPART_DEXPR, onepart_pool(), pool_free(), variable_def::refcount, and set_dv_changed().
|
static |
Combine variable or value in *S1SLOT (in DSM->cur) with the corresponding entry in DSM->src. Multi-part variables are combined with variable_union, whereas onepart dvs are combined with intersection.
References attrs_list_insert(), canonicalize_values_star(), delete_slot_part(), dfset_merge::dst, dst_can_be_shared, attrs_def::dv, variable_def::dv, dv_as_value(), dv_from_value(), dv_htab_hash(), dv_is_value_p(), location_chain_def::init, intersect_loc_chains(), attrs_def::loc, location_chain_def::loc, variable_def::n_var_parts, attrs_def::next, location_chain_def::next, onepart_pool(), ONEPART_VALUE, onepart_variable_different_p(), pool_alloc(), variable_def::refcount, dataflow_set_def::regs, set_slot_part(), set_variable_part(), shared_hash_find_1(), shared_hash_find_slot_noinsert(), shared_hash_find_slot_noinsert_1(), shared_hash_find_slot_unshare(), shared_hash_find_slot_unshare_1(), shared_hash_shared(), dfset_merge::src, dfset_merge::src_onepart_cnt, variable_htab_free(), variable_union(), and dataflow_set_def::vars.
Referenced by dataflow_set_merge().
|
static |
Copy s2slot (in DSM->src) to DSM->dst if the variable is a multi-part variable. Unions of multi-part variables and intersections of one-part ones will be handled in variable_merge_over_cur().
References dfset_merge::dst, variable_def::dv, variable_def::refcount, shared_hash_find_slot(), dfset_merge::src_onepart_cnt, and dataflow_set_def::vars.
Referenced by dataflow_set_merge().
|
static |
Referenced by variable_different_p().
|
static |
References location_chain_def::loc, variable_part_def::loc_chain, location_chain_def::next, and rtx_equal_p().
int variable_post_merge_new_vals | ( | ) |
Create values for incoming expressions associated with one-part variables that don't have value numbers for them.
References attrs_pool, cselib_invalidate_rtx(), cselib_lookup(), cselib_preserve_value(), dataflow_set_init(), dump_file, attrs_def::dv, variable_def::dv, dv_as_opaque(), dv_as_value(), dv_from_value(), dv_is_decl_p(), dv_is_value_p(), cselib_val_struct::hash, attrs_def::loc, location_chain_def::loc, variable_def::n_var_parts, attrs_def::next, location_chain_def::next, attrs_def::offset, dfset_post_merge::permp, pool_free(), variable_def::refcount, remove_duplicate_values(), dfset_post_merge::set, cselib_val_struct::uid, unshare_variable(), val_reset(), cselib_val_struct::val_rtx, VAR_INIT_STATUS_INITIALIZED, and var_reg_decl_set().
Referenced by dataflow_post_merge_adjust().
int variable_post_merge_perm_vals | ( | ) |
Reset values in the permanent set that are not associated with the chosen expression.
References attrs_list_insert(), attrs_def::dv, variable_def::dv, dv_as_value(), dv_is_value_p(), find_loc_in_1pdv(), location_chain_def::init, attrs_def::loc, location_chain_def::loc, variable_def::n_var_parts, attrs_def::next, location_chain_def::next, attrs_def::offset, dfset_post_merge::set, set_variable_part(), shared_hash_find(), shared_hash_htab(), val_reset(), and variable_union().
Referenced by dataflow_post_merge_adjust().
unsigned int variable_tracking_main | ( | void | ) |
In var-tracking.c
References variable_tracking_main_1().
|
inlinestatic |
The entry point to variable tracking pass.
References delete_debug_insns(), dump_dataflow_sets(), dump_file, dump_flags, dump_flow_info(), dump_reg_info(), mark_dfs_back_edges(), timevar_pop(), timevar_push(), vt_debug_insns_local(), vt_emit_notes(), vt_finalize(), vt_find_locations(), and vt_initialize().
Referenced by variable_tracking_main().
|
static |
Compute union of location parts of variable *SLOT and the same variable from hash table DATA. Compute "sorted" union of the location chains for common offsets, i.e. the locations of a variable part are sorted by a priority where the priority is the sum of the positions in the 2 chains (if a location is only in one list the position in the second list is defined to be larger than the length of the chains). When we are updating the location parts the newest location is in the beginning of the chain, so when we do the described "sorted" union we keep the newest locations in the beginning.
References dst_can_be_shared, variable_def::dv, location_chain_def::init, variable_union_info::lc, location_chain_def::loc, loc_chain_pool, loc_cmp(), variable_def::n_var_parts, location_chain_def::next, pool_alloc(), variable_union_info::pos, variable_union_info::pos_dst, variable_def::refcount, rtx_equal_p(), location_chain_def::set_src, shared_hash_find_slot(), shared_hash_find_slot_unshare(), shared_var_p(), unshare_variable(), VAR_INIT_STATUS_INITIALIZED, VAR_INIT_STATUS_UNKNOWN, variable_union_info_cmp_pos(), vui_allocated, and vui_vec.
Referenced by dataflow_set_union(), variable_merge_over_cur(), and variable_post_merge_perm_vals().
|
static |
Referenced by variable_union().
|
static |
Compare function for qsort, order the structures by POS element.
References i1, i2, variable_union_info::pos, and variable_union_info::pos_dst.
|
static |
|
static |
Add variable VAR to the hash table of changed variables and if it has no locations delete it from SET's hash table.
References changed_variables, hash_table< Descriptor, Allocator >::clear_slot(), dropped_values, variable_def::dv, dv_htab_hash(), emit_notes, hash_table< Descriptor, Allocator >::find_slot_with_hash(), variable_def::n_var_parts, ONEPART_DEXPR, onepart_pool(), ONEPART_VALUE, pool_alloc(), recover_dropped_1paux(), variable_def::refcount, set_dv_changed(), shared_hash_find_slot_noinsert(), shared_hash_find_slot_unshare(), shared_hash_htab(), shared_hash_shared(), and variable_htab_free().
|
static |
Referenced by shared_hash_unshare().
|
static |
Copy all variables from hash table SRC to hash table DST.
References variable_def::dv, dv_htab_hash(), hash_table< Descriptor, Allocator >::find_slot_with_hash(), and variable_def::refcount.
|
static |
Insert function parameter PARM in IN and OUT sets of ENTRY_BLOCK.
References attrs_list_insert(), byte_lowpart_offset(), cselib_lookup_from_insn(), current_function_decl, variable_def::dv, dv_as_value(), dv_from_decl(), dv_from_value(), dv_is_value_p(), gen_raw_REG(), gen_rtx_MEM(), gen_rtx_REG_offset(), get_insns(), get_spill_slot_decl(), HOST_WIDE_INT, parm_reg::incoming, offset, parm_reg::outgoing, plus_constant(), preserve_value(), record_entry_value(), dataflow_set_def::regs, replace_equiv_address_nv(), set_variable_part(), target_for_debug_bind(), track_loc_p(), cselib_val_struct::val_rtx, VAR_INIT_STATUS_INITIALIZED, var_lowpart(), vec_safe_push(), vt_get_decl_and_offset(), and windowed_parm_regs.
Referenced by vt_add_function_parameters().
|
static |
Insert function parameters to IN and OUT sets of ENTRY_BLOCK.
References current_function_decl, and vt_add_function_parameter().
Referenced by vt_initialize().
|
inlinestatic |
Return true iff there's a true dependence between MLOC and LOC. MADDR must be a canonicalized version of MLOC's address.
References canon_true_dependence(), and vt_canonicalize_addr().
Referenced by drop_overlapping_mem_locs().
|
static |
|
static |
Canonicalize LOC using equivalences from SET in addition to those in the cselib static table. It expects a VALUE-based expression, and it will only substitute VALUEs with other VALUEs or function-global equivalences, so that, if two addresses have base VALUEs that are locally or globally related in ways that memrefs_conflict_p cares about, they will both canonicalize to expressions that have the same base VALUE. The use of VALUEs as canonical base addresses enables the canonical RTXs to remain unchanged globally, if they resolve to a constant, or throughout a basic block otherwise, so that they can be cached and the cache needs not be invalidated when REGs, MEMs or such change.
References canon_rtx(), get_addr_from_global_cache(), get_addr_from_local_cache(), HOST_WIDE_INT, negative_power_of_two_p(), plus_constant(), and vt_canonicalize_addr().
|
static |
Run a fast, BB-local only version of var tracking, to take care of information that we don't do global analysis on, such that not all information is lost. If SKIPPED holds, we're skipping the global pass entirely, so we should try to use information it would have handled as well..
References delete_debug_insns().
Referenced by variable_tracking_main_1().
|
static |
Emit notes for the whole function.
References changed_variables, hash_table< Descriptor, Allocator >::create(), create_alloc_pool(), cselib_get_next_uid(), dataflow_set_clear(), dataflow_set_destroy(), dataflow_set_init(), hash_table< Descriptor, Allocator >::dispose(), dropped_values, hash_table< Descriptor, Allocator >::elements(), emit_notes, emit_notes_for_differences(), emit_notes_for_differences_1(), emit_notes_in_bb(), empty_shared_hash, loc_exp_dep_pool, local_get_addr_cache, pointer_map_create(), pointer_map_destroy(), shared_hash_htab(), hash_table< Descriptor, Allocator >::traverse(), and dataflow_set_def::vars.
Referenced by variable_tracking_main_1().
|
static |
Expand the one-part VARiable to a location, using the equivalences in VARS, updating their CUR_LOCs in the process.
References variable_def::dv, dv_changed_p(), expand_loc_callback_data::expanding, variable_def::n_var_parts, scratch_regs, and vt_expand_var_loc_chain().
Referenced by emit_note_insn_var_location().
|
static |
Expand VALUEs and DEBUG_EXPRs in LOC to a location, using the equivalences in VARS, updating their CUR_LOCs in the process.
References cselib_expand_value_rtx_cb(), scratch_regs, and vt_expand_loc_callback().
Referenced by emit_note_insn_var_location(), and emit_notes_in_bb().
Callback for cselib_expand_value, that looks for expressions holding the value in the var-tracking hash tables. Return X for standard processing, anything else is to be used as-is.
References expand_depth_struct::complexity, cselib_expand_value_rtx_cb(), expand_loc_callback_data::depth, variable_def::dv, dv_changed_p(), dv_from_rtx(), dv_htab_hash(), expand_loc_callback_data::expanding, hash_table< Descriptor, Allocator >::find_with_hash(), variable_def::n_var_parts, notify_dependents_of_resolved_value(), expand_loc_callback_data::pending, set_dv_changed(), simplify_gen_subreg(), update_depth(), variable_from_dropped(), expand_loc_callback_data::vars, and vt_expand_var_loc_chain().
Referenced by vt_expand_loc(), and vt_expand_var_loc_chain().
|
inlinestatic |
Expand VAR to a location RTX, updating its cur_loc. Use REGS and DATA for cselib expand callback. If PENDRECP is given, indicate in it whether any sub-expression couldn't be fully evaluated because it is pending recursion resolution.
References expand_depth_struct::complexity, cselib_expand_value_rtx_cb(), cselib_preserved_value_p(), expand_loc_callback_data::depth, variable_def::dv, dv_as_value(), expand_depth_struct::entryvals, expand_loc_callback_data::expanding, elt_loc_list::loc, location_chain_def::loc, loc_exp_dep_clear(), loc_exp_dep_set(), cselib_val_struct::locs, variable_def::n_var_parts, elt_loc_list::next, location_chain_def::next, ONEPART_VALUE, unsuitable_loc(), update_depth(), expand_loc_callback_data::vars, and vt_expand_loc_callback().
Referenced by vt_expand_1pvar(), and vt_expand_loc_callback().
|
static |
Free the data structures needed for variable tracking.
References attrs_pool, changed_variables, cselib_finish(), dataflow_set_destroy(), hash_table< Descriptor, Allocator >::dispose(), empty_shared_hash, free_alloc_pool(), free_aux_for_blocks(), global_get_addr_cache, shared_hash_def::htab, loc_chain_pool, loc_exp_dep_pool, pointer_map_destroy(), preserved_values, scratch_regs, shared_hash_pool, valvar_pool, var_pool, vec_free(), vui_allocated, vui_vec, and windowed_parm_regs.
Referenced by variable_tracking_main_1().
|
static |
Find the locations of variables in the whole function.
References count_use_info::bb, bitmap_bit_p(), bitmap_clear(), bitmap_clear_bit(), bitmap_ones(), bitmap_set_bit(), canonicalize_loc_order_check(), cfun, changed, compute_bb_dataflow(), dataflow_post_merge_adjust(), dataflow_set_clear(), dataflow_set_copy(), dataflow_set_merge(), dataflow_set_union(), function::decl, edge_def::dest, dst_can_be_shared, dump_dataflow_set(), dump_file, dump_flags, hash_table< Descriptor, Allocator >::elements(), first, free(), basic_block_def::index, inform(), pre_and_rev_post_order_compute(), basic_block_def::preds, sbitmap_alloc(), sbitmap_free(), shared_hash_copy(), shared_hash_destroy(), shared_hash_htab(), hash_table< Descriptor, Allocator >::size(), edge_def::src, basic_block_def::succs, timevar_pop(), timevar_push(), hash_table< Descriptor, Allocator >::traverse(), dataflow_set_def::vars, visited, and worklist.
Referenced by variable_tracking_main_1().
|
static |
Strip constant offsets and alignments off of LOC. Return the base expression.
References negative_power_of_two_p().
Referenced by get_addr_from_local_cache(), and local_get_addr_clear_given_value().
|
static |
Referenced by vt_add_function_parameter().
|
static |
If there is a declaration and offset associated with register/memory RTL assign declaration to *DECLP and offset to *OFFSETP, and return true.
|
static |
Initialize cfa_base_rtx, create a preserved VALUE for it and ensure it isn't flushed during cselib_reset_table. Can be called only if frame_pointer_rtx resp. arg_pointer_rtx has been eliminated.
References cfa_base_offset, cfa_base_rtx, cselib_lookup_from_insn(), cselib_preserve_cfa_base_value(), current_function_decl, get_insns(), preserve_value(), and vt_equate_reg_base_value().
Referenced by vt_initialize().
|
static |
Allocate and initialize the data structures for variable tracking and parse the RTL to get the micro operations.
References add_with_sets(), micro_operation_def::adjust, adjust_insn(), alloc_aux_for_blocks(), attrs_pool, cancel_changes(), cfa_base_rtx, changed_variables, hash_table< Descriptor, Allocator >::create(), create_alloc_pool(), cselib_add_permanent_equiv(), cselib_get_next_uid(), cselib_hook_called, cselib_init(), cselib_invalidate_rtx(), cselib_lookup(), cselib_lookup_from_insn(), cselib_preserve_cfa_base_value(), CSELIB_PRESERVE_CONSTANTS, cselib_preserve_only_values(), cselib_preserved_value_p(), cselib_process_insn(), CSELIB_RECORD_MEMORY, cselib_record_sets_hook, cselib_reset_table(), cselib_set_value_sp_based(), current_function_decl, dataflow_set_init(), dump_cselib_table(), dump_file, dump_flags, eliminate_regs(), empty_shared_hash, find_edge(), edge_def::flags, fp_setter_insn(), get_insns(), global_get_addr_cache, hard_frame_pointer_adjustment, HOST_WIDE_INT, shared_hash_def::htab, micro_operation_def::insn, insn_stack_adjust_offset_pre_post(), last_bb, loc_chain_pool, log_op_type(), MO_ADJUST, basic_block_def::next_bb, offset, plus_constant(), pointer_map_create(), pool_alloc(), prepare_call_arguments(), preserve_value(), preserved_values, print_rtl_single(), shared_hash_def::refcount, scratch_regs, shared_hash_pool, single_pred_p(), micro_operation_def::type, micro_operation_def::u, valvar_pool, var_pool, vt_add_function_parameters(), vt_init_cfa_base(), and vt_stack_adjustments().
Referenced by variable_tracking_main_1().
|
static |
Compute stack adjustments for all blocks by traversing DFS tree. Return true when the adjustments on all incoming edges are consistent. Heavily borrowed from pre_and_rev_post_order_compute.
References edge_def::dest, ei_edge(), ei_next(), ei_one_before_end_p(), free(), HOST_WIDE_INT, insn_stack_adjust_offset_pre_post(), offset, edge_def::src, stack, basic_block_def::succs, and visited.
Referenced by vt_initialize().
|
static |
Alloc pool for struct attrs_def.
Referenced by attrs_list_clear(), attrs_list_copy(), attrs_list_insert(), canonicalize_values_star(), clobber_slot_part(), var_reg_delete(), var_reg_delete_and_set(), var_regno_delete(), variable_post_merge_new_vals(), vt_finalize(), and vt_initialize().
|
static |
Arguments to the call.
Referenced by add_with_sets(), and prepare_call_arguments().
|
static |
Referenced by compute_cfa_pointer(), and vt_init_cfa_base().
|
static |
arg_pointer_rtx resp. frame_pointer_rtx if stack_pointer_rtx or hard_frame_pointer_rtx is being mapped to it and offset for it.
Referenced by add_stores(), adjust_mems(), compute_cfa_pointer(), reverse_op(), use_type(), vt_init_cfa_base(), and vt_initialize().
|
static |
Changed variables, notes will be emitted for them.
Referenced by emit_note_insn_var_location(), emit_notes_for_changes(), notify_dependents_of_changed_value(), process_changed_values(), remove_value_from_changed_variables(), unshare_variable(), variable_was_changed(), vt_emit_notes(), vt_finalize(), and vt_initialize().
char check_value_val[(int) VALUE==(int) IDENTIFIER_NODE?1:-1] |
Variable tracking routines for the GNU compiler. Copyright (C) 2002-2013 Free Software Foundation, Inc. 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/>.
This file contains the variable tracking pass. It computes where variables are located (which registers or where in memory) at each position in instruction stream and emits notes describing the locations. Debug information (DWARF2 location lists) is finally generated from these notes. With this debug information, it is possible to show variables even when debugging optimized code. How does the variable tracking pass work? First, it scans RTL code for uses, stores and clobbers (register/memory references in instructions), for call insns and for stack adjustments separately for each basic block and saves them to an array of micro operations. The micro operations of one instruction are ordered so that pre-modifying stack adjustment < use < use with no var < call insn < < clobber < set < post-modifying stack adjustment Then, a forward dataflow analysis is performed to find out how locations of variables change through code and to propagate the variable locations along control flow graph. The IN set for basic block BB is computed as a union of OUT sets of BB's predecessors, the OUT set for BB is copied from the IN set for BB and is changed according to micro operations in BB. The IN and OUT sets for basic blocks consist of a current stack adjustment (used for adjusting offset of variables addressed using stack pointer), the table of structures describing the locations of parts of a variable and for each physical register a linked list for each physical register. The linked list is a list of variable parts stored in the register, i.e. it is a list of triplets (reg, decl, offset) where decl is REG_EXPR (reg) and offset is REG_OFFSET (reg). The linked list is used for effective deleting appropriate variable parts when we set or clobber the register. There may be more than one variable part in a register. The linked lists should be pretty short so it is a good data structure here. For example in the following code, register allocator may assign same register to variables A and B, and both of them are stored in the same register in CODE: if (cond) set A; else set B; CODE; if (cond) use A; else use B; Finally, the NOTE_INSN_VAR_LOCATION notes describing the variable locations are emitted to appropriate positions in RTL code. Each such a note describes the location of one variable at the point in instruction stream where the note is. There is no need to emit a note for each variable before each instruction, we only emit these notes where the location of variable changes (this means that we also emit notes for changes between the OUT set of the previous block and the IN set of the current block). The notes consist of two parts: 1. the declaration (from REG_EXPR or MEM_EXPR) 2. the location of a variable - it is either a simple register/memory reference (for simple variables, for example int), or a parallel of register/memory references (for a large variables which consist of several parts, for example long long).
var-tracking.c assumes that tree code with the same value as VALUE rtx code has no chance to appear in REG_EXPR/MEM_EXPRs and isn't a decl. Currently the value is the same as IDENTIFIER_NODE, which has such a property. If this compile time assertion ever fails, make sure that the new tree code that equals (int) VALUE has the same property.
|
static |
Variable used to tell whether cselib_process_insn called our hook.
Referenced by add_with_sets(), and vt_initialize().
|
static |
This is *not* reset after each function. It gives each NOTE_INSN_DELETED_DEBUG_LABEL in the entire compilation a unique label number.
Referenced by delete_debug_insns().
|
static |
Values whose dynamic location lists have gone empty, but whose cselib location lists are still usable. Use this to hold the current location, the backlinks, etc, during emit_notes.
Referenced by notify_dependents_of_changed_value(), variable_from_dropped(), variable_was_changed(), and vt_emit_notes().
|
static |
Referenced by dataflow_set_merge(), unshare_variable(), variable_merge_over_cur(), variable_union(), and vt_find_locations().
|
static |
Shall notes be emitted?
Referenced by dataflow_set_preserve_mem_locs(), unshare_variable(), variable_was_changed(), and vt_emit_notes().
|
static |
Empty shared hashtable.
Referenced by dataflow_set_clear(), dataflow_set_init(), dataflow_set_union(), vt_emit_notes(), vt_finalize(), and vt_initialize().
|
static |
This caches canonicalized addresses for VALUEs, computed using information in the global cselib table.
Referenced by get_addr_from_global_cache(), vt_finalize(), and vt_initialize().
|
static |
Adjustment for hard_frame_pointer_rtx to cfa base reg, or -1 if the replacement shouldn't be done.
Referenced by add_stores(), adjust_mems(), and vt_initialize().
|
static |
Alloc pool for struct location_chain_def.
Referenced by dataflow_set_preserve_mem_locs(), dataflow_set_remove_mem_locs(), delete_slot_part(), drop_overlapping_mem_locs(), insert_into_intersection(), remove_duplicate_values(), set_slot_part(), unshare_variable(), variable_htab_free(), variable_union(), vt_finalize(), and vt_initialize().
|
static |
Alloc pool for struct loc_exp_dep_s for NOT_ONEPART variables.
Referenced by loc_exp_insert_dep(), notify_dependents_of_changed_value(), vt_emit_notes(), and vt_finalize().
|
static |
This caches canonicalized addresses for VALUEs, computed using information from the global cache and information pertaining to a basic block being analyzed.
Referenced by compute_bb_dataflow(), get_addr_from_local_cache(), val_reset(), and vt_emit_notes().
|
static |
Referenced by log_op_type().
All preserved VALUEs.
Referenced by preserve_value(), vt_finalize(), and vt_initialize().
|
static |
Scratch register bitmap used by cselib_expand_value_rtx.
Referenced by reverse_op(), vt_expand_1pvar(), vt_expand_loc(), vt_finalize(), and vt_initialize().
|
static |
Alloc pool for struct shared_hash_def.
Referenced by dataflow_set_merge(), shared_hash_destroy(), shared_hash_unshare(), vt_finalize(), and vt_initialize().
|
static |
Alloc pool for struct variable_def with a single var_part entry.
Referenced by onepart_pool(), vt_finalize(), and vt_initialize().
|
static |
Alloc pool for struct variable_def with MAX_VAR_PARTS entries.
Referenced by onepart_pool(), vt_finalize(), and vt_initialize().
|
static |
Referenced by variable_union(), and vt_finalize().
|
static |
Buffer for location list sorting and its allocated size.
Referenced by variable_union(), and vt_finalize().
|
static |
Vector of windowed parameter registers, if any.
Referenced by adjust_insn(), vt_add_function_parameter(), and vt_finalize().