GCC Middle and Back End API Reference
|
#include "config.h"
#include "system.h"
#include "coretypes.h"
#include "backend.h"
#include "rtl.h"
#include "tree.h"
#include "gimple.h"
#include "ssa.h"
#include "expmed.h"
#include "insn-config.h"
#include "memmodel.h"
#include "emit-rtl.h"
#include "cgraph.h"
#include "gimple-pretty-print.h"
#include "splay-tree-utils.h"
#include "alias.h"
#include "fold-const.h"
#include "stor-layout.h"
#include "cfganal.h"
#include "tree-inline.h"
#include "internal-fn.h"
#include "gimple-iterator.h"
#include "gimple-fold.h"
#include "tree-eh.h"
#include "gimplify.h"
#include "flags.h"
#include "dojump.h"
#include "explow.h"
#include "calls.h"
#include "varasm.h"
#include "stmt.h"
#include "expr.h"
#include "tree-dfa.h"
#include "tree-ssa.h"
#include "dumpfile.h"
#include "cfgloop.h"
#include "tree-ssa-propagate.h"
#include "tree-cfg.h"
#include "domwalk.h"
#include "gimple-match.h"
#include "stringpool.h"
#include "attribs.h"
#include "tree-pass.h"
#include "statistics.h"
#include "langhooks.h"
#include "ipa-utils.h"
#include "dbgcnt.h"
#include "tree-cfgcleanup.h"
#include "tree-ssa-loop.h"
#include "tree-scalar-evolution.h"
#include "tree-ssa-loop-niter.h"
#include "builtins.h"
#include "fold-const-call.h"
#include "ipa-modref-tree.h"
#include "ipa-modref.h"
#include "tree-ssa-sccvn.h"
#include "alloc-pool.h"
#include "symbol-summary.h"
#include "sreal.h"
#include "ipa-cp.h"
#include "ipa-prop.h"
#include "target.h"
Data Structures | |
struct | vn_nary_op_hasher |
struct | vn_phi_hasher |
struct | vn_reference_hasher |
struct | vn_tables_s |
struct | vn_constant_hasher |
struct | vn_ssa_aux_hasher |
struct | pd_range |
struct | pd_data |
struct | vn_walk_cb_data |
class | eliminate_dom_walker |
class | rpo_elim |
struct | unwind_state |
Macros | |
#define | BB_EXECUTABLE BB_VISITED |
Typedefs | |
typedef hash_table< vn_nary_op_hasher > | vn_nary_op_table_type |
typedef vn_nary_op_table_type::iterator | vn_nary_op_iterator_type |
typedef hash_table< vn_phi_hasher > | vn_phi_table_type |
typedef vn_phi_table_type::iterator | vn_phi_iterator_type |
typedef hash_table< vn_reference_hasher > | vn_reference_table_type |
typedef vn_reference_table_type::iterator | vn_reference_iterator_type |
typedef struct vn_tables_s * | vn_tables_t |
typedef hash_table< vn_ssa_aux_hasher >::iterator | vn_ssa_aux_iterator_type |
Variables | |
static vn_lookup_kind | default_vn_walk_kind |
static hash_table< vn_constant_hasher > * | constant_to_value_id |
static obstack | vn_tables_obstack |
static obstack | vn_tables_insert_obstack |
static vn_reference_t | last_inserted_ref |
static vn_phi_t | last_inserted_phi |
static vn_nary_op_t | last_inserted_nary |
static vn_ssa_aux_t | last_pushed_avail |
static vn_tables_t | valid_info |
tree(* | vn_valueize )(tree) |
tree | VN_TOP |
static unsigned int | next_value_id |
static int | next_constant_value_id |
static hash_table< vn_ssa_aux_hasher > * | vn_ssa_aux_hash |
static struct obstack | vn_ssa_aux_obstack |
static vec< vn_reference_op_s > | shared_lookup_references |
static eliminate_dom_walker * | rpo_avail |
basic_block | vn_context_bb |
#define BB_EXECUTABLE BB_VISITED |
SCC value numbering for trees Copyright (C) 2006-2024 Free Software Foundation, Inc. Contributed by Daniel Berlin <dan@dberlin.org> 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 algorithm is based on the SCC algorithm presented by Keith Cooper and L. Taylor Simpson in "SCC-Based Value numbering" (http://citeseer.ist.psu.edu/41805.html). In straight line code, it is equivalent to a regular hash based value numbering that is performed in reverse postorder. For code with cycles, there are two alternatives, both of which require keeping the hashtables separate from the actual list of value numbers for SSA names. 1. Iterate value numbering in an RPO walk of the blocks, removing all the entries from the hashtable after each iteration (but keeping the SSA name->value number mapping between iterations). Iterate until it does not change. 2. Perform value numbering as part of an SCC walk on the SSA graph, iterating only the cycles in the SSA graph until they do not change (using a separate, optimistic hashtable for value numbering the SCC operands). The second is not just faster in practice (because most SSA graph cycles do not involve all the variables in the graph), it also has some nice properties. One of these nice properties is that when we pop an SCC off the stack, we are guaranteed to have processed all the operands coming from *outside of that SCC*, so we do not need to do anything special to ensure they have value numbers. Another nice property is that the SCC walk is done as part of a DFS of the SSA graph, which makes it easy to perform combining and simplifying operations at the same time. The code below is deliberately written in a way that makes it easy to separate the SCC walk from the other work it does. In order to propagate constants through the code, we track which expressions contain constants, and use those while folding. In theory, we could also track expressions whose value numbers are replaced, in case we end up folding based on expression identities. In order to value number memory, we assign value numbers to vuses. This enables us to note that, for example, stores to the same address of the same value from the same starting memory states are equivalent. TODO: 1. We can iterate only the changing portions of the SCC's, but I have not seen an SCC big enough for this to be a win. 2. If you differentiate between phi nodes for loops and phi nodes for if-then-else, you can properly consider phi nodes in different blocks for equivalence. 3. We could value number vuses in more cases, particularly, whole structure copies.
There's no BB_EXECUTABLE but we can use BB_VISITED.
Referenced by eliminate_dom_walker::before_dom_children(), do_rpo_vn_1(), and process_bb().
typedef hash_table<vn_phi_hasher> vn_phi_table_type |
typedef hash_table<vn_ssa_aux_hasher>::iterator vn_ssa_aux_iterator_type |
typedef struct vn_tables_s * vn_tables_t |
The set of VN hashtables.
|
static |
Return true if BASE1 and BASE2 can be adjusted so they have the same address and adjust *OFFSET1 and *OFFSET2 accordingly. Otherwise return false.
References mem_ref_offset(), OEP_ADDRESS_OF, operand_equal_p(), TREE_CODE, and TREE_OPERAND.
Referenced by vn_reference_lookup_3().
|
static |
Allocate and initialize a vn_nary_op_t on CURRENT_INFO's obstack.
References alloc_vn_nary_op_noinit(), vn_nary_op_s::length, vn_nary_op_s::predicated_values, vn_nary_op_s::result, vn_reference_s::result, vn_nary_op_s::u, vn_nary_op_s::value_id, vn_reference_s::value_id, and vn_tables_obstack.
Referenced by vn_nary_op_insert_pieces(), vn_nary_op_insert_pieces_predicated(), and vn_nary_op_insert_stmt().
vn_nary_op_t alloc_vn_nary_op_noinit | ( | unsigned int | length, |
struct obstack * | stack ) |
Allocate a vn_nary_op_t with LENGTH operands on STACK.
References sizeof_vn_nary_op().
Referenced by alloc_vn_nary_op(), get_or_alloc_expr_for_nary(), VN_INFO(), and vn_nary_build_or_lookup_1().
|
static |
bool ao_ref_init_from_vn_reference | ( | ao_ref * | ref, |
alias_set_type | set, | ||
alias_set_type | base_set, | ||
tree | type, | ||
const vec< vn_reference_op_s > & | ops ) |
Build a alias-oracle reference abstraction in *REF from the vn_reference operands in *OPS, the reference alias set SET and the reference type TYPE. Return true if something useful was produced.
References ao_ref::base, vn_reference_op_struct::base, ao_ref::base_alias_set, build2(), build5(), vn_reference_op_struct::clique, DECL_FIELD_BIT_OFFSET, DECL_FIELD_OFFSET, DECL_P, DECL_SIZE, FOR_EACH_VEC_ELT, GET_MODE_BITSIZE(), i, known_eq, known_lt, ao_ref::max_size, MR_DEPENDENCE_BASE, MR_DEPENDENCE_CLIQUE, NULL, NULL_TREE, vn_reference_op_struct::off, ao_ref::offset, offset, vn_reference_op_struct::op0, vn_reference_op_struct::op1, vn_reference_op_struct::op2, vn_reference_op_struct::opcode, poly_int_tree_p(), ao_ref::ref, ao_ref::ref_alias_set, ao_ref::size, wi::to_offset(), wi::to_poly_offset(), poly_int< N, C >::to_shwi(), TREE_CODE, TREE_OPERAND, vn_reference_op_struct::type, TYPE_MODE, TYPE_SIZE, and ao_ref::volatile_p.
Referenced by translate_vuse_through_block(), value_dies_in_block_x(), vn_reference_lookup(), vn_reference_lookup_3(), and vn_reference_lookup_pieces().
Return whether we can track a predicate valid when PRED_E is executed.
References CDI_DOMINATORS, dominated_by_p(), FOR_EACH_EDGE, and single_pred_p().
Referenced by process_bb(), and vn_nary_op_insert_pieces_predicated().
|
static |
Return true if COND1 and COND2 represent the same condition, set *INVERTED_P if one needs to be inverted to make it the same as the other.
References commutative_tree_code(), expressions_equal_p(), gimple_cond_code(), HONOR_NANS(), invert_tree_comparison(), and swap_tree_comparison().
Referenced by vn_phi_eq().
|
static |
Return true if OPS contain a storage order barrier.
References FOR_EACH_VEC_ELT, i, vn_reference_op_struct::opcode, and vn_reference_op_struct::reverse.
Referenced by vn_reference_lookup_3().
|
static |
Copy the operations present in load/store/call REF into RESULT, a vector of vn_reference_op_s's.
References cfun, vn_reference_op_struct::clique, copy_reference_ops_from_ref(), gimple_call_arg(), gimple_call_chain(), gimple_call_fn(), gimple_call_fntype(), gimple_call_internal_fn(), gimple_call_internal_p(), gimple_call_lhs(), gimple_call_num_args(), i, lookup_stmt_eh_lp(), vn_reference_op_struct::off, vn_reference_op_struct::op0, vn_reference_op_struct::op1, vn_reference_op_struct::op2, vn_reference_op_struct::opcode, size_int, stmt_could_throw_p(), TREE_CODE, TREE_TYPE, and vn_reference_op_struct::type.
Referenced by valueize_shared_reference_ops_from_call().
|
static |
Copy the operations present in load/store REF into RESULT, a vector of vn_reference_op_s's.
References AGGREGATE_TYPE_P, vn_reference_op_struct::align, array_ref_low_bound(), array_ref_up_bound(), vn_reference_op_struct::base, bit_field_offset(), build1(), build_int_cst(), build_pointer_type(), cfun, vn_reference_op_struct::clique, component_ref_field_offset(), DECL_FIELD_BIT_OFFSET, DECL_HARD_REGISTER, gcc_unreachable, integer_minus_onep(), integer_nonzerop(), is_gimple_min_invariant(), known_le, mem_ref_offset(), MR_DEPENDENCE_BASE, MR_DEPENDENCE_CLIQUE, NULL_TREE, vn_reference_op_struct::off, vn_reference_op_struct::op0, vn_reference_op_struct::op1, vn_reference_op_struct::op2, vn_reference_op_struct::opcode, poly_int_tree_p(), PROP_objsz, REF_REVERSE_STORAGE_ORDER, REFERENCE_CLASS_P, vn_reference_op_struct::reverse, size_binop, size_int, storage_order_barrier_p(), TMR_INDEX, TMR_INDEX2, TMR_OFFSET, TMR_STEP, wi::to_offset(), wi::to_poly_offset(), poly_int< N, C >::to_shwi(), TREE_CODE, TREE_INT_CST_LOW, TREE_OPERAND, TREE_TYPE, vn_reference_op_struct::type, TYPE_ALIGN_UNIT, TYPE_REVERSE_STORAGE_ORDER, TYPE_SIZE, TYPE_SIZE_UNIT, and vn_ref_op_align_unit().
Referenced by copy_reference_ops_from_call(), valueize_shared_reference_ops_from_ref(), vn_reference_lookup(), vn_reference_lookup_3(), and vn_reference_maybe_forwprop_address().
DEBUG_FUNCTION void debug_vn_reference_ops | ( | const vec< vn_reference_op_s > | ops | ) |
References fputc(), and print_vn_reference_ops().
Set all definitions in STMT to value number to themselves. Return true if a value number changed.
References changed, DEF_FROM_PTR, FOR_EACH_SSA_DEF_OPERAND, set_ssa_val_to(), and SSA_OP_ALL_DEFS.
Referenced by visit_stmt().
unsigned do_rpo_vn | ( | function * | fn, |
edge | entry, | ||
bitmap | exit_bbs, | ||
bool | iterate, | ||
bool | eliminate, | ||
bool | skip_entry_phis, | ||
vn_lookup_kind | kind ) |
Region-based entry for RPO VN. Performs value-numbering and elimination on the SEME region specified by ENTRY and EXIT_BBS. If ENTRY is not the only edge into the region at ENTRY->dest PHI nodes in ENTRY->dest are not considered. If ITERATE is true then treat backedges optimistically as not executed and iterate. If ELIMINATE is true then perform elimination, otherwise leave that to the caller. If SKIP_ENTRY_PHIS is true then force PHI nodes in ENTRY->dest to VARYING. KIND specifies the amount of work done for handling memory operations.
References do_rpo_vn_1(), free_rpo_vn(), and todo.
Referenced by execute_early_warn_uninitialized(), tree_if_conversion(), tree_loop_unroll_and_jam(), and tree_unroll_loops_completely().
|
static |
Do VN on a SEME region specified by ENTRY and EXIT_BBS in FN. If ITERATE is true then treat backedges optimistically as not executed and iterate. If ELIMINATE is true then perform elimination, otherwise leave that to the caller. If SKIP_ENTRY_PHIS is true then force PHI nodes in ENTRY->dest to VARYING.
References allocate_vn_table(), vn_ssa_aux::avail, unwind_state::avail_top, BASIC_BLOCK_FOR_FN, BB_EXECUTABLE, bb_in_region(), BITMAP_ALLOC, bitmap_bit_p, bitmap_clear_first_set_bit(), bitmap_empty_p(), BITMAP_FREE, bitmap_set_bit, CDI_DOMINATORS, cfun, create_tmp_var_raw(), default_vn_walk_kind, do_unwind(), dominated_by_p(), dump_file, dump_flags, eliminate_dom_walker::eliminate_cleanup(), eliminate_with_rpo_vn(), ENTRY_BLOCK_PTR_FOR_FN, EXIT_BLOCK, basic_block_def::flags, FOR_EACH_EDGE, gcc_assert, gcc_obstack_init, GF_PLF_1, gimple_plf(), gsi_end_p(), gsi_next(), gsi_start_phis(), header, loop::header, i, basic_block_def::index, unwind_state::iterate, last_basic_block_for_fn, last_inserted_nary, last_inserted_phi, last_inserted_ref, last_pushed_avail, LI_ONLY_INNERMOST, loop_depth(), LOOPS_NEED_FIXUP, loops_state_satisfies_p(), unwind_state::max_rpo, n_basic_blocks_for_fn, unwind_state::nary_top, vn_avail::next, next_constant_value_id, next_value_id, NULL, loop::num, NUM_FIXED_BLOCKS, num_ssa_names, unwind_state::ob_top, gphi_iterator::phi(), unwind_state::phi_top, basic_block_def::preds, PRIu64, process_bb(), unwind_state::ref_top, rev_post_order_and_mark_dfs_back_seme(), rpo_avail, rpo_vn_valueize(), single_succ_edge(), statistics_counter_event(), statistics_histogram_event(), basic_block_def::succs, superloop_at_depth(), TDF_DETAILS, TDF_STATS, todo, valid_info, visit_phi(), unwind_state::visited, visited, vn_context_bb, vn_ssa_aux_hash, vn_ssa_aux_obstack, vn_tables_insert_obstack, vn_tables_obstack, VN_TOP, vn_valueize, void_type_node, and worklist.
Referenced by do_rpo_vn(), and run_rpo_vn().
|
static |
Unwind the RPO VN state for iteration.
References vn_ssa_aux::avail, unwind_state::avail_top, hash_table< Descriptor, Lazy, Allocator >::clear_slot(), hash_table< Descriptor, Lazy, Allocator >::find_slot_with_hash(), gcc_assert, vn_nary_op_s::hashcode, vn_phi_s::hashcode, vn_reference_s::hashcode, unwind_state::iterate, last_inserted_nary, last_inserted_phi, last_inserted_ref, last_pushed_avail, rpo_elim::m_avail_freelist, vn_tables_s::nary, unwind_state::nary_top, vn_avail::next, vn_nary_op_s::next, vn_phi_s::next, vn_reference_s::next, vn_avail::next_undo, unwind_state::ob_top, unwind_state::phi_top, vn_tables_s::phis, unwind_state::ref_top, vn_tables_s::references, valid_info, and vn_tables_obstack.
Referenced by do_rpo_vn_1().
|
static |
Return true if BB1 is dominated by BB2 taking into account edges that are not executable. When ALLOW_BACK is false consider not executable backedges as executable.
References CDI_DOMINATORS, dominated_by_p(), EDGE_COUNT, FOR_EACH_EDGE, NULL, basic_block_def::preds, and basic_block_def::succs.
Referenced by rpo_elim::eliminate_avail(), and vn_nary_op_get_predicated_value().
unsigned eliminate_with_rpo_vn | ( | bitmap | inserted_exprs | ) |
Eliminate fully redundant computations.
References CDI_DOMINATORS, cfun, eliminate_dom_walker::eliminate_cleanup(), inserted_exprs, rpo_avail, and dom_walker::walk().
Referenced by do_rpo_vn_1().
Compare two expressions E1 and E2 and return true if they are equal. If match_vn_top_optimistically is true then VN_TOP is equal to anything, otherwise VN_TOP only matches VN_TOP.
References OEP_PURE_SAME, operand_equal_p(), TREE_CODE, and VN_TOP.
Referenced by cond_stmts_equal_p(), visit_phi(), visit_reference_op_store(), vn_constant_eq_with_type(), vn_nary_op_eq(), vn_nary_op_insert_into(), vn_phi_eq(), vn_reference_eq(), and vn_reference_op_eq().
|
inlinestatic |
Free a reference operation structure VP.
References vn_reference_s::operands.
Referenced by vn_reference_insert().
void free_rpo_vn | ( | void | ) |
Free VN associated data structures.
References constant_to_value_id, FOR_EACH_HASH_TABLE_ELEMENT, free_vn_table(), vn_ssa_aux::name, vn_ssa_aux::needs_insertion, NULL, release_ssa_name(), valid_info, vn_ssa_aux_hash, vn_ssa_aux_obstack, vn_tables_insert_obstack, and vn_tables_obstack.
Referenced by do_rpo_vn().
|
static |
Free a value number table.
References FOR_EACH_HASH_TABLE_ELEMENT, NULL, vn_reference_s::operands, and table.
Referenced by free_rpo_vn().
tree fully_constant_vn_reference_p | ( | vn_reference_t | ref | ) |
Optimize the reference REF to a constant if possible or return NULL_TREE if not.
References as_combined_fn(), build_zero_cst(), BUILT_IN_NORMAL, vn_reference_op_struct::clique, COMPLETE_TYPE_P, ctor_for_folding(), DECL_FUNCTION_CODE(), error_mark_node, fndecl_built_in_p(), fold_const_call(), fold_ctor_reference(), i, INTEGRAL_TYPE_P, poly_int< N, C >::is_constant(), is_gimple_min_invariant(), is_gimple_reg_type(), known_eq, native_encode_expr(), native_interpret_expr(), NULL, NULL_TREE, vn_reference_op_struct::op0, vn_reference_op_struct::opcode, vn_reference_s::operands, STRIP_USELESS_TYPE_CONVERSION, tcc_constant, TREE_CODE, TREE_CODE_CLASS, tree_fits_shwi_p(), TREE_OPERAND, tree_to_shwi(), vn_reference_s::type, TYPE_PRECISION, TYPE_SIZE, and VAR_P.
Referenced by fully_constant_expression(), vn_reference_lookup(), vn_reference_lookup_3(), and vn_reference_lookup_pieces().
unsigned int get_constant_value_id | ( | tree | constant | ) |
Lookup a value id for CONSTANT and return it. If it does not exist returns 0.
References vn_constant_s::constant, constant_to_value_id, vn_constant_s::hashcode, and vn_hash_constant_with_type().
unsigned int get_max_constant_value_id | ( | void | ) |
Return the maximum constant value id we have ever seen.
References next_constant_value_id.
Referenced by init_pre().
unsigned int get_max_value_id | ( | void | ) |
unsigned int get_next_constant_value_id | ( | void | ) |
Return the next unique value id for constants.
References gcc_checking_assert, and next_constant_value_id.
Referenced by get_or_alloc_constant_value_id().
unsigned int get_next_value_id | ( | void | ) |
Return the next unique value id.
References gcc_checking_assert, and next_value_id.
Referenced by create_expression_by_pieces(), get_or_alloc_expr_for_nary(), phi_translate_1(), run_rpo_vn(), set_value_id_for_result(), and vn_nary_build_or_lookup_1().
unsigned int get_or_alloc_constant_value_id | ( | tree | constant | ) |
Lookup a value id for CONSTANT, and if it does not exist, create a new one and return it. If it does exist, return it.
References vn_constant_s::constant, constant_to_value_id, get_next_constant_value_id(), vn_constant_s::hashcode, and vn_hash_constant_with_type().
Referenced by get_or_alloc_expr_for_constant(), run_rpo_vn(), set_value_id_for_result(), vn_reference_insert(), and vn_reference_lookup_or_insert_for_pieces().
Return whether there is value numbering information for a given SSA name.
References SSA_NAME_VERSION, and vn_ssa_aux_hash.
Referenced by eliminate_dom_walker::eliminate_stmt(), and tail_merge_valueize().
|
static |
Initialize VNO from the pieces provided.
References vn_nary_op_s::length, vn_nary_op_s::op, vn_nary_op_s::opcode, type(), and vn_nary_op_s::type.
Referenced by VN_INFO(), vn_nary_op_insert_pieces(), vn_nary_op_insert_pieces_predicated(), and vn_nary_op_lookup_pieces().
void init_vn_nary_op_from_stmt | ( | vn_nary_op_t | vno, |
gassign * | stmt ) |
Initialize VNO from STMT.
References CONSTRUCTOR_ELT, CONSTRUCTOR_NELTS, gcc_checking_assert, gimple_assign_lhs(), gimple_assign_rhs1(), gimple_assign_rhs_code(), gimple_assign_single_p(), gimple_num_ops(), gimple_op(), i, vn_nary_op_s::length, vn_nary_op_s::op, vn_nary_op_s::opcode, TREE_OPERAND, TREE_TYPE, and vn_nary_op_s::type.
Referenced by compute_avail(), vn_nary_build_or_lookup_1(), vn_nary_op_insert_stmt(), and vn_nary_op_lookup_stmt().
|
static |
Insert on the TRUE_E true and FALSE_E false predicates derived from LHS CODE RHS.
References boolean_false_node, boolean_true_node, boolean_type_node, gimple_assign_rhs1(), gimple_assign_rhs2(), gimple_assign_rhs_code(), HONOR_NANS(), insert_predicates_for_cond(), insert_related_predicates_on_edge(), integer_zerop(), INTEGRAL_TYPE_P, invert_tree_comparison(), is_gimple_assign(), SSA_NAME_DEF_STMT, swap_tree_comparison(), tcc_comparison, TREE_CODE, TREE_CODE_CLASS, tree_swap_operands_p(), TREE_TYPE, vn_nary_op_insert_pieces_predicated(), and vn_valueize.
Referenced by insert_predicates_for_cond(), and process_bb().
|
static |
Insert on PRED_E predicates derived from CODE OPS being true besides the inverted condition.
References boolean_false_node, boolean_true_node, boolean_type_node, and vn_nary_op_insert_pieces_predicated().
Referenced by insert_predicates_for_cond().
gimple_opt_pass * make_pass_fre | ( | gcc::context * | ctxt | ) |
void print_vn_reference_ops | ( | FILE * | outfile, |
const vec< vn_reference_op_s > | ops ) |
Pretty-print OPS to OUTFILE.
References vn_reference_op_struct::clique, get_tree_code_name(), i, internal_fn_name(), vn_reference_op_struct::op0, vn_reference_op_struct::op1, vn_reference_op_struct::op2, vn_reference_op_struct::opcode, print_generic_expr(), tcc_declaration, and TREE_CODE_CLASS.
Referenced by debug_vn_reference_ops(), and print_pre_expr().
|
static |
Main stmt worker for RPO VN, process BB.
References as_a(), BB_EXECUTABLE, bitmap_bit_p, boolean_type_node, build_zero_cst(), can_track_predicate_on_edge(), dump_file, dump_flags, rpo_elim::eliminate_avail(), rpo_elim::eliminate_push_avail(), eliminate_dom_walker::eliminate_stmt(), eliminate_dom_walker::eliminations, extract_true_false_edges_from_block(), find_taken_edge(), flow_loop_nested_p(), FOR_EACH_EDGE, FOR_EACH_SSA_TREE_OPERAND, gcc_assert, gimple_bb(), gimple_cond_code(), gimple_cond_lhs(), gimple_cond_rhs(), gimple_goto_dest(), gimple_simplify(), gimple_switch_index(), gsi_end_p(), gsi_next(), gsi_one_before_end_p(), gsi_start_bb(), gsi_start_phis(), gsi_stmt(), has_zero_uses(), loop::header, i, insert_predicates_for_cond(), is_gimple_min_invariant(), last, LOOP_CLOSED_SSA, basic_block_def::loop_father, loops_state_satisfies_p(), may_propagate_copy(), loop::nb_iterations, NULL, NULL_TREE, PHI_ARG_DEF_PTR_FROM_EDGE, PHI_RESULT, vn_nary_op_s::predicated_values, basic_block_def::preds, print_generic_expr(), print_gimple_stmt(), propagate_value(), simplify_replace_tree(), SSA_NAME_DEF_STMT, SSA_NAME_IS_DEFAULT_DEF, SSA_OP_ALL_DEFS, SSA_OP_DEF, SSA_VAL(), basic_block_def::succs, swap_tree_comparison(), TDF_DETAILS, TDF_NONE, TDF_SLIM, eliminate_dom_walker::to_remove, todo, TODO_cleanup_cfg, TREE_CODE, tree_swap_operands_p(), TREE_TYPE, USE_FROM_PTR, vn_ssa_aux::valnum, virtual_operand_p(), visit_stmt(), vn_ssa_aux::visited, vn_context_bb, VN_INFO(), vn_nary_op_get_predicated_value(), vn_nary_op_lookup_pieces(), VN_TOP, vn_valueize, and vn_valueize_for_srt().
Referenced by do_rpo_vn_1().
|
static |
Return true if OPS represent an access with reverse storage order.
References i.
Referenced by loop_distribution::classify_builtin_ldst(), create_total_scalarization_access(), get_inner_reference(), get_ref_base_and_extent(), and vn_reference_lookup_3().
Valueization hook for RPO VN plus required state.
References eliminate_dom_walker::eliminate_avail(), rpo_avail, TREE_CODE, vn_ssa_aux::valnum, vn_context_bb, VN_INFO(), and VN_TOP.
Referenced by do_rpo_vn_1().
void run_rpo_vn | ( | vn_lookup_kind | kind | ) |
Private interface for PRE.
References cfun, constant_to_value_id, do_rpo_vn_1(), dump_file, dump_flags, FOR_EACH_SSA_NAME, get_next_value_id(), get_or_alloc_constant_value_id(), i, is_gimple_min_invariant(), NULL, print_generic_expr(), set_hashtable_value_ids(), SSA_VAL(), TDF_DETAILS, TREE_CODE, vn_ssa_aux::valnum, vn_reference_s::value_id, vn_ssa_aux::value_id, visited, vn_ssa_aux::visited, VN_INFO(), and VN_TOP.
|
static |
Set the value ids in the valid hash tables.
References FOR_EACH_HASH_TABLE_ELEMENT, vn_tables_s::nary, vn_tables_s::phis, vn_nary_op_s::predicated_values, vn_tables_s::references, vn_nary_op_s::result, vn_phi_s::result, vn_reference_s::result, set_value_id_for_result(), vn_nary_op_s::u, valid_info, vn_nary_op_s::value_id, vn_phi_s::value_id, and vn_reference_s::value_id.
Referenced by run_rpo_vn().
Set the value number of FROM to TO, return true if it has changed as a result.
References dump_file, dump_flags, gcc_checking_assert, get_addr_base_and_unit_offset(), is_gimple_min_invariant(), known_eq, NULL_TREE, operand_equal_p(), print_generic_expr(), SSA_NAME_OCCURS_IN_ABNORMAL_PHI, ssa_undefined_value_p(), SSA_VAL(), TDF_DETAILS, TREE_CODE, TREE_OPERAND, vn_ssa_aux::valnum, virtual_operand_p(), VN_INFO(), and VN_TOP.
Referenced by defs_to_varying(), visit_copy(), visit_nary_op(), visit_phi(), visit_reference_op_call(), visit_reference_op_load(), visit_reference_op_store(), and visit_stmt().
|
static |
Set *ID according to RESULT.
References get_next_value_id(), get_or_alloc_constant_value_id(), is_gimple_min_invariant(), vn_reference_s::result, TREE_CODE, vn_ssa_aux::value_id, and VN_INFO().
Referenced by set_hashtable_value_ids().
Return the SSA value of X.
References SSA_NAME_VERSION, vn_ssa_aux::valnum, visited, vn_ssa_aux::visited, and vn_ssa_aux_hash.
Referenced by rpo_elim::eliminate_avail(), process_bb(), run_rpo_vn(), set_ssa_val_to(), valueize_refs_1(), visit_copy(), visit_phi(), visit_reference_op_call(), visit_reference_op_load(), visit_reference_op_store(), visit_stmt(), vn_nary_build_or_lookup_1(), vn_nary_op_insert_into(), vn_nary_op_lookup_1(), vn_phi_insert(), vn_phi_lookup(), vn_reference_insert(), vn_reference_insert_pieces(), vn_reference_lookup_3(), vn_reference_lookup_call(), vn_reference_lookup_or_insert_for_pieces(), vn_reference_maybe_forwprop_address(), vuse_ssa_val(), and vuse_valueize().
Try to simplify RHS using equivalences and constant folding.
References gimple_assign_rhs_code(), gimple_fold_stmt_to_constant_1(), is_gimple_min_invariant(), mprts_hook, NULL, NULL_TREE, TREE_CODE, vn_lookup_simplify_result(), and vn_valueize.
Referenced by visit_stmt().
|
static |
References valueize_refs_1().
Referenced by valueize_shared_reference_ops_from_call(), vn_reference_insert_pieces(), and vn_reference_lookup_3().
|
static |
Transform any SSA_NAME's in a vector of vn_reference_op_s structures into their value numbers. This is done in-place, and the vector passed in is returned. *VALUEIZED_ANYTHING will specify whether any operands were valueized.
References cfun, i, integer_minus_onep(), known_eq, known_le, vn_reference_op_struct::off, vn_reference_op_struct::op0, vn_reference_op_struct::op1, vn_reference_op_struct::op2, vn_reference_op_struct::opcode, poly_int_tree_p(), PROP_objsz, SSA_VAL(), wi::to_offset(), wi::to_poly_offset(), poly_int< N, C >::to_shwi(), TREE_CODE, TYPE_DOMAIN, TYPE_MAX_VALUE, vn_ref_op_align_unit(), vn_reference_fold_indirect(), vn_reference_maybe_forwprop_address(), and vn_valueize.
Referenced by valueize_refs(), valueize_shared_reference_ops_from_ref(), vn_reference_lookup(), vn_reference_lookup_3(), and vn_reference_lookup_pieces().
|
static |
Create a vector of vn_reference_op_s structures from CALL, a call statement. The vector is shared among all callers of this function.
References copy_reference_ops_from_call(), shared_lookup_references, valueize_refs(), and vNULL.
Referenced by vn_reference_lookup_call().
|
static |
Create a vector of vn_reference_op_s structures from REF, a REFERENCE_CLASS_P tree. The vector is shared among all callers of this function. *VALUEIZED_ANYTHING will specify whether any operands were valueized.
References copy_reference_ops_from_ref(), shared_lookup_references, valueize_refs_1(), and vNULL.
Referenced by vn_reference_insert(), vn_reference_lookup(), and vn_reference_operands_for_lookup().
Lookup a value for OP in type WIDE_TYPE where the value in type of OP is the same.
References CONVERT_EXPR_CODE_P, gimple_assign_rhs1(), gimple_assign_rhs_code(), is_gimple_assign(), NULL, NULL_TREE, SSA_NAME_DEF_STMT, wi::to_widest(), TREE_CODE, TREE_TYPE, useless_type_conversion_p(), vn_nary_op_lookup_pieces(), vn_valueize, and wide_int_to_tree().
Referenced by visit_nary_op().
Visit a copy between LHS and RHS, return true if the value number changed.
References set_ssa_val_to(), and SSA_VAL().
Referenced by visit_stmt().
Visit a nary operator RHS, value number it, and return true if the value number of LHS has changed as a result.
References vn_walk_cb_data::bufsize, CASE_CONVERT, changed, CHAR_BIT, default_vn_walk_kind, dyn_cast(), eliminate_dom_walker::eliminate_avail(), gimple_assign_rhs1(), gimple_assign_rhs2(), gimple_assign_rhs_code(), gimple_bb(), gimple_has_volatile_ops(), gimple_vuse(), HONOR_SIGN_DEPENDENT_ROUNDING(), i, integer_all_onesp(), integer_zerop(), INTEGRAL_TYPE_P, wi::mask(), NULL, vn_phi_s::result, rpo_avail, wi::set_bit_in_zero(), set_ssa_val_to(), SSA_NAME_DEF_STMT, SSA_NAME_OCCURS_IN_ABNORMAL_PHI, TREE_CODE, tree_fits_uhwi_p(), tree_to_uhwi(), TREE_TYPE, TYPE_OVERFLOW_UNDEFINED, TYPE_OVERFLOW_WRAPS, TYPE_PRECISION, TYPE_SATURATING, TYPE_UNSIGNED, gimple_match_cond::UNCOND, useless_type_conversion_p(), valueized_wider_op(), vn_context_bb, vn_get_stmt_kind(), vn_nary_build_or_lookup(), vn_nary_build_or_lookup_1(), vn_nary_op_get_predicated_value(), vn_nary_op_insert_stmt(), vn_nary_op_lookup_pieces(), vn_nary_op_lookup_stmt(), VN_NOWALK, VN_REFERENCE, vn_reference_lookup(), and wide_int_to_tree().
Referenced by visit_stmt().
Visit and value number PHI, return true if the value number changed. When BACKEDGES_VARYING_P is true then assume all backedge values are varying. When INSERTED is not NULL then this is just a ahead query for a possible iteration, set INSERTED to true if we'd insert into the hashtable.
References boolean_type_node, dump_file, dump_flags, EDGE_COUNT, EDGE_PRED, expressions_equal_p(), FLOAT_TYPE_P, get_addr_base_and_unit_offset(), GF_PLF_1, gimple_bb(), gimple_set_plf(), i, integer_truep(), is_gimple_min_invariant(), known_eq, NULL, NULL_TREE, PHI_ARG_DEF_FROM_EDGE, PHI_RESULT, vn_nary_op_s::predicated_values, basic_block_def::preds, print_generic_expr(), print_gimple_expr(), vn_reference_s::result, set_ssa_val_to(), SSA_NAME_DEF_STMT, SSA_NAME_IS_DEFAULT_DEF, SSA_NAME_IS_VIRTUAL_OPERAND, SSA_NAME_OCCURS_IN_ABNORMAL_PHI, ssa_undefined_value_p(), SSA_VAL(), TDF_DETAILS, TDF_NONE, TDF_SLIM, TREE_CODE, TREE_OPERAND, tree_swap_operands_p(), TREE_TYPE, virtual_operand_p(), visited, vn_nary_op_get_predicated_value(), vn_nary_op_lookup_pieces(), vn_phi_insert(), vn_phi_lookup(), and VN_TOP.
Referenced by do_rpo_vn_1(), and visit_stmt().
Visit a call STMT storing into LHS. Return true if the value number of the LHS has changed as a result.
References ao_ref_init(), vn_reference_s::base_set, modref_tree< T >::bases, changed, DECL_P, ECF_CONST, ECF_PURE, hash_table< Descriptor, Lazy, Allocator >::find_slot_with_hash(), flags_from_decl_or_type(), gcc_assert, get_base_address(), get_modref_function_summary(), gimple_call_arg(), gimple_call_flags(), gimple_call_fn(), gimple_call_lhs(), gimple_call_num_args(), gimple_vdef(), gimple_vuse(), modref_summary::global_memory_read, vn_reference_s::hashcode, i, is_a(), is_gimple_min_invariant(), last_inserted_ref, modref_summary::load_accesses, modref_summary::loads, vn_reference_s::max_size, vn_reference_s::next, NULL, NULL_TREE, vn_reference_s::offset, vn_reference_s::operands, vn_reference_s::punned, r, vn_tables_s::references, vn_reference_s::result, vn_reference_s::result_vdef, vn_reference_s::set, set_ssa_val_to(), SSA_NAME_DEF_STMT, SSA_NAME_IS_DEFAULT_DEF, SSA_NAME_VERSION, SSA_VAL(), stmt_may_clobber_ref_p_1(), TREE_CODE, TREE_OPERAND, vn_reference_s::type, valid_info, vn_reference_s::value_id, vn_reference_lookup_1(), vn_reference_lookup_call(), vn_tables_obstack, vn_reference_s::vuse, and vuse_ssa_val().
Referenced by visit_stmt().
Visit a load from a reference operator RHS, part of STMT, value number it, and return true if the value number of the LHS has changed as a result.
References changed, const_unop(), CONSTANT_CLASS_P, default_vn_walk_kind, dump_file, dump_flags, gimple_vuse(), NULL_TREE, print_generic_expr(), vn_reference_s::punned, vn_reference_s::result, set_ssa_val_to(), SSA_VAL(), TDF_DETAILS, TREE_CODE, TREE_TYPE, gimple_match_cond::UNCOND, useless_type_conversion_p(), VN_INFO(), vn_nary_build_or_lookup(), vn_reference_insert(), vn_reference_lookup(), and vn_reference_s::vuse.
Referenced by visit_stmt().
Visit a store to a reference operator LHS, part of STMT, value number it, and return true if the value number of the LHS has changed as a result.
References alias_set_subset_of(), ao_ref_alias_set(), ao_ref_base_alias_set(), ao_ref_init(), vn_reference_s::base_set, build2(), changed, default_vn_walk_kind, dump_file, dump_flags, expressions_equal_p(), gcc_checking_assert, gimple_vdef(), gimple_vuse(), is_gimple_min_invariant(), is_gimple_reg(), NULL, print_generic_expr(), vn_reference_s::result, vn_reference_s::set, set_ssa_val_to(), SSA_VAL(), TDF_DETAILS, TREE_CODE, TREE_TYPE, VN_NOWALK, vn_reference_insert(), vn_reference_lookup(), VN_WALK, and vn_reference_s::vuse.
Referenced by visit_stmt().
Visit and value number STMT, return true if the value number changed.
References changed, DECL_P, default_vn_walk_kind, defs_to_varying(), dump_file, dump_flags, dyn_cast(), ECF_CONST, ECF_PURE, ERF_NOALIAS, flags_from_decl_or_type(), gimple_assign_copy_p(), gimple_assign_lhs(), gimple_assign_rhs1(), gimple_assign_rhs_code(), gimple_call_flags(), gimple_call_fn(), gimple_call_internal_p(), gimple_call_lhs(), gimple_call_return_flags(), gimple_fold_stmt_to_constant_1(), gimple_has_volatile_ops(), gimple_vdef(), gimple_vuse(), is_gimple_min_invariant(), NULL, print_generic_expr(), print_gimple_expr(), print_gimple_stmt(), REFERENCE_CLASS_P, set_ssa_val_to(), SSA_NAME_OCCURS_IN_ABNORMAL_PHI, SSA_VAL(), TDF_DETAILS, TREE_CODE, TREE_OPERAND, try_to_simplify(), visit_copy(), visit_nary_op(), visit_phi(), visit_reference_op_call(), visit_reference_op_load(), visit_reference_op_store(), vn_get_stmt_kind(), VN_NARY, VN_REFERENCE, vn_valueize, and VN_WALK.
Referenced by process_bb().
Return the vn_kind the expression computed by the stmt should be associated with.
References get_gimple_rhs_class(), gimple_assign_rhs1(), gimple_assign_rhs_code(), GIMPLE_BINARY_RHS, GIMPLE_SINGLE_RHS, GIMPLE_TERNARY_RHS, GIMPLE_UNARY_RHS, is_gimple_min_invariant(), tcc_constant, tcc_declaration, tcc_reference, TREE_CODE, TREE_CODE_CLASS, TREE_OPERAND, VN_CONSTANT, VN_NARY, VN_NONE, VN_PHI, and VN_REFERENCE.
Referenced by compute_avail(), visit_nary_op(), and visit_stmt().
vn_ssa_aux_t VN_INFO | ( | tree | name | ) |
References alloc_vn_nary_op_noinit(), boolean_false_node, boolean_true_node, boolean_type_node, build_int_cst(), dump_file, dump_flags, gcc_assert, gcc_unreachable, init_vn_nary_op_from_pieces(), last_inserted_nary, vn_ssa_aux::name, vn_tables_s::nary, vn_nary_op_s::next, nonnull_arg_p(), NULL, POINTER_TYPE_P, vn_nary_op_s::predicated_values, print_generic_expr(), vn_nary_op_s::result, SSA_NAME_IS_DEFAULT_DEF, SSA_NAME_VAR, SSA_NAME_VERSION, TDF_DETAILS, TDF_SLIM, TREE_CODE, TREE_TYPE, vn_nary_op_s::u, vn_nary_op_s::unwind_to, valid_info, vn_ssa_aux::valnum, vn_ssa_aux::visited, vn_nary_op_insert_into(), vn_ssa_aux_hash, vn_ssa_aux_obstack, vn_tables_insert_obstack, and VN_TOP.
Referenced by eliminate_dom_walker::after_dom_children(), create_expression_by_pieces(), do_pre_regular_insertion(), eliminate_dom_walker::eliminate_avail(), rpo_elim::eliminate_avail(), eliminate_dom_walker::eliminate_insert(), eliminate_dom_walker::eliminate_push_avail(), rpo_elim::eliminate_push_avail(), eliminate_dom_walker::eliminate_stmt(), find_or_generate_expression(), get_or_alloc_expr_for_name(), get_representative_for(), insert_into_preds_of_block(), op_valid_in_sets(), phi_translate_1(), pre_expr_DFS(), process_bb(), rpo_vn_valueize(), run_rpo_vn(), set_ssa_val_to(), set_value_id_for_result(), tail_merge_valueize(), visit_reference_op_load(), vn_nary_build_or_lookup_1(), vn_nary_op_insert_stmt(), vn_phi_insert(), vn_reference_insert(), vn_reference_lookup_or_insert_for_pieces(), and vn_valnum_from_value_id().
|
static |
Hook for maybe_push_res_to_seq, lookup the expression in the VN tables.
References gimple_match_op::code, CONSTRUCTOR_ELT, CONSTRUCTOR_NELTS, eliminate_dom_walker::eliminate_avail(), i, code_helper::is_tree_code(), mprts_hook, NULL, NULL_TREE, gimple_match_op::num_ops, gimple_match_op::ops, rpo_avail, TREE_CODE, gimple_match_op::type, vn_context_bb, and vn_nary_op_lookup_pieces().
Referenced by try_to_simplify(), and vn_nary_build_or_lookup_1().
|
static |
Return a value-number for RCODE OPS... either by looking up an existing value-number for the simplified result or by inserting the operation.
References vn_nary_build_or_lookup_1().
Referenced by visit_nary_op(), visit_reference_op_load(), and vn_reference_lookup_3().
|
static |
Return a value-number for RCODE OPS... either by looking up an existing value-number for the possibly simplified result or by inserting the operation if INSERT is true. If SIMPLIFY is false, return a value number for the unsimplified expression.
References alloc_vn_nary_op_noinit(), as_a(), dump_file, dump_flags, gcc_assert, get_next_value_id(), gimple_assign_lhs(), gimple_seq_add_stmt_without_update(), gimple_seq_first_stmt(), gimple_seq_singleton_p(), gimple_simplified_result_is_gimple_val(), i, init_vn_nary_op_from_stmt(), insert(), last_inserted_nary, vn_nary_op_s::length, maybe_push_res_to_seq(), mprts_hook, vn_tables_s::nary, vn_ssa_aux::needs_insertion, vn_nary_op_s::next, NULL, NULL_TREE, gimple_match_op::num_ops, gimple_match_op::ops, vn_nary_op_s::predicated_values, print_generic_expr(), print_gimple_expr(), gimple_match_op::resimplify(), vn_nary_op_s::result, SSA_VAL(), TDF_DETAILS, TDF_SLIM, TREE_CODE, vn_nary_op_s::u, valid_info, vn_ssa_aux::valnum, vn_nary_op_s::value_id, vn_ssa_aux::value_id, vn_ssa_aux::visited, VN_INFO(), vn_lookup_simplify_result(), vn_nary_length_from_stmt(), vn_nary_op_insert_into(), vn_nary_op_lookup_stmt(), vn_tables_insert_obstack, and vn_valueize.
Referenced by visit_nary_op(), vn_nary_build_or_lookup(), and vn_nary_simplify().
unsigned int vn_nary_length_from_stmt | ( | gimple * | stmt | ) |
Return the number of operands for a vn_nary ops structure from STMT.
References CONSTRUCTOR_NELTS, gimple_assign_rhs1(), gimple_assign_rhs_code(), and gimple_num_ops().
Referenced by compute_avail(), vn_nary_build_or_lookup_1(), vn_nary_op_insert_stmt(), and vn_nary_op_lookup_stmt().
bool vn_nary_may_trap | ( | vn_nary_op_t | nary | ) |
Return true if the nary operation NARY may trap. This is a copy of stmt_could_throw_1_p adjusted to the SCCVN IL.
References FLOAT_TYPE_P, i, INTEGRAL_TYPE_P, vn_nary_op_s::length, NULL_TREE, vn_nary_op_s::op, vn_nary_op_s::opcode, operation_could_trap_helper_p(), tcc_binary, tcc_comparison, tcc_unary, TREE_CODE_CLASS, tree_could_trap_p(), type(), vn_nary_op_s::type, and TYPE_OVERFLOW_TRAPS.
Referenced by compute_avail(), and prune_clobbered_mems().
hashval_t vn_nary_op_compute_hash | ( | const vn_nary_op_t | vno1 | ) |
Compute and return the hash value for nary operation VBO1.
References inchash::add_expr(), inchash::hash::add_int(), commutative_ternary_tree_code(), commutative_tree_code(), inchash::hash::end(), i, vn_nary_op_s::length, vn_nary_op_s::op, vn_nary_op_s::opcode, swap_tree_comparison(), tcc_comparison, TREE_CODE_CLASS, and tree_swap_operands_p().
Referenced by get_or_alloc_expr_for_nary(), vn_nary_op_insert_into(), and vn_nary_op_lookup_1().
bool vn_nary_op_eq | ( | const_vn_nary_op_t const | vno1, |
const_vn_nary_op_t const | vno2 ) |
Compare nary operations VNO1 and VNO2 and return true if they are equivalent.
References expressions_equal_p(), vn_nary_op_s::hashcode, i, vn_nary_op_s::length, vn_nary_op_s::op, vn_nary_op_s::opcode, TREE_CODE, TREE_TYPE, vn_nary_op_s::type, TYPE_PRECISION, and types_compatible_p().
Referenced by pre_expr_d::equal(), and vn_nary_op_hasher::equal().
|
static |
References BASIC_BLOCK_FOR_FN, CDI_DOMINATORS, cfun, dominated_by_p(), dominated_by_p_w_unex(), i, vn_pval::next, NULL_TREE, vn_nary_op_s::predicated_values, vn_nary_op_s::result, vn_nary_op_s::u, and vn_nary_op_s::values.
Referenced by process_bb(), visit_nary_op(), visit_phi(), and vn_nary_op_get_predicated_value().
|
static |
References vn_nary_op_get_predicated_value().
|
static |
Insert VNO into TABLE.
References BASIC_BLOCK_FOR_FN, CDI_DOMINATORS, cfun, dominated_by_p(), dump_file, dump_flags, expressions_equal_p(), gcc_assert, vn_nary_op_s::hashcode, i, basic_block_def::index, last_inserted_nary, vn_nary_op_s::length, vn_pval::n, vn_nary_op_s::next, vn_pval::next, vn_reference_s::next, NULL, vn_nary_op_s::op, vn_nary_op_s::predicated_values, vn_nary_op_s::result, vn_pval::result, vn_reference_s::result, SSA_VAL(), table, TDF_DETAILS, TREE_CODE, vn_nary_op_s::u, vn_nary_op_s::unwind_to, vn_pval::valid_dominated_by_p, vn_nary_op_s::values, vn_nary_op_compute_hash(), and vn_tables_obstack.
Referenced by VN_INFO(), vn_nary_build_or_lookup_1(), vn_nary_op_insert_pieces(), vn_nary_op_insert_pieces_predicated(), and vn_nary_op_insert_stmt().
vn_nary_op_t vn_nary_op_insert_pieces | ( | unsigned int | length, |
enum tree_code | code, | ||
tree | type, | ||
tree * | ops, | ||
tree | result, | ||
unsigned int | value_id ) |
Insert a n-ary operation into the current hash table using it's pieces. Return the vn_nary_op_t structure we created and put in the hashtable.
References alloc_vn_nary_op(), init_vn_nary_op_from_pieces(), vn_tables_s::nary, vn_reference_s::result, valid_info, vn_reference_s::value_id, and vn_nary_op_insert_into().
Referenced by vn_reference_insert().
|
static |
References alloc_vn_nary_op(), can_track_predicate_on_edge(), dump_file, dump_flags, gcc_assert, get_tree_code_name(), init_vn_nary_op_from_pieces(), integer_zerop(), vn_pval::n, vn_tables_s::nary, vn_pval::next, NULL, NULL_TREE, vn_nary_op_s::predicated_values, print_generic_expr(), vn_pval::result, vn_reference_s::result, tcc_comparison, TDF_DETAILS, TDF_SLIM, TREE_CODE_CLASS, vn_nary_op_s::u, vn_pval::valid_dominated_by_p, valid_info, vn_reference_s::value_id, vn_nary_op_s::values, vn_nary_op_insert_into(), and vn_tables_obstack.
Referenced by insert_predicates_for_cond(), and insert_related_predicates_on_edge().
|
static |
Insert the rhs of STMT into the current hash table with a value number of RESULT.
References alloc_vn_nary_op(), as_a(), init_vn_nary_op_from_stmt(), vn_tables_s::nary, vn_reference_s::result, valid_info, vn_reference_s::value_id, VN_INFO(), vn_nary_length_from_stmt(), and vn_nary_op_insert_into().
Referenced by visit_nary_op().
|
static |
Compute the hashcode for VNO and look for it in the hash table; return the resulting value number if it exists in the hash table. Return NULL_TREE if it does not exist in the hash table or if the result field of the operation is NULL. VNRESULT will contain the vn_nary_op_t from the hashtable if it exists.
References hash_table< Descriptor, Lazy, Allocator >::find_slot_with_hash(), vn_nary_op_s::hashcode, i, vn_nary_op_s::length, vn_tables_s::nary, NULL, NULL_TREE, vn_nary_op_s::op, SSA_VAL(), TREE_CODE, valid_info, and vn_nary_op_compute_hash().
Referenced by vn_nary_op_lookup_pieces(), and vn_nary_op_lookup_stmt().
tree vn_nary_op_lookup_pieces | ( | unsigned int | length, |
enum tree_code | code, | ||
tree | type, | ||
tree * | ops, | ||
vn_nary_op_t * | vnresult ) |
Lookup a n-ary operation by its pieces and return the resulting value number if it exists in the hash table. Return NULL_TREE if it does not exist in the hash table or if the result field of the operation is NULL. VNRESULT will contain the vn_nary_op_t from the hashtable if it exists.
References init_vn_nary_op_from_pieces(), sizeof_vn_nary_op(), and vn_nary_op_lookup_1().
Referenced by phi_translate_1(), process_bb(), valueized_wider_op(), visit_nary_op(), visit_phi(), vn_lookup_simplify_result(), and vn_reference_lookup().
tree vn_nary_op_lookup_stmt | ( | gimple * | stmt, |
vn_nary_op_t * | vnresult ) |
Lookup the rhs of STMT in the current hash table, and return the resulting value number if it exists in the hash table. Return NULL_TREE if it does not exist in the hash table. VNRESULT will contain the vn_nary_op_t from the hashtable if it exists.
References as_a(), init_vn_nary_op_from_stmt(), sizeof_vn_nary_op(), vn_nary_length_from_stmt(), and vn_nary_op_lookup_1().
Referenced by compute_avail(), visit_nary_op(), and vn_nary_build_or_lookup_1().
tree vn_nary_simplify | ( | vn_nary_op_t | nary | ) |
Try to simplify the expression RCODE OPS... of type TYPE and return its value if present.
References vn_nary_op_s::length, gimple_match_op::MAX_NUM_OPS, NULL_TREE, vn_nary_op_s::op, vn_nary_op_s::opcode, gimple_match_op::ops, vn_nary_op_s::type, gimple_match_cond::UNCOND, and vn_nary_build_or_lookup_1().
Referenced by fully_constant_expression().
|
inlinestatic |
Compute a hashcode for PHI operation VP1 and return it.
References inchash::add_expr(), inchash::hash::add_int(), vn_phi_s::block, vn_phi_s::cclhs, EDGE_COUNT, inchash::hash::end(), FOR_EACH_EDGE, basic_block_def::index, inchash::hash::merge_hash(), vn_phi_s::phiargs, basic_block_def::preds, type(), vn_phi_s::type, vn_hash_type(), and VN_TOP.
Referenced by vn_phi_insert(), and vn_phi_lookup().
|
static |
vn_phi hashtable helpers.
Compare two phi entries for equality, ignoring VN_TOP arguments.
References as_a(), vn_phi_s::block, vn_phi_s::cclhs, vn_phi_s::ccrhs, CDI_DOMINATORS, cond_stmts_equal_p(), EDGE_COUNT, expressions_equal_p(), extract_true_false_controlled_edges(), gcc_checking_assert, get_immediate_dominator(), gsi_last_bb(), vn_phi_s::hashcode, loop::header, i, basic_block_def::loop_father, vn_phi_s::phiargs, basic_block_def::preds, basic_block_def::succs, vn_phi_s::type, and types_compatible_p().
Referenced by vn_phi_hasher::equal().
Insert PHI into the current hash table with a value number of RESULT.
References vn_phi_s::block, vn_phi_s::cclhs, vn_phi_s::ccrhs, CDI_DOMINATORS, EDGE_COUNT, hash_table< Descriptor, Lazy, Allocator >::find_slot_with_hash(), FOR_EACH_EDGE, gcc_assert, get_immediate_dominator(), gimple_bb(), gimple_cond_lhs(), gimple_cond_rhs(), gimple_phi_num_args(), gimple_phi_result(), gsi_last_bb(), vn_phi_s::hashcode, loop::header, last_inserted_phi, basic_block_def::loop_father, vn_phi_s::next, NULL_TREE, PHI_ARG_DEF_FROM_EDGE, vn_phi_s::phiargs, vn_tables_s::phis, basic_block_def::preds, vn_phi_s::result, safe_dyn_cast(), ssa_undefined_value_p(), SSA_VAL(), basic_block_def::succs, TREE_CODE, TREE_TYPE, vn_phi_s::type, valid_info, vn_phi_s::value_id, vn_ssa_aux::value_id, virtual_operand_p(), VN_INFO(), vn_phi_compute_hash(), vn_tables_obstack, VN_TOP, and vn_valueize.
Referenced by visit_phi().
Lookup PHI in the current hash table, and return the resulting value number if it exists in the hash table. Return NULL_TREE if it does not exist in the hash table.
References vn_phi_s::block, vn_phi_s::cclhs, vn_phi_s::ccrhs, CDI_DOMINATORS, EDGE_COUNT, hash_table< Descriptor, Lazy, Allocator >::find_slot_with_hash(), FOR_EACH_EDGE, get_immediate_dominator(), gimple_bb(), gimple_cond_lhs(), gimple_cond_rhs(), gimple_phi_num_args(), gimple_phi_result(), gsi_last_bb(), vn_phi_s::hashcode, loop::header, basic_block_def::loop_father, NULL_TREE, PHI_ARG_DEF_FROM_EDGE, vn_phi_s::phiargs, vn_tables_s::phis, basic_block_def::preds, safe_dyn_cast(), ssa_undefined_value_p(), SSA_VAL(), basic_block_def::succs, TREE_CODE, TREE_TYPE, vn_phi_s::type, valid_info, virtual_operand_p(), vn_phi_compute_hash(), VN_TOP, and vn_valueize.
Referenced by visit_phi().
|
static |
Compute a hash for the reference operation VR1 and return it.
References inchash::add_expr(), inchash::hash::add_int(), inchash::hash::add_poly_int(), inchash::hash::end(), FOR_EACH_VEC_ELT, i, known_eq, vn_reference_op_struct::off, vn_reference_op_struct::op0, vn_reference_op_struct::opcode, vn_reference_s::operands, SSA_NAME_VERSION, TREE_CODE, TREE_OPERAND, vn_reference_op_compute_hash(), and vn_reference_s::vuse.
Referenced by vn_reference_insert(), vn_reference_insert_pieces(), vn_reference_lookup(), vn_reference_lookup_3(), vn_reference_lookup_call(), vn_reference_lookup_or_insert_for_pieces(), and vn_reference_lookup_pieces().
bool vn_reference_eq | ( | const_vn_reference_t const | vr1, |
const_vn_reference_t const | vr2 ) |
Return true if reference operations VR1 and VR2 are equivalent. This means they have the same set of operands and vuses.
References COMPLETE_TYPE_P, expressions_equal_p(), vn_reference_s::hashcode, i, INTEGRAL_TYPE_P, known_eq, vn_reference_s::max_size, mode_can_transfer_bits(), vn_reference_op_struct::off, vn_reference_s::offset, vn_reference_op_struct::op0, vn_reference_op_struct::opcode, vn_reference_s::operands, vn_reference_op_struct::reverse, TREE_CODE, TREE_INT_CST_LOW, TREE_OPERAND, TREE_TYPE, vn_reference_op_struct::type, vn_reference_s::type, TYPE_MODE, TYPE_PRECISION, TYPE_SIZE, TYPE_VECTOR_SUBPARTS(), types_compatible_p(), VECTOR_BOOLEAN_TYPE_P, vn_reference_op_eq(), and vn_reference_s::vuse.
Referenced by pre_expr_d::equal(), and vn_reference_hasher::equal().
|
static |
Fold *& at position *I_P in a vn_reference_op_s vector *OPS. Updates *I_P to point to the last element of the replacement.
References build_fold_addr_expr, poly_int< N, C >::from(), gcc_checking_assert, get_addr_base_and_unit_offset_1(), i, vn_reference_op_struct::off, vn_reference_op_struct::op0, SIGNED, wi::to_poly_wide(), TREE_CODE, tree_fits_shwi_p(), TREE_OPERAND, tree_to_shwi(), TREE_TYPE, vn_valueize, and wide_int_to_tree().
Referenced by valueize_refs_1(), and vn_reference_maybe_forwprop_address().
Insert OP into the current hash table with a value number of RESULT.
References ao_ref_alias_set(), ao_ref_base_alias_set(), ao_ref_init(), vn_reference_s::base_set, cfun, poly_int< N, C >::coeffs, dump_file, dump_flags, hash_table< Descriptor, Lazy, Allocator >::find_slot_with_hash(), free_reference(), gcc_assert, get_or_alloc_constant_value_id(), vn_reference_s::hashcode, i, known_eq, last_inserted_ref, vn_reference_s::max_size, vn_reference_s::next, vn_reference_op_struct::off, vn_reference_s::offset, vn_reference_op_struct::opcode, operand_equal_p(), vn_reference_s::operands, print_generic_expr(), PROP_objsz, vn_reference_s::punned, vn_tables_s::references, vn_reference_s::result, vn_reference_s::result_vdef, vn_reference_s::set, sext_hwi(), sizetype, SSA_VAL(), TDF_DETAILS, TREE_CODE, TREE_TYPE, vn_reference_s::type, TYPE_PRECISION, valid_info, vn_reference_s::value_id, vn_ssa_aux::value_id, valueize_shared_reference_ops_from_ref(), VN_INFO(), vn_nary_op_insert_pieces(), vn_reference_compute_hash(), vn_tables_obstack, vn_reference_s::vuse, vuse_ssa_val(), and wide_int_to_tree().
Referenced by visit_reference_op_load(), and visit_reference_op_store().
vn_reference_t vn_reference_insert_pieces | ( | tree | vuse, |
alias_set_type | set, | ||
alias_set_type | base_set, | ||
poly_int64 | offset, | ||
poly_int64 | max_size, | ||
tree | type, | ||
vec< vn_reference_op_s > | operands, | ||
tree | result, | ||
unsigned int | value_id ) |
Insert a reference by it's pieces into the current hash table with a value number of RESULT. Return the resulting reference structure we created.
References vn_reference_s::base_set, hash_table< Descriptor, Lazy, Allocator >::find_slot_with_hash(), gcc_assert, vn_reference_s::hashcode, last_inserted_ref, vn_reference_s::max_size, vn_reference_s::next, NULL_TREE, offset, vn_reference_s::offset, vn_reference_s::operands, vn_reference_s::punned, vn_tables_s::references, vn_reference_s::result, vn_reference_s::result_vdef, vn_reference_s::set, SSA_VAL(), TREE_CODE, type(), vn_reference_s::type, valid_info, vn_reference_s::value_id, valueize_refs(), vn_reference_compute_hash(), vn_tables_obstack, vn_reference_s::vuse, and vuse_ssa_val().
Referenced by phi_translate_1(), and vn_reference_lookup_or_insert_for_pieces().
tree vn_reference_lookup | ( | tree | op, |
tree | vuse, | ||
vn_lookup_kind | kind, | ||
vn_reference_t * | vnresult, | ||
bool | tbaa_p, | ||
tree * | last_vuse_ptr, | ||
tree | mask, | ||
bool | redundant_store_removal_p ) |
Lookup OP in the current hash table, and return the resulting value number if it exists in the hash table. Return NULL_TREE if it does not exist in the hash table or if the result field of the structure was NULL.. VNRESULT will be filled in with the vn_reference_t stored in the hashtable if one exists. When TBAA_P is false assume we are looking up a store and treat it as having alias-set zero. *LAST_VUSE_PTR will be updated with the VUSE the value lookup succeeded. MASK is either NULL_TREE, or can be an INTEGER_CST if the result of the load is bitwise anded with MASK and so we are only interested in a subset of the bits and can ignore if the other bits are uninitialized or not initialized with constants. When doing redundant store removal the caller has to set REDUNDANT_STORE_REMOVAL_P.
References ao_ref_alias_set(), ao_ref_base(), ao_ref_base_alias_set(), ao_ref_init(), ao_ref_init_from_vn_reference(), vn_reference_s::base_set, cfun, poly_int< N, C >::coeffs, copy_reference_ops_from_ref(), fully_constant_vn_reference_p(), gcc_assert, gcc_checking_assert, vn_reference_s::hashcode, i, known_eq, vn_reference_s::max_size, NULL, NULL_TREE, vn_reference_op_struct::off, vn_reference_s::offset, vn_reference_op_struct::opcode, operand_equal_p(), vn_reference_s::operands, PROP_objsz, r, vn_reference_s::result, vn_reference_s::set, sext_hwi(), shared_lookup_references, sizetype, TREE_TYPE, vn_reference_s::type, TYPE_PRECISION, valueize_refs_1(), valueize_shared_reference_ops_from_ref(), vn_nary_op_lookup_pieces(), VN_NOWALK, vn_reference_compute_hash(), vn_reference_lookup_1(), vn_reference_lookup_2(), vn_reference_lookup_3(), vn_reference_s::vuse, vuse_ssa_val(), vuse_valueize(), walk_non_aliased_vuses(), and wide_int_to_tree().
Referenced by eliminate_dom_walker::eliminate_stmt(), visit_nary_op(), visit_reference_op_load(), and visit_reference_op_store().
|
static |
Lookup a SCCVN reference operation VR in the current hash table. Returns the resulting value number if it exists in the hash table, NULL_TREE otherwise. VNRESULT will be filled in with the actual vn_reference_t stored in the hashtable if something is found.
References hash_table< Descriptor, Lazy, Allocator >::find_slot_with_hash(), vn_reference_s::hashcode, NULL_TREE, vn_tables_s::references, and valid_info.
Referenced by visit_reference_op_call(), vn_reference_lookup(), vn_reference_lookup_3(), vn_reference_lookup_call(), vn_reference_lookup_or_insert_for_pieces(), and vn_reference_lookup_pieces().
Callback for walk_non_aliased_vuses. Adjusts the vn_reference_t VR_ with the current VUSE and performs the expression lookup.
References ao_ref_base(), vn_reference_s::base_set, cfun, hash_table< Descriptor, Lazy, Allocator >::find_slot_with_hash(), vn_reference_s::hashcode, integer_zerop(), ipcp_get_aggregate_const(), poly_int< N, C >::is_constant(), known_eq, ao_ref::max_size, ao_ref::max_size_known_p(), NULL, NULL_TREE, ao_ref::offset, vn_tables_s::references, vn_reference_s::set, ao_ref::size, SSA_NAME_IS_DEFAULT_DEF, SSA_NAME_VAR, SSA_NAME_VERSION, TREE_CODE, TREE_OPERAND, valid_info, vn_reference_s::vuse, and vuse_ssa_val().
Referenced by vn_reference_lookup(), and vn_reference_lookup_pieces().
|
static |
Callback for walk_non_aliased_vuses. Tries to perform a lookup from the statement defining VUSE and if not successful tries to translate *REFP and VR_ through an aggregate copy at the definition of VUSE. If *DISAMBIGUATE_ONLY is true then do not perform translation of *REF and *VR. If only disambiguation was performed then *DISAMBIGUATE_ONLY is set to true.
References adjust_offsets_for_equal_base_address(), AGGREGATE_TYPE_P, ao_ref_alias_set(), ao_ref_base(), ao_ref_base_alias_set(), ao_ref_init(), ao_ref_init_from_ptr_and_size(), ao_ref_init_from_vn_reference(), as_a(), bitsize_int, build_constructor(), build_fold_addr_expr, build_int_cst(), build_nonstandard_integer_type(), build_zero_cst(), BUILT_IN_NORMAL, call_may_clobber_ref_p_1(), CHAR_BIT, CONSTANT_CLASS_P, CONSTRUCTOR_NELTS, contains_storage_order_barrier_p(), copy_reference_ops_from_ref(), DECL_P, dump_file, dump_flags, fold_convert, FOR_EACH_VEC_ELT, poly_int< N, C >::from(), fully_constant_vn_reference_p(), gcc_assert, gcc_unreachable, get_addr_base_and_unit_offset(), get_deref_alias_set(), GET_MODE_SIZE(), get_object_alignment(), get_ref_base_and_extent(), gimple_assign_lhs(), gimple_assign_rhs1(), gimple_assign_rhs2(), gimple_assign_rhs_code(), gimple_assign_single_p(), gimple_bb(), gimple_call_arg(), gimple_call_builtin_p(), gimple_call_internal_fn(), gimple_call_internal_p(), gimple_call_num_args(), gimple_call_set_arg(), gimple_clobber_p(), gimple_vuse(), handled_component_p(), vn_reference_s::hashcode, i, int_const_binop(), int_fits_type_p(), integer_zerop(), INTEGRAL_TYPE_P, internal_fn_len_index(), internal_fn_mask_index(), internal_fn_stored_value_index(), internal_store_fn_p(), INTTYPE_MAXIMUM, poly_int< N, C >::is_constant(), is_gimple_assign(), is_gimple_call(), is_gimple_min_invariant(), is_gimple_reg_type(), known_eq, known_lt, ao_ref::max_size, vn_reference_s::max_size, ao_ref::max_size_known_p(), mem_ref_offset(), native_encode_expr(), native_interpret_expr(), NULL, NULL_TREE, OEP_ADDRESS_OF, vn_reference_op_struct::off, ao_ref::offset, offset, pd_data::offset, vn_reference_s::offset, vn_reference_op_struct::op0, vn_reference_op_struct::opcode, operand_equal_p(), vn_reference_s::operands, poly_int_tree_p(), print_gimple_stmt(), ptr_type_node, r, ao_ref::ref, refs_may_alias_p_1(), vn_reference_s::result, vn_reference_op_struct::reverse, reverse_storage_order_for_component_p(), pd_data::rhs, pd_data::rhs_off, SCALAR_INT_TYPE_MODE, shared_lookup_references, shift_bytes_in_array_left(), shift_bytes_in_array_right(), SIGNED, ao_ref::size, pd_data::size, SSA_NAME_DEF_STMT, SSA_NAME_OCCURS_IN_ABNORMAL_PHI, SSA_NAME_VERSION, SSA_VAL(), stmt_kills_ref_p(), storage_order_barrier_p(), TDF_DETAILS, wi::to_poly_offset(), wi::to_poly_wide(), TR_DISAMBIGUATE, TR_TRANSLATE, TR_VALUEIZE_AND_DISAMBIGUATE, TREE_CODE, tree_fits_poly_int64_p(), tree_fits_shwi_p(), tree_fits_uhwi_p(), tree_int_cst_equal(), TREE_INT_CST_LOW, TREE_OPERAND, tree_to_poly_int64(), tree_to_shwi(), tree_to_uhwi(), TREE_TYPE, vn_reference_op_struct::type, vn_reference_s::type, type_has_mode_precision_p(), TYPE_MODE, TYPE_PRECISION, TYPE_REVERSE_STORAGE_ORDER, TYPE_SIZE, TYPE_SIZE_UNIT, TYPE_UNSIGNED, TYPE_VECTOR_SUBPARTS(), types_compatible_p(), gimple_match_cond::UNCOND, valueize_refs(), valueize_refs_1(), VECTOR_CST_ELT, vn_context_bb, vn_nary_build_or_lookup(), vn_reference_compute_hash(), vn_reference_lookup_1(), vn_reference_op_eq(), vn_valueize, VN_WALKREWRITE, vn_reference_s::vuse, and vuse_ssa_val().
Referenced by vn_reference_lookup(), and vn_reference_lookup_pieces().
void vn_reference_lookup_call | ( | gcall * | call, |
vn_reference_t * | vnresult, | ||
vn_reference_t | vr ) |
Lookup CALL in the current hash table and return the entry in *VNRESULT if found. Populates *VR for the hashtable lookup.
References vn_reference_s::base_set, gimple_call_lhs(), gimple_vuse(), vn_reference_s::hashcode, vn_reference_s::max_size, NULL, NULL_TREE, vn_reference_s::offset, vn_reference_s::operands, vn_reference_s::punned, vn_reference_s::set, SSA_VAL(), TREE_CODE, TREE_TYPE, vn_reference_s::type, valueize_shared_reference_ops_from_call(), vn_reference_compute_hash(), vn_reference_lookup_1(), and vn_reference_s::vuse.
Referenced by compute_avail(), and visit_reference_op_call().
|
static |
Lookup an existing or insert a new vn_reference entry into the value table for the VUSE, SET, TYPE, OPERANDS reference which has the value VALUE which is either a constant or an SSA name.
References vn_reference_s::base_set, get_or_alloc_constant_value_id(), vn_reference_s::hashcode, vn_reference_s::max_size, NULL_TREE, offset, vn_reference_s::offset, vn_reference_s::operands, vn_reference_s::set, SSA_VAL(), TREE_CODE, type(), vn_reference_s::type, vn_ssa_aux::value_id, VN_INFO(), vn_reference_compute_hash(), vn_reference_insert_pieces(), vn_reference_lookup_1(), and vn_reference_s::vuse.
Referenced by vn_walk_cb_data::finish().
tree vn_reference_lookup_pieces | ( | tree | vuse, |
alias_set_type | set, | ||
alias_set_type | base_set, | ||
tree | type, | ||
vec< vn_reference_op_s > | operands, | ||
vn_reference_t * | vnresult, | ||
vn_lookup_kind | kind ) |
Lookup a reference operation by it's parts, in the current hash table. Returns the resulting value number if it exists in the hash table, NULL_TREE otherwise. VNRESULT will be filled in with the actual vn_reference_t stored in the hashtable if something is found.
References ao_ref_init_from_vn_reference(), vn_reference_s::base_set, fully_constant_vn_reference_p(), gcc_checking_assert, vn_reference_s::hashcode, vn_reference_s::max_size, NULL, NULL_TREE, vn_reference_s::offset, operand_equal_p(), vn_reference_s::operands, r, vn_reference_s::set, shared_lookup_references, type(), vn_reference_s::type, valueize_refs_1(), VN_NOWALK, vn_reference_compute_hash(), vn_reference_lookup_1(), vn_reference_lookup_2(), vn_reference_lookup_3(), vn_reference_s::vuse, vuse_ssa_val(), vuse_valueize(), and walk_non_aliased_vuses().
Referenced by compute_avail(), and phi_translate_1().
bool vn_reference_may_trap | ( | vn_reference_t | ref | ) |
Return true if the reference operation REF may trap.
References FOR_EACH_VEC_ELT, i, vn_reference_op_struct::op0, vn_reference_op_struct::op1, vn_reference_op_struct::opcode, vn_reference_s::operands, TREE_CODE, tree_could_trap_p(), tree_int_cst_lt(), TREE_OPERAND, TYPE_DOMAIN, and TYPE_MAX_VALUE.
Referenced by compute_avail(), and prune_clobbered_mems().
|
static |
Fold *& at position *I_P in a vn_reference_op_s vector *OPS. Updates *I_P to point to the last element of the replacement.
References changed, copy_reference_ops_from_ref(), default_vn_walk_kind, poly_int< N, C >::from(), gcc_assert, get_addr_base_and_unit_offset_1(), gimple_assign_rhs1(), gimple_assign_rhs2(), gimple_assign_rhs_code(), i, is_gimple_assign(), known_eq, mem_ref_offset(), vn_reference_op_struct::off, vn_reference_op_struct::op0, vn_reference_op_struct::opcode, poly_int_tree_p(), SIGNED, SSA_NAME_DEF_STMT, SSA_NAME_OCCURS_IN_ABNORMAL_PHI, SSA_VAL(), wi::to_poly_offset(), wi::to_poly_wide(), TREE_CODE, tree_fits_shwi_p(), TREE_OPERAND, tree_to_shwi(), TREE_TYPE, vn_reference_fold_indirect(), vn_valueize, VN_WALKREWRITE, and wide_int_to_tree().
Referenced by valueize_refs_1().
|
static |
Compute the hash for a reference operand VRO1.
References inchash::add_expr(), inchash::hash::add_int(), vn_reference_op_struct::clique, vn_reference_op_struct::op0, vn_reference_op_struct::op1, vn_reference_op_struct::op2, and vn_reference_op_struct::opcode.
Referenced by vn_reference_compute_hash().
|
static |
Compare two reference operands P1 and P2 for equality. Return true if they are equal, and false otherwise.
References vn_reference_op_struct::clique, expressions_equal_p(), vn_reference_op_struct::op0, vn_reference_op_struct::op1, vn_reference_op_struct::op2, vn_reference_op_struct::opcode, vn_reference_op_struct::type, TYPE_MAIN_VARIANT, and types_compatible_p().
Referenced by vn_reference_eq(), and vn_reference_lookup_3().
vec< vn_reference_op_s > vn_reference_operands_for_lookup | ( | tree | op | ) |
Return a reference op vector from OP that can be used for vn_reference_lookup_pieces. The caller is responsible for releasing the vector.
References valueize_shared_reference_ops_from_ref().
Referenced by compute_avail().
References gimple_bb(), SSA_NAME_DEF_STMT, SSA_NAME_IS_DEFAULT_DEF, vn_context_bb, and vn_valueize.
Referenced by process_bb().
Return the SSA value of the VUSE x, supporting released VDEFs during elimination which will value-number the VDEF to the associated VUSE (but not substitute in the whole lattice).
References gcc_assert, NULL_TREE, SSA_NAME_IN_FREE_LIST, SSA_VAL(), and VN_TOP.
Referenced by visit_reference_op_call(), vn_reference_insert(), vn_reference_insert_pieces(), vn_reference_lookup(), vn_reference_lookup_2(), vn_reference_lookup_3(), and vn_reference_lookup_pieces().
Similar to the above but used as callback for walk_non_aliased_vuses and thus should stop at unvisited VUSE to not walk across region boundaries.
References gcc_assert, NULL_TREE, SSA_NAME_IN_FREE_LIST, SSA_VAL(), visited, and VN_TOP.
Referenced by vn_reference_lookup(), and vn_reference_lookup_pieces().
|
static |
Referenced by free_rpo_vn(), get_constant_value_id(), get_or_alloc_constant_value_id(), and run_rpo_vn().
|
static |
|
static |
Referenced by do_rpo_vn_1(), do_unwind(), VN_INFO(), vn_nary_build_or_lookup_1(), and vn_nary_op_insert_into().
|
static |
Referenced by do_rpo_vn_1(), do_unwind(), and vn_phi_insert().
|
static |
Referenced by do_rpo_vn_1(), do_unwind(), visit_reference_op_call(), vn_reference_insert(), and vn_reference_insert_pieces().
|
static |
Referenced by do_rpo_vn_1(), do_unwind(), and rpo_elim::eliminate_push_avail().
|
static |
Referenced by do_rpo_vn_1(), get_max_constant_value_id(), and get_next_constant_value_id().
|
static |
Unique counter for our value ids.
Referenced by do_rpo_vn_1(), get_max_value_id(), and get_next_value_id().
|
static |
Global RPO state for access from hooks.
Referenced by do_rpo_vn_1(), eliminate_with_rpo_vn(), rpo_vn_valueize(), visit_nary_op(), and vn_lookup_simplify_result().
|
static |
|
static |
Valid hashtables storing information we have proven to be correct.
Referenced by do_rpo_vn_1(), do_unwind(), free_rpo_vn(), set_hashtable_value_ids(), visit_reference_op_call(), VN_INFO(), vn_nary_build_or_lookup_1(), vn_nary_op_insert_pieces(), vn_nary_op_insert_pieces_predicated(), vn_nary_op_insert_stmt(), vn_nary_op_lookup_1(), vn_phi_insert(), vn_phi_lookup(), vn_reference_insert(), vn_reference_insert_pieces(), vn_reference_lookup_1(), and vn_reference_lookup_2().
basic_block vn_context_bb |
Context that valueization should operate on.
Referenced by eliminate_dom_walker::before_dom_children(), compute_avail(), do_rpo_vn_1(), phi_translate(), process_bb(), rpo_vn_valueize(), visit_nary_op(), vn_lookup_simplify_result(), vn_reference_lookup_3(), and vn_valueize_for_srt().
|
static |
Referenced by do_rpo_vn_1(), free_rpo_vn(), has_VN_INFO(), SSA_VAL(), and VN_INFO().
|
static |
Referenced by do_rpo_vn_1(), rpo_elim::eliminate_push_avail(), free_rpo_vn(), and VN_INFO().
|
static |
Special obstack we never unwind.
Referenced by do_rpo_vn_1(), free_rpo_vn(), VN_INFO(), and vn_nary_build_or_lookup_1().
|
static |
Obstack we allocate the vn-tables elements from.
Referenced by alloc_vn_nary_op(), do_rpo_vn_1(), do_unwind(), free_rpo_vn(), visit_reference_op_call(), vn_nary_op_insert_into(), vn_nary_op_insert_pieces_predicated(), vn_phi_insert(), vn_reference_insert(), and vn_reference_insert_pieces().
tree VN_TOP |
This represents the top of the VN lattice, which is the universal value.
Referenced by do_rpo_vn_1(), rpo_elim::eliminate_avail(), rpo_elim::eliminate_push_avail(), eliminate_dom_walker::eliminate_stmt(), expressions_equal_p(), process_bb(), rpo_vn_valueize(), run_rpo_vn(), set_ssa_val_to(), tail_merge_valueize(), visit_phi(), VN_INFO(), vn_phi_compute_hash(), vn_phi_insert(), vn_phi_lookup(), vuse_ssa_val(), and vuse_valueize().
Valueization hook for simplify_replace_tree. Valueize NAME if it is an SSA name, otherwise just return it.
Referenced by do_rpo_vn_1(), insert_predicates_for_cond(), process_bb(), try_to_simplify(), valueize_refs_1(), valueized_wider_op(), visit_stmt(), vn_nary_build_or_lookup_1(), vn_phi_insert(), vn_phi_lookup(), vn_reference_fold_indirect(), vn_reference_lookup_3(), vn_reference_maybe_forwprop_address(), and vn_valueize_for_srt().