GCC Middle and Back End API Reference
|
#include "config.h"
#include "system.h"
#include "coretypes.h"
#include "backend.h"
#include "target.h"
#include "rtl.h"
#include "tree.h"
#include "cfghooks.h"
#include "alloc-pool.h"
#include "tree-pass.h"
#include "memmodel.h"
#include "tm_p.h"
#include "insn-config.h"
#include "regs.h"
#include "emit-rtl.h"
#include "recog.h"
#include "diagnostic.h"
#include "varasm.h"
#include "stor-layout.h"
#include "cfgrtl.h"
#include "cfganal.h"
#include "reload.h"
#include "ira.h"
#include "lra.h"
#include "calls.h"
#include "tree-dfa.h"
#include "tree-ssa.h"
#include "cselib.h"
#include "tree-pretty-print.h"
#include "rtl-iter.h"
#include "fibonacci_heap.h"
#include "print-rtl.h"
#include "function-abi.h"
#include "mux-utils.h"
Data Structures | |
struct | micro_operation |
struct | attrs |
struct | location_chain |
struct | loc_exp_dep |
struct | expand_depth |
struct | onepart_aux |
struct | variable_part |
union | variable_part::variable_aux |
struct | variable |
struct | variable_hasher |
struct | emit_note_data |
struct | shared_hash |
struct | dataflow_set |
struct | variable_tracking_info |
class | adjust_mem_data |
struct | overlapping_mems |
struct | variable_union_info |
struct | dfset_merge |
struct | dfset_post_merge |
struct | count_use_info |
class | expand_loc_callback_data |
Macros | |
#define | MAX_VAR_PARTS 16 |
#define | VTI(BB) |
#define | VAR_PART_OFFSET(var, i) |
#define | VAR_LOC_1PAUX(var) |
#define | VAR_LOC_DEP_LST(var) |
#define | VAR_LOC_DEP_LSTP(var) |
#define | VAR_LOC_FROM(var) |
#define | VAR_LOC_DEPTH(var) |
#define | VAR_LOC_DEP_VEC(var) |
#define | VALUE_RECURSED_INTO(x) |
#define | NO_LOC_P(x) |
#define | VALUE_CHANGED(x) |
#define | DECL_CHANGED(x) |
#define | RETRUE |
#define | VAL_NEEDS_RESOLUTION(x) |
#define | VAL_HOLDS_TRACK_EXPR(x) |
#define | VAL_EXPR_IS_COPIED(x) |
#define | VAL_EXPR_IS_CLOBBERED(x) |
#define | EXPR_DEPTH (INT_MAX) |
#define | EXPR_USE_DEPTH (param_max_vartrack_expr_depth) |
#define | INIT_ELCD(d, v) |
#define | FINI_ELCD(d, l) |
Typedefs | |
typedef fibonacci_heap< long, basic_block_def > | bb_heap_t |
typedef pointer_mux< tree_node, rtx_def > | decl_or_value |
typedef vec< loc_exp_dep, va_heap, vl_embed > | deps_vec |
typedef unsigned int | dvuid |
typedef hash_table< variable_hasher > | variable_table_type |
typedef variable_table_type::iterator | variable_iterator_type |
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 } |
#define DECL_CHANGED | ( | x | ) |
Whether cur_loc in the decl needs to be (re)computed.
Referenced by dv_changed_p(), set_dv_changed(), and track_expr_p().
#define EXPR_DEPTH (INT_MAX) |
This is the value used during expansion of locations. We want it to be unbounded, so that variables expanded deep in a recursion nest are fully evaluated, so that their values are cached correctly. We avoid recursion cycles through other means, and we don't unshare RTL, so excess complexity is not a problem.
Referenced by vt_expand_loc(), vt_expand_loc_callback(), and vt_expand_var_loc_chain().
#define EXPR_USE_DEPTH (param_max_vartrack_expr_depth) |
We use this to keep too-complex expressions from being emitted as location notes, and then to debug information. Users can trade compile time for ridiculously complex expressions, although they're seldom useful, and they may often have to be discarded as not representable anyway.
Referenced by vt_expand_var_loc_chain().
#define FINI_ELCD | ( | d, | |
l ) |
Finalize expand_loc_callback_data D, resolved to location L.
Referenced by vt_expand_1pvar(), and vt_expand_loc().
#define INIT_ELCD | ( | d, | |
v ) |
Initialize expand_loc_callback_data D with variable hash table V. It must be a macro because of alloca (vec stack).
Referenced by vt_expand_1pvar(), and vt_expand_loc().
#define MAX_VAR_PARTS 16 |
Maximum number of location parts.
Referenced by emit_note_insn_var_location(), set_slot_part(), track_expr_p(), track_offset_p(), variable_union(), and vt_get_decl_and_offset().
#define NO_LOC_P | ( | x | ) |
Whether no expansion was found, saving useless lookups. It must only be set when VALUE_CHANGED is clear.
Referenced by notify_dependents_of_resolved_value(), resolve_expansions_pending_recursion(), set_dv_changed(), and vt_expand_loc_callback().
#define RETRUE |
Referenced by dataflow_set_different().
#define VAL_EXPR_IS_CLOBBERED | ( | x | ) |
Whether the location in the CONCAT should be handled like a MO_CLOBBER as well.
Referenced by add_stores(), compute_bb_dataflow(), and emit_notes_in_bb().
#define VAL_EXPR_IS_COPIED | ( | x | ) |
Whether the location in the CONCAT should be handled like a MO_COPY as well.
Referenced by add_stores(), compute_bb_dataflow(), and emit_notes_in_bb().
#define VAL_HOLDS_TRACK_EXPR | ( | x | ) |
Whether the location in the CONCAT is a tracked expression, that should also be handled like a MO_USE.
Referenced by add_stores(), add_uses(), compute_bb_dataflow(), and emit_notes_in_bb().
#define VAL_NEEDS_RESOLUTION | ( | x | ) |
Tell whether the CONCAT used to holds a VALUE and its location needs value resolution, i.e., an attempt of mapping the location back to other incoming values.
Referenced by add_stores(), add_uses(), compute_bb_dataflow(), and emit_notes_in_bb().
#define VALUE_CHANGED | ( | x | ) |
Whether cur_loc in the value needs to be (re)computed.
Referenced by dv_changed_p(), and set_dv_changed().
#define VALUE_RECURSED_INTO | ( | x | ) |
Whether the value is currently being expanded.
Referenced by canonicalize_values_mark(), canonicalize_values_star(), dataflow_set_equiv_regs(), find_mem_expr_in_1pdv(), intersect_loc_chains(), loc_exp_dep_set(), notify_dependents_of_resolved_value(), remove_duplicate_values(), resolve_expansions_pending_recursion(), variable_merge_over_cur(), variable_post_merge_new_vals(), and vt_expand_loc_callback().
#define VAR_LOC_1PAUX | ( | var | ) |
Referenced by dataflow_set_remove_mem_locs(), delete_slot_part(), drop_overlapping_mem_locs(), emit_notes_for_differences_1(), loc_exp_dep_alloc(), recover_dropped_1paux(), set_slot_part(), unshare_variable(), var_loc_dep_vec(), variable_from_dropped(), variable_htab_free(), variable_merge_over_cur(), variable_was_changed(), and vt_expand_loc_callback().
#define VAR_LOC_DEP_LST | ( | var | ) |
These are accessor macros for the one-part auxiliary data. When convenient for users, they're guarded by tests that the data was allocated.
Referenced by loc_exp_dep_alloc(), loc_exp_insert_dep(), notify_dependents_of_changed_value(), notify_dependents_of_resolved_value(), and variable_htab_free().
#define VAR_LOC_DEP_LSTP | ( | var | ) |
Referenced by loc_exp_dep_alloc(), and loc_exp_insert_dep().
#define VAR_LOC_DEP_VEC | ( | var | ) |
Referenced by loc_exp_dep_alloc(), loc_exp_dep_clear(), loc_exp_dep_set(), and loc_exp_insert_dep().
#define VAR_LOC_DEPTH | ( | var | ) |
Referenced by loc_exp_dep_alloc(), and vt_expand_var_loc_chain().
#define VAR_LOC_FROM | ( | var | ) |
Referenced by dataflow_set_remove_mem_locs(), delete_slot_part(), drop_overlapping_mem_locs(), loc_exp_dep_alloc(), and vt_expand_var_loc_chain().
#define VAR_PART_OFFSET | ( | var, | |
i ) |
#define VTI | ( | BB | ) |
Pointer to the BB's information specific to variable tracking pass.
Referenced by add_stores(), add_uses(), add_with_sets(), adjust_insn(), compute_bb_dataflow(), dump_dataflow_sets(), emit_notes_in_bb(), log_op_type(), prepare_call_arguments(), vt_add_function_parameter(), vt_emit_notes(), vt_finalize(), vt_find_locations(), vt_initialize(), and vt_stack_adjustments().
typedef fibonacci_heap<long, basic_block_def> bb_heap_t |
Variable tracking routines for the GNU compiler. Copyright (C) 2002-2024 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).
typedef pointer_mux<tree_node, rtx_def> decl_or_value |
A declaration of a variable, or an RTL value being handled like a declaration by pointer_mux.
typedef vec<loc_exp_dep, va_heap, vl_embed> deps_vec |
Type for dependencies actively used when expand FROM into cur_loc.
typedef unsigned int dvuid |
typedef hash_table<variable_hasher> variable_table_type |
enum emit_note_where |
enum micro_operation_type |
enum onepart_enum |
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 ACCUMULATE_OUTGOING_ARGS, arg_pointer_rtx, count_use_info::bb, cfa_base_rtx, cselib_lookup(), cselib_preserved_value_p(), cselib_set_value_sp_based(), cselib_sp_derived_value_p(), DECL_INCOMING_RTL, DECL_MODE, dump_file, dump_flags, find_use_val(), frame_pointer_needed, gcc_assert, gcc_checking_assert, get_address_mode(), GET_CODE, GET_MODE, hard_frame_pointer_adjustment, count_use_info::insn, micro_operation::insn, int_mem_offset(), micro_operation::loc, log_op_type(), MEM_EXPR, MEM_P, MO_CLOBBER, MO_COPY, MO_SET, MO_USE, MO_VAL_SET, MO_VAL_USE, NULL, NULL_RTX, PATTERN(), preserve_value(), REG_EXPR, REG_OFFSET, REG_P, replace_expr_with_values(), reverse_op(), same_variable_part_p(), SET, SET_DEST, SET_SRC, count_use_info::sets, stack_pointer_rtx, TDF_DETAILS, tracked_record_parameter_p(), TREE_CODE, micro_operation::type, micro_operation::u, unsuitable_loc(), VAL_EXPR_IS_CLOBBERED, VAL_EXPR_IS_COPIED, VAL_HOLDS_TRACK_EXPR, VAL_NEEDS_RESOLUTION, cselib_val::val_rtx, var_lowpart(), VTI, and XEXP.
Referenced by add_with_sets().
|
static |
Add uses (register and memory references) LOC which will be tracked to VTI (bb)->mos.
References count_use_info::bb, CONSTANT_P, cselib_lookup(), cselib_preserved_value_p(), dump_file, dump_flags, find_use_val(), gcc_assert, gcc_checking_assert, gen_rtx_UNKNOWN_VAR_LOC, get_address_mode(), GET_CODE, GET_MODE, count_use_info::insn, micro_operation::insn, micro_operation::loc, log_op_type(), MEM_P, MO_CLOBBER, MO_USE, MO_USE_NO_VAR, MO_VAL_LOC, MO_VAL_USE, non_suitable_const(), NULL, PAT_VAR_LOCATION_LOC, preserve_value(), REG_P, replace_expr_with_values(), count_use_info::sets, shallow_copy_rtx(), TDF_DETAILS, micro_operation::type, type(), micro_operation::u, unsuitable_loc(), VAL_HOLDS_TRACK_EXPR, VAL_NEEDS_RESOLUTION, cselib_val::val_rtx, VAR_LOC_UNKNOWN_P, var_lowpart(), VTI, and XEXP.
Referenced by add_uses_1().
|
static |
Helper function for finding all uses of REG/MEM in X in insn INSN.
References add_uses(), and FOR_EACH_SUBRTX_VAR.
Referenced by add_with_sets().
|
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, BLOCK_FOR_INSN(), call_arguments, CALL_P, cselib_hook_called, dump_file, dump_flags, count_use_info::insn, micro_operation::insn, micro_operation::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(), NULL_RTX, PATTERN(), count_use_info::sets, count_use_info::store_p, TDF_DETAILS, micro_operation::type, micro_operation::u, and VTI.
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(), ASM_OPERANDS_INPUT_CONSTRAINT_VEC, ASM_OPERANDS_INPUT_VEC, ASM_OPERANDS_LABEL_VEC, ASM_OPERANDS_OUTPUT_IDX, COND_EXEC_CODE, CONSTANT_P, find_reg_equal_equiv_note(), find_reg_note(), FOR_EACH_VEC_ELT_REVERSE, FOR_EACH_VEC_SAFE_ELT, gcc_checking_assert, gen_raw_REG(), GET_CODE, GET_MODE, i, adjust_mem_data::mem_mode, MEM_P, MEM_READONLY_P, note_stores(), note_uses(), NULL_RTX, PATTERN(), REGNO, rtvec_alloc(), RTX_FRAME_RELATED_P, SET, SET_SRC, shallow_copy_rtx(), adjust_mem_data::side_effects, single_set(), adjust_mem_data::stack_adjust, adjust_mem_data::store, validate_change(), vec_safe_length(), VTI, XEXP, XVECEXP, and XVECLEN.
Referenced by vt_initialize().
Helper function for replacement of stores.
References adjust_mems(), CONST_CAST_RTX, MEM_P, NULL_RTX, SET_DEST, simplify_replace_fn_rtx(), and validate_change().
Referenced by adjust_insn().
|
static |
Helper function for replacement of uses.
References adjust_mems(), NULL_RTX, simplify_replace_fn_rtx(), and validate_change().
Referenced by adjust_insn().
Helper function for adjusting used MEMs.
References adjust_mems(), ASM_OPERANDS_OUTPUT_IDX, avoid_constant_pool_reference(), cfa_base_rtx, compute_cfa_pointer(), frame_pointer_needed, gcc_assert, gcc_checking_assert, GET_CODE, GET_MODE, GET_MODE_PRECISION(), GET_MODE_SIZE(), hard_frame_pointer_adjustment, hard_frame_pointer_rtx, is_a(), MAY_HAVE_DEBUG_BIND_INSNS, adjust_mem_data::mem_mode, MEM_P, NULL_RTX, plus_constant(), replace_equiv_address_nv(), adjust_mem_data::side_effects, simplify_gen_subreg(), simplify_replace_fn_rtx(), adjust_mem_data::stack_adjust, stack_pointer_rtx, adjust_mem_data::store, SUBREG_BYTE, subreg_lowpart_p(), SUBREG_REG, targetm, use_narrower_mode(), use_narrower_mode_test(), virtual_incoming_args_rtx, and XEXP.
Referenced by adjust_mem_stores(), adjust_mem_uses(), adjust_mems(), and prepare_call_arguments().
|
static |
Make the list *LISTP empty.
References attrs::next, and NULL.
Referenced by attrs_list_copy(), dataflow_set_clear(), and dataflow_set_destroy().
Copy all nodes from SRC and create a list *DSTP of the copies.
References attrs, attrs_list_clear(), attrs::dv, attrs::loc, attrs::next, and attrs::offset.
Referenced by dataflow_set_copy().
|
static |
Insert the triplet DECL, OFFSET, LOC to the list *LISTP.
References attrs, attrs::dv, attrs::loc, attrs::next, attrs::offset, and offset.
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 |
Return true if the pair of DECL and OFFSET is the member of the LIST.
References attrs::dv, attrs::next, NULL, attrs::offset, and offset.
Referenced by attrs_list_mpdv_union(), and attrs_list_union().
Combine nodes that are not onepart nodes from SRC and SRC2 into *DSTP.
References attrs_list_insert(), attrs_list_member(), attrs::dv, dv_onepart_p(), gcc_assert, attrs::loc, attrs::next, and attrs::offset.
Referenced by dataflow_set_merge().
Add all nodes from SRC which are not in *DSTP to *DSTP.
References attrs_list_insert(), attrs_list_member(), attrs::dv, attrs::loc, attrs::next, and attrs::offset.
Referenced by dataflow_set_union().
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.
References CSELIB_VAL_PTR.
Referenced by canonicalize_values_mark(), canonicalize_values_star(), canonicalize_vars_star(), dataflow_set_equiv_regs(), find_loc_in_1pdv(), get_addr_from_local_cache(), loc_cmp(), set_slot_part(), and val_reset().
int canonicalize_loc_order_check | ( | variable ** | slot, |
dataflow_set * | data ) |
Check the order of entries in one-part variables.
References variable_part::cur_loc, gcc_assert, i, variable::in_changed_variables, location_chain::loc, variable_part::loc_chain, loc_cmp(), variable::n_var_parts, location_chain::next, NULL, variable::onepart, and variable::var_part.
Referenced by compute_bb_dataflow(), and vt_find_locations().
int canonicalize_values_mark | ( | variable ** | slot, |
dataflow_set * | set ) |
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::dv, dv_as_value(), dv_from_value(), dv_is_value_p(), gcc_checking_assert, GET_CODE, location_chain::init, location_chain::loc, variable_part::loc_chain, variable::n_var_parts, location_chain::next, NULL_RTX, set_slot_part(), shared_hash_find_slot_noinsert(), VALUE_RECURSED_INTO, and variable::var_part.
Referenced by compute_bb_dataflow().
int canonicalize_values_star | ( | variable ** | slot, |
dataflow_set * | set ) |
Remove redundant entries from equivalence lists in onepart variables, canonicalizing equivalence sets into star shapes.
References canon_value_cmp(), clobber_slot_part(), clobber_variable_part(), attrs::dv, variable::dv, dv_as_value(), dv_from_value(), dv_is_decl_p(), dv_is_value_p(), gcc_assert, gcc_checking_assert, gcc_unreachable, GET_CODE, location_chain::init, location_chain::loc, variable_part::loc_chain, variable::n_var_parts, attrs::next, location_chain::next, NULL, NULL_RTX, attrs::offset, variable::onepart, REGNO, set_slot_part(), set_variable_part(), shared_hash_find_slot_noinsert(), VALUE_RECURSED_INTO, VAR_INIT_STATUS_INITIALIZED, and variable::var_part.
Referenced by compute_bb_dataflow(), dataflow_post_merge_adjust(), dataflow_set_equiv_regs(), and variable_merge_over_cur().
int canonicalize_vars_star | ( | variable ** | slot, |
dataflow_set * | set ) |
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::dv, dv_from_value(), gcc_assert, GET_CODE, location_chain::init, location_chain::loc, variable_part::loc_chain, variable::n_var_parts, location_chain::next, variable::onepart, ONEPART_VALUE, set_slot_part(), location_chain::set_src, shared_hash_find_slot_noinsert(), and variable::var_part.
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(), gcc_checking_assert, GET_CODE, overlapping_mems::loc, NULL, overlapping_mems::set, shared_hash_htab(), hash_table< Descriptor, Lazy, Allocator >::traverse(), vt_canonicalize_addr(), and XEXP.
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 delete_slot_part(), attrs::dv, variable::dv, find_variable_location_part(), location_chain::loc, variable_part::loc_chain, MEM_P, attrs::next, location_chain::next, NULL, attrs::offset, offset, REG_P, REGNO, rtx_equal_p(), location_chain::set_src, and variable::var_part.
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(), DECL_P, dv_as_decl(), dv_is_value_p(), offset, 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 |
Compute the changes of variable locations in the basic block BB.
References micro_operation::adjust, count_use_info::bb, 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(), FOR_EACH_VEC_ELT, gcc_assert, gcc_checking_assert, GET_CODE, i, count_use_info::insn, micro_operation::insn, micro_operation::loc, local_get_addr_cache, MAY_HAVE_DEBUG_BIND_INSNS, MEM_ATTRS, MEM_P, 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, NULL, NULL_RTX, PAT_VAR_LOCATION_DECL, PAT_VAR_LOCATION_LOC, REG_P, REGNO, SET, SET_DEST, SET_SRC, set_variable_part(), shared_hash_htab(), dataflow_set::stack_adjust, hash_table< Descriptor, Lazy, Allocator >::traverse(), micro_operation::type, micro_operation::u, VAL_EXPR_IS_CLOBBERED, VAL_EXPR_IS_COPIED, VAL_HOLDS_TRACK_EXPR, VAL_NEEDS_RESOLUTION, val_resolve(), val_store(), VAR_INIT_STATUS_INITIALIZED, VAR_INIT_STATUS_UNINITIALIZED, VAR_INIT_STATUS_UNKNOWN, VAR_LOC_UNKNOWN_P, 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(), dataflow_set::vars, VTI, and XEXP.
Referenced by vt_find_locations().
|
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 |
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, Lazy, Allocator >::traverse(), variable_post_merge_new_vals(), and variable_post_merge_perm_vals().
Referenced by vt_find_locations().
|
static |
Delete the contents of dataflow set SET.
References attrs_list_clear(), empty_shared_hash, i, shared_hash_copy(), and shared_hash_destroy().
Referenced by emit_notes_in_bb(), vt_emit_notes(), and vt_find_locations().
|
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(), EXECUTE_IF_SET_IN_HARD_REG_SET, function_abi::full_reg_clobbers(), insn_callee_abi(), MAY_HAVE_DEBUG_BIND_INSNS, NULL, r, dfset_post_merge::set, shared_hash_htab(), hash_table< Descriptor, Lazy, Allocator >::traverse(), and var_regno_delete().
Referenced by compute_bb_dataflow(), and emit_notes_in_bb().
|
static |
Copy the contents of dataflow set SRC to DST.
References attrs_list_copy(), i, dataflow_set::regs, shared_hash_copy(), shared_hash_destroy(), dataflow_set::stack_adjust, and dataflow_set::vars.
Referenced by compute_bb_dataflow(), emit_notes_in_bb(), and vt_find_locations().
|
static |
Free the contents of dataflow set SET.
References attrs_list_clear(), i, NULL, and shared_hash_destroy().
Referenced by compute_bb_dataflow(), dataflow_set_merge(), vt_emit_notes(), and vt_finalize().
|
static |
Return true if dataflow sets OLD_SET and NEW_SET differ.
References dump_file, dump_flags, dump_onepart_variable_differences(), dump_var(), variable::dv, dv_htab_hash(), dv_onepart_p(), hash_table< Descriptor, Lazy, Allocator >::elements(), hash_table< Descriptor, Lazy, Allocator >::find_with_hash(), FOR_EACH_HASH_TABLE_ELEMENT, RETRUE, shared_hash_htab(), TDF_DETAILS, variable_different_p(), and dataflow_set::vars.
Referenced by compute_bb_dataflow().
|
static |
Mark register equivalences.
References canon_value_cmp(), canonicalize_values_star(), attrs::dv, dv_as_value(), dv_from_value(), dv_is_value_p(), dv_onepart_p(), GET_MODE, i, attrs::loc, attrs::next, NULL, attrs::offset, set_variable_part(), shared_hash_find_slot_noinsert(), VALUE_RECURSED_INTO, and VAR_INIT_STATUS_INITIALIZED.
Referenced by compute_bb_dataflow().
|
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(), NULL, and shared_hash_copy().
Referenced by compute_bb_dataflow(), dataflow_set_merge(), variable_post_merge_new_vals(), vt_emit_notes(), and vt_initialize().
|
static |
Combine dataflow set information from SRC2 into DST, using PDST to carry over information across passes.
References attrs_list_mpdv_union(), dfset_merge::cur, dataflow_set_destroy(), dataflow_set_init(), dfset_merge::dst, dst_can_be_shared, hash_table< Descriptor, Lazy, Allocator >::elements(), FOR_EACH_HASH_TABLE_ELEMENT, shared_hash::htab, i, MAX, shared_hash::refcount, dataflow_set::regs, shared_hash_destroy(), shared_hash_htab(), dfset_merge::src, dfset_merge::src_onepart_cnt, dataflow_set::stack_adjust, variable_merge_over_cur(), variable_merge_over_src(), and dataflow_set::vars.
Referenced by vt_find_locations().
int dataflow_set_preserve_mem_locs | ( | variable ** | slot, |
dataflow_set * | set ) |
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_part::cur_loc, variable::dv, dv_as_decl(), emit_notes, find_mem_expr_in_1pdv(), gcc_assert, GET_CODE, location_chain::init, int_mem_offset(), location_chain::loc, variable_part::loc_chain, mem_dies_at_call(), MEM_EXPR, MIN, variable::n_var_parts, location_chain::next, NULL, variable::onepart, ONEPART_DEXPR, ONEPART_VDECL, location_chain::set_src, shared_hash_htab(), shared_var_p(), unshare_variable(), VAR_INIT_STATUS_UNKNOWN, variable::var_part, and variable_was_changed().
Referenced by dataflow_set_clear_at_call().
int dataflow_set_remove_mem_locs | ( | variable ** | slot, |
dataflow_set * | set ) |
Remove all MEMs from the location list of a hash table entry for a onepart variable.
References changed, variable_part::cur_loc, gcc_assert, GET_CODE, location_chain::loc, variable_part::loc_chain, mem_dies_at_call(), variable::n_var_parts, location_chain::next, NOT_ONEPART, NULL, variable::onepart, shared_var_p(), unshare_variable(), VAR_INIT_STATUS_UNKNOWN, VAR_LOC_1PAUX, VAR_LOC_FROM, variable::var_part, and variable_was_changed().
Referenced by dataflow_set_clear_at_call().
|
static |
Compute union of dataflow sets SRC and DST and store it to DST.
References attrs_list_union(), empty_shared_hash, FOR_EACH_HASH_TABLE_ELEMENT, i, dataflow_set::regs, shared_hash_copy(), shared_hash_destroy(), shared_hash_htab(), variable_union(), and dataflow_set::vars.
Referenced by vt_find_locations().
|
extern |
References debug_generic_stmt(), debug_rtx(), dv_as_decl(), dv_as_value(), and dv_is_value_p().
|
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, variable_part::cur_loc, find_variable_location_part(), location_chain::loc, variable_part::loc_chain, variable::n_var_parts, location_chain::next, NULL, offset, variable::onepart, REG_P, REGNO, rtx_equal_p(), shared_var_p(), unshare_variable(), VAR_INIT_STATUS_UNKNOWN, VAR_LOC_1PAUX, VAR_LOC_FROM, variable::var_part, 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(), offset, 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().
|
inlinestatic |
Remove from the insn stream a single debug insn used for variable tracking at assignments.
References CODE_LABEL_NUMBER, debug_label_num, DEBUG_MARKER_INSN_P, DECL_NAME, DECL_RTL_SET_P, delete_insn(), IDENTIFIER_POINTER, INSN_VAR_LOCATION_DECL, NOTE_DELETED_LABEL_NAME, NOTE_KIND, PUT_CODE, reemit_marker_as_note(), SET_DECL_RTL, and TREE_CODE.
Referenced by delete_vta_debug_insns().
void delete_vta_debug_insns | ( | bool | use_cfg | ) |
Remove from the insn stream all debug insns used for variable tracking at assignments. USE_CFG should be false if the cfg is no longer usable.
References cfun, DEBUG_INSN_P, delete_vta_debug_insn(), FOR_BB_INSNS_SAFE, FOR_EACH_BB_FN, get_insns(), MAY_HAVE_DEBUG_INSNS, and NEXT_INSN().
Referenced by rest_of_handle_final(), variable_tracking_main_1(), and vt_debug_insns_local().
int drop_overlapping_mem_locs | ( | variable ** | slot, |
overlapping_mems * | coms ) |
Remove all MEMs that overlap with COMS->LOC from the location list of a hash table entry for a onepart variable. COMS->ADDR must be a canonicalized form of COMS->LOC's address, and COMS->LOC must be canonicalized itself.
References overlapping_mems::addr, changed, variable_part::cur_loc, gcc_assert, location_chain::loc, overlapping_mems::loc, variable_part::loc_chain, variable::n_var_parts, location_chain::next, NOT_ONEPART, NULL, variable::onepart, overlapping_mems::set, shared_var_p(), unshare_variable(), VAR_INIT_STATUS_UNKNOWN, VAR_LOC_1PAUX, VAR_LOC_FROM, variable::var_part, variable_was_changed(), and vt_canon_true_dep().
Referenced by clobber_overlapping_mems().
|
static |
Print the content of the LIST to dump file.
References dump_file, attrs::dv, dv_as_decl(), dv_as_value(), dv_is_decl_p(), HOST_WIDE_INT_PRINT_DEC, attrs::next, attrs::offset, print_mem_expr(), and print_rtl_single().
Referenced by dump_dataflow_set().
|
static |
Print the dataflow set SET to dump file.
References dump_attrs_list(), dump_file, dump_vars(), HOST_WIDE_INT_PRINT_DEC, i, and shared_hash_htab().
Referenced by dump_dataflow_sets(), and vt_find_locations().
|
static |
Print the IN and OUT sets for each basic block to dump file.
References count_use_info::bb, cfun, dump_dataflow_set(), dump_file, FOR_EACH_BB_FN, basic_block_def::index, and VTI.
Referenced by variable_tracking_main_1().
Return true if one-part variables VAR1 and VAR2 are different. They must be in canonical order.
References dump_file, variable::dv, gcc_assert, gcc_unreachable, location_chain::loc, variable_part::loc_chain, loc_cmp(), variable::n_var_parts, location_chain::next, print_rtl_single(), and variable::var_part.
Referenced by dataflow_set_different().
|
static |
Print the information about variable VAR to dump file.
References DEBUG_TEMP_UID, DECL_NAME, DECL_UID, dump_file, dump_flags, variable::dv, dv_as_decl(), dv_as_value(), dv_is_decl_p(), fputc(), HOST_WIDE_INT_PRINT_DEC, i, IDENTIFIER_POINTER, location_chain::init, location_chain::loc, variable_part::loc_chain, variable::n_var_parts, location_chain::next, variable::onepart, print_rtl_single(), TDF_UID, TREE_CODE, VAR_INIT_STATUS_UNINITIALIZED, variable::var_part, and VAR_PART_OFFSET.
Referenced by dataflow_set_different(), and dump_var_tracking_slot().
int dump_var_tracking_slot | ( | variable ** | slot, |
void * | data ) |
Print the information about variable *SLOT to dump file.
References dump_var().
Referenced by dump_vars().
|
static |
Print the information about variables from hash table VARS to dump file.
References dump_file, dump_var_tracking_slot(), hash_table< Descriptor, Lazy, Allocator >::is_empty(), NULL, and hash_table< Descriptor, Lazy, Allocator >::traverse().
Referenced by dump_dataflow_set().
|
inlinestatic |
Return the decl in the decl_or_value.
References dv_is_decl_p(), gcc_checking_assert, and pointer_mux< T1, T2 >::known_first().
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 DEBUG_EXPR of a DEBUG_EXPR_DECL or the VALUE in DV.
References DECL_RTL_KNOWN_SET, dv_as_decl(), dv_as_value(), dv_is_value_p(), gcc_checking_assert, and TREE_CODE.
Referenced by notify_dependents_of_changed_value().
|
inlinestatic |
Return the value in the decl_or_value.
References dv_is_value_p(), gcc_checking_assert, and pointer_mux< T1, T2 >::known_second().
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 DECL_CHANGED, dv_as_decl(), dv_as_value(), dv_is_value_p(), and VALUE_CHANGED.
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 dv_is_decl_p(), and gcc_checking_assert.
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 DEBUG_EXPR_TREE_DECL, DECL_RTL_KNOWN_SET, dv_from_decl(), dv_from_value(), gcc_checking_assert, gcc_unreachable, and GET_CODE.
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 dv_is_value_p(), and gcc_checking_assert.
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.
References pointer_mux< T1, T2 >::is_first().
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(), MAY_HAVE_DEBUG_BIND_INSNS, NOT_ONEPART, NULL_TREE, ONEPART_DEXPR, ONEPART_VALUE, ONEPART_VDECL, target_for_debug_bind(), and TREE_CODE.
Referenced by attrs_list_mpdv_union(), dataflow_set_different(), dataflow_set_equiv_regs(), notify_dependents_of_changed_value(), notify_dependents_of_resolved_value(), set_dv_changed(), set_slot_part(), var_reg_delete(), variable_from_dropped(), and vt_add_function_parameter().
|
inlinestatic |
Return the uid of DV.
References CSELIB_VAL_PTR, DECL_UID, 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 | ( | variable ** | varp, |
emit_note_data * | data ) |
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 adjust_address_nv, changed_variables, hash_table< Descriptor, Lazy, Allocator >::clear_slot(), variable_part::cur_loc, DECL_MODE, variable::dv, dv_as_decl(), emit_note_after(), EMIT_NOTE_AFTER_CALL_INSN, emit_note_before(), EMIT_NOTE_BEFORE_INSN, end_hard_regno(), gcc_assert, gcc_checking_assert, GEN_INT, gen_rtvec_v(), gen_rtx_EXPR_LIST(), gen_rtx_VAR_LOCATION(), GET_CODE, GET_MODE, GET_MODE_SIZE(), GET_MODE_WIDER_MODE(), hard_regno_nregs(), i, variable::in_changed_variables, location_chain::init, initialized, known_eq, location_chain::loc, variable_part::loc_chain, loc_exp_insert_dep(), MAX_VAR_PARTS, MEM_P, variable::n_var_parts, location_chain::next, NEXT_INSN(), NOT_ONEPART, NOTE_DURING_CALL_P, NOTE_KIND, NOTE_P, NOTE_VAR_LOCATION, NULL, NULL_RTX, offset, variable::onepart, ONEPART_VDECL, poly_int_rtx_p(), REG_ATTRS, REG_P, REGNO, rtx_equal_p(), set_dv_changed(), simplify_subreg(), strip_offset_and_add(), tree_to_poly_uint64(), TREE_TYPE, TYPE_SIZE_UNIT, VAR_INIT_STATUS_INITIALIZED, VAR_INIT_STATUS_UNINITIALIZED, variable::var_part, VAR_PART_OFFSET, expand_loc_callback_data::vars, vt_expand_1pvar(), vt_expand_loc(), and XEXP.
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, emit_note_insn_var_location(), hash_table< Descriptor, Lazy, Allocator >::is_empty(), MAY_HAVE_DEBUG_BIND_INSNS, process_changed_values(), shared_hash_htab(), hash_table< Descriptor, Lazy, Allocator >::traverse(), and expand_loc_callback_data::vars.
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, Lazy, Allocator >::traverse(), and dataflow_set::vars.
Referenced by vt_emit_notes().
int emit_notes_for_differences_1 | ( | variable ** | slot, |
variable_table_type * | new_vars ) |
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_part::cur_loc, variable::dv, dv_htab_hash(), hash_table< Descriptor, Lazy, Allocator >::find_with_hash(), gcc_checking_assert, variable::in_changed_variables, variable_part::loc_chain, variable::n_var_parts, NULL, variable::onepart, ONEPART_DEXPR, onepart_pool_allocate(), ONEPART_VALUE, variable::refcount, VAR_LOC_1PAUX, variable::var_part, 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 | ( | variable ** | slot, |
variable_table_type * | old_vars ) |
Add variable *SLOT to the chain CHANGED_VARIABLES if it is not in hash table DATA.
References variable_part::cur_loc, variable::dv, dv_htab_hash(), hash_table< Descriptor, Lazy, Allocator >::find_with_hash(), i, variable::n_var_parts, NULL, variable::var_part, and variable_was_changed().
Referenced by emit_notes_for_differences().
|
static |
Emit the notes for changes of location parts in the basic block BB.
References add_reg_note(), micro_operation::adjust, clobber_overlapping_mems(), clobber_variable_part(), copy_rtx_if_shared(), dataflow_set_clear(), dataflow_set_clear_at_call(), dataflow_set_copy(), dv_from_decl(), EMIT_NOTE_AFTER_CALL_INSN, EMIT_NOTE_AFTER_INSN, EMIT_NOTE_BEFORE_INSN, emit_notes_for_changes(), find_src_set_src(), find_src_status(), FOR_EACH_VEC_ELT, gcc_assert, gcc_checking_assert, GET_CODE, i, micro_operation::insn, micro_operation::loc, MEM_ATTRS, MEM_P, 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(), NULL, NULL_RTX, PAT_VAR_LOCATION_DECL, PAT_VAR_LOCATION_LOC, REG_P, REGNO, SET, SET_DEST, SET_SRC, set_variable_part(), shared_hash_htab(), micro_operation::type, micro_operation::u, VAL_EXPR_IS_CLOBBERED, VAL_EXPR_IS_COPIED, VAL_HOLDS_TRACK_EXPR, VAL_NEEDS_RESOLUTION, val_resolve(), val_store(), VAR_INIT_STATUS_INITIALIZED, VAR_INIT_STATUS_UNINITIALIZED, VAR_LOC_UNKNOWN_P, 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(), vt_expand_loc(), VTI, and XEXP.
Referenced by vt_emit_notes().
|
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::dv, dv_as_value(), dv_from_value(), dv_htab_hash(), dv_is_value_p(), find_loc_in_1pdv(), hash_table< Descriptor, Lazy, Allocator >::find_with_hash(), gcc_checking_assert, GET_CODE, location_chain::loc, variable_part::loc_chain, variable::n_var_parts, location_chain::next, NULL, variable::onepart, rtx_equal_p(), and variable::var_part.
Referenced by find_loc_in_1pdv(), intersect_loc_chains(), and variable_post_merge_perm_vals().
|
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 dv_from_value(), dv_htab_hash(), find_mem_expr_in_1pdv(), hash_table< Descriptor, Lazy, Allocator >::find_with_hash(), gcc_assert, GET_CODE, int_mem_offset(), location_chain::loc, variable_part::loc_chain, MEM_EXPR, MEM_P, variable::n_var_parts, location_chain::next, NULL, variable::onepart, VALUE_RECURSED_INTO, and variable::var_part.
Referenced by dataflow_set_preserve_mem_locs(), and find_mem_expr_in_1pdv().
|
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 dv_from_decl(), i, location_chain::loc, variable_part::loc_chain, MEM_EXPR, MEM_P, variable::n_var_parts, location_chain::next, NULL_RTX, NULL_TREE, REG_EXPR, REG_P, rtx_equal_p(), location_chain::set_src, shared_hash_find(), var_debug_decl(), and variable::var_part.
Referenced by compute_bb_dataflow(), and emit_notes_in_bb().
|
static |
References dv_from_decl(), get_init_value(), MEM_EXPR, MEM_P, NULL_TREE, REG_EXPR, REG_P, 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, i, MEM_P, count_use_info::n_sets, NULL, 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::n_var_parts, offset, variable::onepart, and VAR_PART_OFFSET.
Referenced by clobber_slot_part(), delete_slot_part(), and set_slot_part().
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(), gcc_checking_assert, get_addr(), GET_CODE, global_get_addr_cache, NULL, 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(), dv_from_rtx(), gcc_checking_assert, get_addr_from_global_cache(), GET_CODE, location_chain::loc, variable_part::loc_chain, local_get_addr_cache, location_chain::next, shared_hash_find(), variable::var_part, vt_canonicalize_addr(), and vt_get_canonicalize_base().
Referenced by vt_canonicalize_addr().
|
static |
References i, location_chain::init, location_chain::loc, variable_part::loc_chain, variable::n_var_parts, location_chain::next, rtx_equal_p(), shared_hash_find(), VAR_INIT_STATUS_INITIALIZED, VAR_INIT_STATUS_UNKNOWN, and variable::var_part.
Referenced by find_src_status(), var_mem_delete_and_set(), and var_reg_delete_and_set().
|
static |
Return the offset of a register that track_offset_p says we should track.
References gcc_unreachable, offset, REG_OFFSET, and track_offset_p().
Referenced by var_reg_delete_and_set(), var_reg_set(), and vt_add_function_parameter().
|
static |
Initialize the set (array) SET of attrs to empty lists.
Referenced by dataflow_set_init().
|
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::init, location_chain::loc, loc_cmp(), MIN, location_chain::next, NULL, r, and location_chain::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(), GET_CODE, i, NULL_RTX, PATTERN(), RTX_FRAME_RELATED_P, SET, stack_adjust_offset_pre_post(), XEXP, XVECEXP, and XVECLEN.
Referenced by vt_initialize(), and vt_stack_adjustments().
|
inlinestatic |
Return MEM_OFFSET (MEM) as a HOST_WIDE_INT, or 0 if we can't.
References MEM_OFFSET, MEM_OFFSET_KNOWN_P, and offset.
Referenced by add_stores(), dataflow_set_preserve_mem_locs(), find_mem_expr_in_1pdv(), same_variable_part_p(), use_type(), var_mem_delete(), var_mem_delete_and_set(), var_mem_set(), and vt_get_decl_and_offset().
|
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, dv_from_value(), find_loc_in_1pdv(), gcc_checking_assert, GET_CODE, location_chain::init, insert_into_intersection(), intersect_loc_chains(), location_chain::loc, variable_part::loc_chain, MIN, variable::n_var_parts, location_chain::next, variable::onepart, shared_hash_find(), shared_hash_htab(), dfset_merge::src, VALUE_RECURSED_INTO, variable::var_part, and dataflow_set::vars.
Referenced by intersect_loc_chains(), and variable_merge_over_cur().
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(), CONST_WIDE_INT_ELT, CONST_WIDE_INT_NUNITS, CONST_WIDE_INT_P, DEBUG_EXPR_TREE_DECL, DEBUG_TEMP_UID, ENTRY_VALUE_EXP, gcc_assert, gcc_checking_assert, gcc_unreachable, GET_CODE, GET_MODE, GET_RTX_FORMAT, GET_RTX_LENGTH, i, loc_cmp(), MEM_P, r, REG_P, REGNO, RTX_CODE, SUBREG_BYTE, XEXP, XINT, XSTR, XVECEXP, XVECLEN, XWINT, and y.
Referenced by canonicalize_loc_order_check(), dump_onepart_variable_differences(), insert_into_intersection(), loc_cmp(), onepart_variable_different_p(), set_slot_part(), and variable_union().
|
static |
Allocate the one-part auxiliary data structure for VAR, with enough room for COUNT dependencies.
References count, deps, gcc_checking_assert, is_empty(), NULL, offsetof, variable::onepart, VAR_LOC_1PAUX, VAR_LOC_DEP_LST, VAR_LOC_DEP_LSTP, VAR_LOC_DEP_VEC, VAR_LOC_DEPTH, and VAR_LOC_FROM.
Referenced by loc_exp_dep_set(), and loc_exp_insert_dep().
|
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::next, loc_exp_dep::pprev, and VAR_LOC_DEP_VEC.
Referenced by variable_htab_free(), and vt_expand_var_loc_chain().
|
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 count, gcc_checking_assert, is_empty(), loc_exp_dep_alloc(), loc_exp_insert_dep(), NULL, VALUE_RECURSED_INTO, and VAR_LOC_DEP_VEC.
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::dv, variable::dv, dv_from_rtx(), dv_htab_hash(), hash_table< Descriptor, Lazy, Allocator >::find_with_hash(), gcc_checking_assert, loc_exp_dep_alloc(), loc_exp_dep::next, NOT_ONEPART, variable::onepart, loc_exp_dep::pprev, loc_exp_dep::value, VAR_LOC_DEP_LST, VAR_LOC_DEP_LSTP, VAR_LOC_DEP_VEC, and variable_from_dropped().
Referenced by emit_note_insn_var_location(), and loc_exp_dep_set().
Clear (canonical address) slots that reference X.
References NULL, and vt_get_canonicalize_base().
Referenced by val_reset().
|
inlinestatic |
Log to OUT information about micro-operation MOPT involving X in INSN of BB.
References fputc(), basic_block_def::index, INSN_UID(), micro_operation_type_name, print_inline_rtx(), and VTI.
Referenced by add_stores(), add_uses(), add_with_sets(), and vt_initialize().
rtl_opt_pass * make_pass_variable_tracking | ( | gcc::context * | ctxt | ) |
Return TRUE if the value of MEM may vary across a call.
References DECL_P, get_base_address(), is_global_var(), may_be_aliased(), MEM_EXPR, and TREE_READONLY.
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 i, and pow2_or_zerop().
Referenced by vt_canonicalize_addr(), and vt_get_canonicalize_base().
Return the next insn after INSN that is not a NOTE_INSN_VAR_LOCATION.
References NEXT_INSN(), NOTE_KIND, and NOTE_P.
Referenced by emit_notes_in_bb().
Helper function for MO_VAL_LOC handling. Return non-zero if any rtxes not suitable for CONST use not replaced by VALUEs are discovered.
References ALL, FOR_EACH_SUBRTX, GET_CODE, and MEM_READONLY_P.
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, variable_part::cur_loc, dropped_values, loc_exp_dep::dv, dv_as_rtx(), dv_changed_p(), dv_from_rtx(), dv_htab_hash(), dv_onepart_p(), hash_table< Descriptor, Lazy, Allocator >::find_slot_with_hash(), hash_table< Descriptor, Lazy, Allocator >::find_with_hash(), gcc_checking_assert, gcc_unreachable, GET_CODE, i, variable::n_var_parts, loc_exp_dep::next, NOT_ONEPART, NULL, ONEPART_DEXPR, ONEPART_VALUE, ONEPART_VDECL, loc_exp_dep::pprev, set_dv_changed(), VAR_LOC_DEP_LST, variable::var_part, variable_was_changed(), and XEXP.
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::dv, dv_as_value(), dv_changed_p(), dv_htab_hash(), dv_is_value_p(), dv_onepart_p(), hash_table< Descriptor, Lazy, Allocator >::find_with_hash(), gcc_checking_assert, loc_exp_dep::next, NO_LOC_P, NOT_ONEPART, notify_dependents_of_resolved_value(), NULL, loc_exp_dep::pprev, VALUE_RECURSED_INTO, VAR_LOC_DEP_LST, and variable_from_dropped().
Referenced by notify_dependents_of_resolved_value(), and 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 onepart_pool_allocate(), and variable_htab_free().
|
inlinestatic |
Allocate a variable_def from the corresponding variable pool.
References base_pool_allocator< TBlockAllocator >::allocate(), and onepart_pool().
Referenced by emit_notes_for_differences_1(), set_slot_part(), unshare_variable(), variable_from_dropped(), variable_merge_over_cur(), and variable_was_changed().
Return true if one-part variables VAR1 and VAR2 are different. They must be in canonical order.
References gcc_assert, location_chain::loc, variable_part::loc_chain, loc_cmp(), variable::n_var_parts, location_chain::next, and variable::var_part.
Referenced by variable_different_p(), and variable_merge_over_cur().
|
static |
Compute call_arguments.
References adjust_address_nv, adjust_mems(), aggregate_value_p(), apply_pass_by_reference_rules(), BITS_PER_WORD, build_pointer_type(), call_arguments, CALL_INSN_FUNCTION_USAGE, CONSTANT_P, cselib_lookup(), cselib_preserved_value_p(), CSELIB_VAL_PTR, decl_debug_args_lookup(), DECL_HAS_DEBUG_ARGS_P, DECL_INITIAL, DECL_MODE, DECL_RTL_KNOWN_SET, FOR_EACH_WIDER_MODE, frame_pointer_needed, gcc_assert, GEN_INT, gen_rtx_EXPR_LIST(), gen_rtx_MEM(), get_call_rtx_from(), GET_CODE, GET_MODE, GET_MODE_BITSIZE(), GET_MODE_CLASS, GET_MODE_SIZE(), INDIRECT_REF_P, count_use_info::insn, int_mode_for_mode(), INTEGRAL_TYPE_P, is_a(), list_length(), elt_loc_list::loc, cselib_val::locs, lowpart_subreg(), MEM_EXPR, adjust_mem_data::mem_mode, MEM_P, function_arg_info::mode, elt_loc_list::next, NULL, NULL_RTX, NULL_TREE, OBJ_TYPE_REF_EXPR, OBJ_TYPE_REF_TOKEN, pc_rtx, plus_constant(), REG_P, REGNO, opt_mode< T >::require(), adjust_mem_data::side_effects, simplify_replace_fn_rtx(), simplify_subreg(), adjust_mem_data::stack_adjust, adjust_mem_data::store, SUBREG_REG, SYMBOL_REF_DECL, targetm, TREE_CHAIN, TREE_CODE, TREE_CONSTANT_POOL_ADDRESS_P, tree_fits_shwi_p(), TREE_OPERAND, tree_to_shwi(), TREE_TYPE, TREE_VALUE, function_arg_info::type, TYPE_ARG_TYPES, TYPE_MODE, cselib_val::val_rtx, vec_safe_iterate(), void_list_node, VTI, and XEXP.
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::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, i, notify_dependents_of_changed_value(), remove_value_from_changed_variables(), hash_table< Descriptor, Lazy, 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(), ENTRY_VALUE_EXP, get_insns(), and GET_MODE.
Referenced by vt_add_function_parameter().
|
static |
Recover the one-part aux from dropped_values.
References variable::dv, gcc_checking_assert, NULL, variable::onepart, ONEPART_VDECL, VAR_LOC_1PAUX, and variable_from_dropped().
Referenced by variable_was_changed().
Reemit INSN, a MARKER_DEBUG_INSN, as a note.
References cfun, DEBUG_MARKER_INSN_P, delete_insn(), emit_note_before(), gcc_checking_assert, gcc_unreachable, INSN_DEBUG_MARKER_KIND, INSN_LOCATION(), NOTE_MARKER_LOCATION, and NULL.
Referenced by delete_vta_debug_insn(), and vt_initialize().
|
static |
Remove any redundant values in the location list of VAR, which must be unshared and 1-part.
References gcc_assert, GET_CODE, location_chain::loc, variable_part::loc_chain, variable::n_var_parts, location_chain::next, variable::onepart, variable::refcount, VALUE_RECURSED_INTO, and variable::var_part.
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, Lazy, Allocator >::clear_slot(), dv_from_rtx(), dv_htab_hash(), hash_table< Descriptor, Lazy, Allocator >::find_slot_with_hash(), and variable::in_changed_variables.
Referenced by process_changed_values().
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(), GET_CODE, GET_MODE, MEM_P, NULL, REG_P, replace_equiv_address_nv(), cselib_val::val_rtx, and XEXP.
Referenced by add_stores(), and add_uses().
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 dv_changed_p(), dv_from_rtx(), gcc_checking_assert, NO_LOC_P, expand_loc_callback_data::pending, set_dv_changed(), and VALUE_RECURSED_INTO.
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, CONST_INT_P, CONSTANT_P, count, cselib_add_permanent_equiv(), cselib_expand_value_rtx(), cselib_lookup(), cselib_preserved_value_p(), gcc_unreachable, gen_lowpart_SUBREG(), GET_CODE, GET_MODE, elt_loc_list::loc, cselib_val::locs, MEM_P, elt_loc_list::next, NULL_RTX, references_value_p(), REG_P, SCALAR_INT_MODE_P, scratch_regs, SET, SET_DEST, SET_SRC, simplify_gen_binary(), cselib_set::src, cselib_val::val_rtx, and XEXP.
Referenced by add_stores().
Return true if X contains a DEBUG_EXPR.
References ALL, FOR_EACH_SUBRTX, and GET_CODE.
Referenced by use_type().
|
static |
Determine whether a given LOC refers to the same variable part as EXPR+OFFSET.
References DECL_P, int_mem_offset(), known_eq, MEM_EXPR, MEM_P, offset, REG_EXPR, REG_OFFSET, REG_P, and var_debug_decl().
Referenced by add_stores().
|
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 DECL_CHANGED, DECL_RTL_KNOWN_SET, dv_as_decl(), dv_as_value(), dv_onepart_p(), NO_LOC_P, ONEPART_DEXPR, ONEPART_VALUE, and VALUE_CHANGED.
Referenced by emit_note_insn_var_location(), notify_dependents_of_changed_value(), resolve_expansions_pending_recursion(), variable_from_dropped(), variable_htab_free(), variable_was_changed(), and vt_expand_loc_callback().
|
static |
References canon_value_cmp(), variable_part::cur_loc, variable::dv, dv_as_decl(), dv_onepart_p(), find_variable_location_part(), gcc_assert, gcc_checking_assert, GET_CODE, variable::in_changed_variables, location_chain::init, initialized, location_chain::loc, variable_part::loc_chain, loc_cmp(), MAX_VAR_PARTS, MEM_P, variable::n_var_parts, location_chain::next, NULL, offset, variable::onepart, onepart_pool_allocate(), r, variable::refcount, REG_P, REGNO, rtx_equal_p(), location_chain::set_src, shared_var_p(), unshare_variable(), VAR_INIT_STATUS_INITIALIZED, VAR_LOC_1PAUX, variable::var_part, VAR_PART_OFFSET, variable_was_changed(), and XEXP.
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 initialized, offset, 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::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 gcc_checking_assert, shared_hash::htab, and shared_hash::refcount.
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, Lazy, 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, Lazy, 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, Lazy, 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, Lazy, 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::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::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, Lazy, Allocator >::elements(), gcc_assert, shared_hash::htab, shared_hash::refcount, 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::in_changed_variables, variable::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.
References CONST_INT_P, for_each_inc_dec(), GET_CODE, INTVAL, SET_DEST, SET_SRC, stack_adjust_offset_pre_post_cb(), stack_pointer_rtx, and XEXP.
Referenced by insn_stack_adjust_offset_pre_post().
|
static |
Callback for stack_adjust_offset_pre_post, called via for_each_inc_dec.
References CONST_INT_P, gcc_assert, gcc_unreachable, GET_CODE, INTVAL, stack_pointer_rtx, and XEXP.
Referenced by stack_adjust_offset_pre_post().
Shall EXPR be tracked?
References AGGREGATE_TYPE_P, contains_symbol_ref_p(), DECL_CHANGED, DECL_DEBUG_EXPR, DECL_HAS_DEBUG_EXPR_P, DECL_IGNORED_P, DECL_NAME, DECL_P, DECL_RTL_IF_SET, DECL_RTL_SET_P, expr, GET_MODE, get_ref_base_and_extent_hwi(), handled_component_p(), MAX_VAR_PARTS, maybe_gt, MEM_P, MEM_SIZE, MEM_SIZE_KNOWN_P, tracked_record_parameter_p(), TREE_CODE, TREE_OPERAND, TREE_STATIC, TREE_TYPE, VAR_P, and XEXP.
Referenced by track_loc_p(), and use_type().
|
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(), COMPLEX_MODE_P, DECL_MODE, GET_MODE, HARD_REGISTER_NUM_P, hard_regno_nregs(), known_eq, NULL, offset, ORIGINAL_REGNO, paradoxical_subreg_p(), PSEUDO_REGNO_MODE, REG_P, REGNO, track_expr_p(), and track_offset_p().
Referenced by use_type(), and vt_add_function_parameter().
|
static |
Return true if we should track a location that is OFFSET bytes from a variable. Store the constant offset in *OFFSET_OUT if so.
References IN_RANGE, MAX_VAR_PARTS, and offset.
Referenced by get_tracked_reg_offset(), track_loc_p(), var_reg_delete(), and vt_get_decl_and_offset().
Return true if T is a tracked parameter with non-degenerate record type.
References DECL_CHAIN, DECL_MODE, NULL_TREE, TREE_CODE, TREE_TYPE, and TYPE_FIELDS.
Referenced by add_stores(), and track_expr_p().
|
static |
Return a copy of a variable VAR and insert it to dataflow set SET.
References changed_variables, variable_part::cur_loc, dst_can_be_shared, variable::dv, dv_htab_hash(), emit_notes, hash_table< Descriptor, Lazy, Allocator >::find_slot_with_hash(), gcc_assert, gcc_checking_assert, i, variable::in_changed_variables, location_chain::init, initialized, location_chain::loc, variable_part::loc_chain, MEM_P, variable::n_var_parts, location_chain::next, NULL, variable::onepart, onepart_pool_allocate(), variable::refcount, location_chain::set_src, shared_hash_find_slot_noinsert(), shared_hash_find_slot_unshare(), shared_hash_shared(), VAR_INIT_STATUS_INITIALIZED, VAR_LOC_1PAUX, variable::var_part, VAR_PART_OFFSET, 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().
Return true if LOC should not be expanded for location expressions, or used in them.
References GET_CODE, and overlapping_mems::loc.
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::complexity, and expand_depth::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 as_a(), CONSTANT_P, gcc_unreachable, GET_CODE, GET_MODE, GET_MODE_PRECISION(), lowpart_subreg(), simplify_gen_binary(), use_narrower_mode(), and XEXP.
Referenced by adjust_mems(), and use_narrower_mode().
Helper for adjust_mems. Return true if X is suitable for transformation of wider mode arithmetics to narrower mode.
References as_a(), CONSTANT_P, cselib_lookup(), FOR_EACH_SUBRTX_VAR, GET_CODE, GET_MODE, GET_MODE_PRECISION(), simplify_subreg(), subreg_lowpart_offset(), SUBREG_REG, validate_subreg(), and XEXP.
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(), expr, find_use_val(), gcc_assert, get_address_mode(), GET_CODE, GET_MODE, int_mem_offset(), MAY_HAVE_DEBUG_BIND_INSNS, MEM_EXPR, MEM_P, MO_CLOBBER, MO_USE, MO_USE_NO_VAR, MO_VAL_LOC, MO_VAL_SET, MO_VAL_USE, NULL, PAT_VAR_LOCATION_DECL, PAT_VAR_LOCATION_LOC, REG_EXPR, REG_OFFSET, REG_P, REGNO, rtx_debug_expr_p(), count_use_info::sets, count_use_info::store_p, target_for_debug_bind(), track_expr_p(), track_loc_p(), var_debug_decl(), VAR_LOC_UNKNOWN_P, and XEXP.
|
inlinestatic |
Bind VAL to LOC in SET. If MODIFIED, detach LOC from any values bound to it.
References canonical_cselib_val(), clobber_overlapping_mems(), CSELIB_VAL_PTR, dv_from_value(), gcc_unreachable, GET_CODE, elt_loc_list::loc, overlapping_mems::loc, cselib_val::locs, MEM_P, elt_loc_list::next, NULL_RTX, REG_P, REGNO, set_variable_part(), VAR_INIT_STATUS_INITIALIZED, var_mem_decl_set(), var_reg_decl_set(), var_regno_delete(), and XEXP.
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(), gcc_assert, GET_CODE, location_chain::init, location_chain::loc, variable_part::loc_chain, local_get_addr_cache, local_get_addr_clear_given_value(), variable::n_var_parts, location_chain::next, NULL, variable::onepart, ONEPART_VALUE, location_chain::set_src, set_variable_part(), shared_hash_find(), var_mem_decl_set(), variable::var_part, 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::dv, dv_as_value(), dv_from_value(), dv_is_value_p(), fputc(), gcc_checking_assert, GET_MODE, INSN_UID(), elt_loc_list::loc, attrs::next, NULL, NULL_RTX, attrs::offset, print_inline_rtx(), REG_P, REGNO, set_variable_part(), TDF_DETAILS, 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(), CSELIB_VAL_PTR, dump_file, gcc_assert, gcc_checking_assert, INSN_UID(), elt_loc_list::loc, cselib_val::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().
Map a decl to its main debug decl.
References DECL_DEBUG_EXPR, DECL_HAS_DEBUG_EXPR_P, DECL_P, and VAR_P.
Referenced by find_src_set_src(), find_src_status(), same_variable_part_p(), use_type(), var_mem_decl_set(), var_mem_delete(), var_mem_delete_and_set(), var_reg_decl_set(), var_reg_delete(), and var_reg_delete_and_set().
Implements the VAR_LOC_DEP_VEC above as a function to work around a bogus -Wnonnull (PR c/95554).
References NULL, and VAR_LOC_1PAUX.
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 adjust_address_nv, byte_lowpart_offset(), gen_rtx_REG_offset(), GET_MODE, MEM_P, NULL, offset, reg_offset, REG_P, REGNO, 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(), initialized, overlapping_mems::loc, offset, set_variable_part(), and var_debug_decl().
Referenced by val_bind(), val_reset(), and var_mem_set().
|
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(), int_mem_offset(), overlapping_mems::loc, MEM_EXPR, NULL, offset, and var_debug_decl().
Referenced by compute_bb_dataflow(), and emit_notes_in_bb().
|
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(), initialized, int_mem_offset(), overlapping_mems::loc, MEM_EXPR, modify, NULL, 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(), initialized, int_mem_offset(), overlapping_mems::loc, MEM_EXPR, 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::dv, dv_as_decl(), dv_from_decl(), dv_is_decl_p(), initialized, attrs::next, attrs::offset, offset, REGNO, set_variable_part(), and var_debug_decl().
Referenced by val_bind(), val_reset(), var_reg_set(), and variable_post_merge_new_vals().
|
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 clobber_variable_part(), delete_variable_part(), attrs::dv, dv_from_decl(), dv_onepart_p(), attrs::loc, attrs::next, NULL, attrs::offset, offset, REG_EXPR, REG_OFFSET, REGNO, track_offset_p(), and var_debug_decl().
Referenced by compute_bb_dataflow(), and emit_notes_in_bb().
|
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 clobber_variable_part(), delete_variable_part(), attrs::dv, dv_from_decl(), get_init_value(), get_tracked_reg_offset(), initialized, attrs::loc, modify, attrs::next, attrs::offset, offset, REG_EXPR, REGNO, 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(), get_tracked_reg_offset(), initialized, offset, REG_EXPR, and var_reg_decl_set().
Referenced by compute_bb_dataflow(), emit_notes_in_bb(), and var_reg_delete_and_set().
|
static |
Delete content of register with number REGNO in dataflow set SET.
References delete_variable_part(), attrs::dv, attrs::loc, attrs::next, NULL, and attrs::offset.
Referenced by compute_bb_dataflow(), dataflow_set_clear_at_call(), emit_notes_in_bb(), and val_bind().
While traversing changed_variables, push onto DATA (a stack of RTX values) entries that aren't user variables.
References DECL_RTL_KNOWN_SET, variable::dv, dv_as_decl(), dv_as_value(), variable::onepart, ONEPART_DEXPR, and ONEPART_VALUE.
Referenced by process_changed_values().
Return true if variables VAR1 and VAR2 are different.
References variable::dv, gcc_checking_assert, i, variable::n_var_parts, variable::onepart, onepart_variable_different_p(), variable::var_part, VAR_PART_OFFSET, and variable_part_different_p().
Referenced by dataflow_set_different(), and emit_notes_for_differences_1().
|
inlinestatic |
Return the variable for DV in dropped_values, inserting one if requested with INSERT.
References variable_part::cur_loc, dropped_values, variable::dv, dv_htab_hash(), dv_onepart_p(), hash_table< Descriptor, Lazy, Allocator >::find_slot_with_hash(), gcc_checking_assert, variable::in_changed_variables, insert(), variable_part::loc_chain, variable::n_var_parts, NULL, variable::onepart, ONEPART_DEXPR, onepart_pool_allocate(), ONEPART_VALUE, variable::refcount, set_dv_changed(), VAR_LOC_1PAUX, and variable::var_part.
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 |
Free the element of VARIABLE_HTAB (its type is struct variable_def).
References variable::dv, gcc_checking_assert, i, variable_part::loc_chain, loc_exp_dep_clear(), variable::n_var_parts, location_chain::next, NULL, variable::onepart, ONEPART_DEXPR, onepart_pool(), variable::refcount, base_pool_allocator< TBlockAllocator >::remove(), set_dv_changed(), VAR_LOC_1PAUX, VAR_LOC_DEP_LST, and variable::var_part.
Referenced by variable_hasher::remove(), unshare_variable(), variable_merge_over_cur(), and variable_was_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(), variable_part::cur_loc, delete_slot_part(), dfset_merge::dst, dst_can_be_shared, attrs::dv, variable::dv, dv_as_value(), dv_from_value(), dv_htab_hash(), dv_is_value_p(), gcc_assert, gcc_checking_assert, GET_CODE, GET_MODE, variable::in_changed_variables, location_chain::init, intersect_loc_chains(), attrs::loc, location_chain::loc, variable_part::loc_chain, variable::n_var_parts, attrs::next, location_chain::next, NULL, NULL_RTX, variable::onepart, onepart_pool_allocate(), ONEPART_VALUE, onepart_variable_different_p(), variable::refcount, REGNO, dataflow_set::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, VALUE_RECURSED_INTO, VAR_LOC_1PAUX, variable::var_part, VAR_PART_OFFSET, variable_htab_free(), variable_union(), and dataflow_set::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::dv, variable::onepart, variable::refcount, shared_hash_find_slot(), dfset_merge::src_onepart_cnt, and dataflow_set::vars.
Referenced by dataflow_set_merge().
|
static |
References location_chain::loc, variable_part::loc_chain, location_chain::next, REG_P, REGNO, and rtx_equal_p().
Referenced by variable_different_p().
int variable_post_merge_new_vals | ( | variable ** | slot, |
dfset_post_merge * | dfpm ) |
Create values for incoming expressions associated with one-part variables that don't have value numbers for them.
References cselib_invalidate_rtx(), cselib_lookup(), cselib_preserve_value(), dataflow_set_init(), dump_file, attrs::dv, variable::dv, dv_as_value(), dv_from_value(), dv_is_decl_p(), dv_is_value_p(), gcc_assert, GET_CODE, GET_MODE, cselib_val::hash, attrs::loc, location_chain::loc, variable_part::loc_chain, variable::n_var_parts, attrs::next, location_chain::next, NULL, attrs::offset, variable::onepart, dfset_post_merge::permp, variable::refcount, REGNO, remove_duplicate_values(), dfset_post_merge::set, cselib_val::uid, unshare_variable(), val_reset(), cselib_val::val_rtx, VALUE_RECURSED_INTO, VAR_INIT_STATUS_INITIALIZED, variable::var_part, and var_reg_decl_set().
Referenced by dataflow_post_merge_adjust().
int variable_post_merge_perm_vals | ( | variable ** | pslot, |
dfset_post_merge * | dfpm ) |
Reset values in the permanent set that are not associated with the chosen expression.
References attrs_list_insert(), attrs::dv, variable::dv, dv_as_value(), dv_is_value_p(), find_loc_in_1pdv(), gcc_assert, GET_MODE, location_chain::init, attrs::loc, location_chain::loc, variable_part::loc_chain, variable::n_var_parts, attrs::next, location_chain::next, NULL, attrs::offset, REG_P, REGNO, dfset_post_merge::set, set_variable_part(), shared_hash_find(), shared_hash_htab(), val_reset(), variable::var_part, and variable_union().
Referenced by dataflow_post_merge_adjust().
unsigned int variable_tracking_main | ( | void | ) |
In var-tracking.cc
References variable_tracking_main_1().
|
inlinestatic |
The entry point to variable tracking pass.
References cfun, delete_vta_debug_insns(), dump_dataflow_sets(), dump_file, dump_flags, dump_flow_info(), dump_reg_info(), gcc_assert, MAY_HAVE_DEBUG_INSNS, n_basic_blocks_for_fn, n_edges_for_fn, targetm, TDF_DETAILS, 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 variable_part::cur_loc, dst_can_be_shared, variable::dv, gcc_assert, gcc_checking_assert, i, location_chain::init, variable_union_info::lc, location_chain::loc, variable_part::loc_chain, loc_cmp(), MAX, MAX_VAR_PARTS, MEM_P, variable::n_var_parts, location_chain::next, NULL, variable::onepart, variable_union_info::pos, variable_union_info::pos_dst, qsort, r, variable::refcount, REG_P, REGNO, rtx_equal_p(), location_chain::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::var_part, VAR_PART_OFFSET, 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 |
Compare function for qsort, order the structures by POS element.
References i1, i2, and variable_union_info::pos.
Referenced by variable_union().
|
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, Lazy, Allocator >::clear_slot(), variable_part::cur_loc, dropped_values, variable::dv, dv_htab_hash(), emit_notes, hash_table< Descriptor, Lazy, Allocator >::find_slot_with_hash(), gcc_assert, gcc_checking_assert, variable::in_changed_variables, variable_part::loc_chain, variable::n_var_parts, NULL, variable::onepart, ONEPART_DEXPR, onepart_pool_allocate(), ONEPART_VALUE, recover_dropped_1paux(), variable::refcount, set_dv_changed(), shared_hash_find_slot_noinsert(), shared_hash_find_slot_unshare(), shared_hash_htab(), shared_hash_shared(), VAR_LOC_1PAUX, variable::var_part, and variable_htab_free().
Referenced by dataflow_set_preserve_mem_locs(), dataflow_set_remove_mem_locs(), delete_slot_part(), drop_overlapping_mem_locs(), emit_notes_for_differences_1(), emit_notes_for_differences_2(), notify_dependents_of_changed_value(), and set_slot_part().
|
static |
Copy all variables from hash table SRC to hash table DST.
References variable::dv, dv_htab_hash(), hash_table< Descriptor, Lazy, Allocator >::find_slot_with_hash(), FOR_EACH_HASH_TABLE_ELEMENT, and variable::refcount.
Referenced by shared_hash_unshare().
|
static |
Insert function parameter PARM in IN and OUT sets of ENTRY_BLOCK.
References arg_pointer_rtx, attrs_list_insert(), byte_lowpart_offset(), cfun, crtl, cselib_lookup_from_insn(), CSELIB_VAL_PTR, current_function_decl, DECL_INCOMING_RTL, DECL_RTL_IF_SET, dv_as_value(), dv_from_decl(), dv_from_value(), dv_is_value_p(), dv_onepart_p(), ENTRY_BLOCK_PTR_FOR_FN, FOR_EACH_WIDER_MODE, gcc_assert, gen_raw_REG(), gen_rtx_EXPR_LIST(), gen_rtx_MEM(), gen_rtx_REG(), gen_rtx_REG_offset(), GET_CODE, get_insns(), GET_MODE, GET_MODE_CLASS, get_spill_slot_decl(), get_tracked_reg_offset(), HARD_REGISTER_P, HWI_COMPUTABLE_MODE_P(), i, INTEGRAL_TYPE_P, MEM_P, NULL, offset, OUTGOING_REGNO, plus_constant(), preserve_value(), record_entry_value(), REG_P, REGNO, dataflow_set::regs, replace_equiv_address_nv(), rtvec_alloc(), set_variable_part(), strip_offset(), target_for_debug_bind(), track_loc_p(), TREE_CODE, TREE_TYPE, TYPE_MODE, cselib_val::val_rtx, VAR_INIT_STATUS_INITIALIZED, var_lowpart(), vec_safe_push(), vt_get_decl_and_offset(), VTI, XEXP, XVECEXP, and XVECLEN.
Referenced by vt_add_function_parameters().
|
static |
Insert function parameters to IN and OUT sets of ENTRY_BLOCK.
References current_function_decl, DECL_ARGUMENTS, DECL_ARTIFICIAL, DECL_CHAIN, DECL_HAS_VALUE_EXPR_P, DECL_IGNORED_P, DECL_NAMELESS, DECL_RESULT, DECL_VALUE_EXPR, INDIRECT_REF_P, TREE_CODE, TREE_OPERAND, 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(), GET_CODE, GET_MODE, vt_canonicalize_addr(), and XEXP.
Referenced by drop_overlapping_mem_locs().
|
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(), GET_CODE, GET_MODE, INTVAL, known_eq, negative_power_of_two_p(), plus_constant(), poly_int_rtx_p(), strip_offset(), vt_canonicalize_addr(), and XEXP.
Referenced by clobber_overlapping_mems(), get_addr_from_global_cache(), get_addr_from_local_cache(), vt_canon_true_dep(), 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_vta_debug_insns().
Referenced by variable_tracking_main_1().
|
static |
Emit notes for the whole function.
References BB_HEAD, cfun, changed_variables, cselib_get_next_uid(), dataflow_set_clear(), dataflow_set_destroy(), dataflow_set_init(), dropped_values, emit_notes, emit_notes_for_differences(), emit_notes_for_differences_1(), emit_notes_in_bb(), empty_shared_hash, FOR_EACH_BB_FN, gcc_assert, hash_table< Descriptor, Lazy, Allocator >::is_empty(), local_get_addr_cache, MAY_HAVE_DEBUG_BIND_INSNS, NULL, shared_hash_htab(), hash_table< Descriptor, Lazy, Allocator >::traverse(), dataflow_set::vars, and VTI.
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_part::cur_loc, variable::dv, dv_changed_p(), FINI_ELCD, gcc_checking_assert, INIT_ELCD, variable::n_var_parts, NULL, variable::onepart, scratch_regs, variable::var_part, expand_loc_callback_data::vars, 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(), EXPR_DEPTH, FINI_ELCD, INIT_ELCD, MAY_HAVE_DEBUG_BIND_INSNS, scratch_regs, expand_loc_callback_data::vars, 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::complexity, cselib_expand_value_rtx_cb(), variable_part::cur_loc, expand_loc_callback_data::depth, dv_changed_p(), dv_from_rtx(), dv_htab_hash(), expand_loc_callback_data::expanding, EXPR_DEPTH, hash_table< Descriptor, Lazy, Allocator >::find_with_hash(), gcc_checking_assert, GET_CODE, GET_MODE, variable::n_var_parts, NO_LOC_P, notify_dependents_of_resolved_value(), NULL, expand_loc_callback_data::pending, set_dv_changed(), simplify_gen_subreg(), SUBREG_BYTE, SUBREG_REG, update_depth(), VALUE_RECURSED_INTO, VAR_LOC_1PAUX, variable::var_part, variable_from_dropped(), expand_loc_callback_data::vars, vt_expand_loc_callback(), and vt_expand_var_loc_chain().
Referenced by vt_expand_loc(), vt_expand_loc_callback(), 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::complexity, cselib_expand_value_rtx_cb(), cselib_preserved_value_p(), CSELIB_VAL_PTR, variable_part::cur_loc, expand_loc_callback_data::depth, variable::dv, dv_as_value(), expand_depth::entryvals, expand_loc_callback_data::expanding, EXPR_DEPTH, EXPR_USE_DEPTH, gcc_checking_assert, GET_CODE, elt_loc_list::loc, variable_part::loc_chain, loc_exp_dep_clear(), loc_exp_dep_set(), cselib_val::locs, variable::n_var_parts, elt_loc_list::next, NULL, variable::onepart, ONEPART_VALUE, unsuitable_loc(), update_depth(), VAR_LOC_DEPTH, VAR_LOC_FROM, variable::var_part, 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, BITMAP_FREE, cfun, changed_variables, cselib_finish(), dataflow_set_destroy(), empty_shared_hash, FOR_ALL_BB_FN, FOR_EACH_BB_FN, free_aux_for_blocks(), global_get_addr_cache, shared_hash::htab, loc_exp_dep_pool, location_chain_pool, MAY_HAVE_DEBUG_BIND_INSNS, NULL, preserved_values, base_pool_allocator< TBlockAllocator >::release(), scratch_regs, shared_hash_pool, valvar_pool, var_pool, vec_free(), VTI, vui_allocated, and vui_vec.
Referenced by variable_tracking_main_1().
|
static |
Find the locations of variables in the whole function.
References BASIC_BLOCK_FOR_FN, count_use_info::bb, bitmap_bit_p, bitmap_clear(), bitmap_clear_bit(), 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(), DECL_SOURCE_LOCATION, dst_can_be_shared, dump_dataflow_set(), dump_file, dump_flags, hash_table< Descriptor, Lazy, Allocator >::elements(), fibonacci_heap< K, V >::empty(), ENTRY_BLOCK_PTR_FOR_FN, EXIT_BLOCK, EXIT_BLOCK_PTR_FOR_FN, FOR_EACH_BB_FN, FOR_EACH_EDGE, free(), gcc_assert, i, basic_block_def::index, inform(), fibonacci_heap< K, V >::insert(), last_basic_block_for_fn, LONG_MIN, MAY_HAVE_DEBUG_BIND_INSNS, n_basic_blocks_for_fn, fibonacci_heap< K, V >::nodes(), NULL, NUM_FIXED_BLOCKS, basic_block_def::preds, rev_post_order_and_mark_dfs_back_seme(), sbitmap_alloc(), sbitmap_free(), shared_hash_copy(), shared_hash_destroy(), shared_hash_htab(), single_succ_edge(), hash_table< Descriptor, Lazy, Allocator >::size(), statistics_counter_event(), basic_block_def::succs, TDF_DETAILS, timevar_pop(), timevar_push(), hash_table< Descriptor, Lazy, Allocator >::traverse(), dataflow_set::vars, VTI, and worklist.
Referenced by variable_tracking_main_1().
Strip constant offsets and alignments off of LOC. Return the base expression.
References GET_CODE, INTVAL, negative_power_of_two_p(), and XEXP.
Referenced by get_addr_from_local_cache(), and local_get_addr_clear_given_value().
|
static |
If there is a declaration and offset associated with register/memory RTL assign declaration to *DECLP and offset to *OFFSETP, and return true.
References GET_CODE, i, int_mem_offset(), MAX_VAR_PARTS, MEM_ATTRS, MEM_EXPR, MEM_P, MIN, NULL_TREE, offset, REG_ATTRS, REG_EXPR, REG_OFFSET, REG_P, track_offset_p(), XEXP, XVECEXP, and XVECLEN.
Referenced by vt_add_function_parameter().
|
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 ARG_POINTER_CFA_OFFSET, arg_pointer_rtx, cfa_base_offset, cfa_base_rtx, crtl, cselib_lookup_from_insn(), cselib_preserve_cfa_base_value(), current_function_decl, fixed_regs, frame_pointer_needed, frame_pointer_rtx, get_insns(), GET_MODE, hard_frame_pointer_rtx, MAY_HAVE_DEBUG_BIND_INSNS, NULL_RTX, preserve_value(), REGNO, stack_pointer_rtx, 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::adjust, adjust_insn(), alloc_aux_for_blocks(), ARG_POINTER_CFA_OFFSET, arg_pointer_rtx, BB_HEAD, BITMAP_ALLOC, CALL_P, cancel_changes(), cfa_base_offset, cfa_base_rtx, cfun, changed_variables, crtl, 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_record_sp_cfa_base_equiv(), cselib_reset_table(), cselib_set_value_sp_based(), current_function_decl, dataflow_set_init(), DEBUG_MARKER_INSN_P, dump_cselib_table(), dump_file, dump_flags, dump_insn_slim(), eliminate_regs(), empty_shared_hash, ENTRY_BLOCK_PTR_FOR_FN, EXIT_BLOCK_PTR_FOR_FN, expr, find_edge(), fixed_regs, FOR_ALL_BB_FN, FOR_BB_BETWEEN, FOR_BB_INSNS_SAFE, FOR_EACH_BB_FN, fp_setter_insn(), frame_pointer_needed, frame_pointer_rtx, gcc_assert, GET_CODE, get_insns(), GET_MODE, global_get_addr_cache, hard_frame_pointer_adjustment, hard_frame_pointer_rtx, shared_hash::htab, INCOMING_FRAME_SP_OFFSET, micro_operation::insn, INSN_P, insn_stack_adjust_offset_pre_post(), ira_use_lra_p, known_eq, log_op_type(), lra_eliminate_regs(), MAY_HAVE_DEBUG_BIND_INSNS, MO_ADJUST, basic_block_def::next_bb, NULL, NULL_RTX, offset, PATTERN(), plus_constant(), prepare_call_arguments(), preserve_value(), preserved_values, print_rtl_single(), reemit_marker_as_note(), shared_hash::refcount, REGNO, rtx_to_poly_int64(), scratch_regs, shared_hash_pool, single_pred_p(), stack_pointer_rtx, stack_realign_drap, TDF_DETAILS, TDF_SLIM, micro_operation::type, micro_operation::u, vt_add_function_parameters(), vt_init_cfa_base(), vt_stack_adjustments(), VTI, and XEXP.
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 BB_END, BB_HEAD, cfun, EDGE_COUNT, ei_edge(), ei_next(), ei_one_before_end_p(), ei_start, ENTRY_BLOCK_PTR_FOR_FN, EXIT_BLOCK_PTR_FOR_FN, free(), INCOMING_FRAME_SP_OFFSET, INSN_P, insn_stack_adjust_offset_pre_post(), n_basic_blocks_for_fn, NEXT_INSN(), offset, basic_block_def::succs, visited, and VTI.
Referenced by vt_initialize().
object_allocator< attrs > attrs_pool("attrs pool") | ( | "attrs pool" | ) |
Alloc pool for struct attrs_def.
Referenced by vt_finalize().
|
static |
Arguments to the call.
Referenced by add_with_sets(), and prepare_call_arguments().
|
static |
Referenced by compute_cfa_pointer(), vt_init_cfa_base(), and vt_initialize().
|
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().
|
extern |
var-tracking.cc 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_vta_debug_insn().
|
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().
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().
object_allocator< loc_exp_dep > loc_exp_dep_pool("loc_exp_dep pool") | ( | "loc_exp_dep pool" | ) |
Alloc pool for struct loc_exp_dep_s for NOT_ONEPART variables.
Referenced by vt_finalize().
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 |
Alloc pool for struct location_chain.
Referenced by vt_finalize().
|
static |
Referenced by log_op_type().
All preserved VALUEs.
Referenced by preserve_value(), vt_finalize(), and vt_initialize().
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.
Referenced by vt_finalize(), and vt_initialize().
|
static |
Alloc pool for struct variable_def with a single var_part entry.
Referenced by onepart_pool(), and vt_finalize().
|
static |
Alloc pool for struct variable_def with MAX_VAR_PARTS entries.
Referenced by onepart_pool(), and vt_finalize().
|
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().