|
GCC Middle and Back End API Reference
|

Go to the source code of this file.
Data Structures | |
| struct | vn_pval |
| struct | vn_nary_op_s |
| struct | vn_phi_s |
| struct | vn_reference_op_struct |
| struct | vn_reference_s |
| struct | vn_constant_s |
| struct | vn_avail |
| struct | vn_ssa_aux |
Typedefs | |
| typedef struct vn_nary_op_s * | vn_nary_op_t |
| typedef const struct vn_nary_op_s * | const_vn_nary_op_t |
| typedef struct vn_phi_s * | vn_phi_t |
| typedef const struct vn_phi_s * | const_vn_phi_t |
| typedef struct vn_reference_op_struct | vn_reference_op_s |
| typedef vn_reference_op_s * | vn_reference_op_t |
| typedef const vn_reference_op_s * | const_vn_reference_op_t |
| typedef struct vn_reference_s * | vn_reference_t |
| typedef const struct vn_reference_s * | const_vn_reference_t |
| typedef struct vn_constant_s * | vn_constant_t |
| typedef struct vn_ssa_aux * | vn_ssa_aux_t |
Enumerations | |
| enum | vn_kind { VN_NONE , VN_CONSTANT , VN_NARY , VN_REFERENCE , VN_PHI } |
| enum | vn_lookup_kind { VN_NOWALK , VN_WALK , VN_WALKREWRITE } |
Variables | |
| tree | VN_TOP |
| tree(*) | vn_valueize (tree) |
| basic_block | vn_context_bb |
| typedef const struct vn_nary_op_s* const_vn_nary_op_t |
| typedef const struct vn_phi_s* const_vn_phi_t |
| typedef const vn_reference_op_s* const_vn_reference_op_t |
| typedef const struct vn_reference_s* const_vn_reference_t |
| typedef struct vn_constant_s * vn_constant_t |
| typedef struct vn_nary_op_s * vn_nary_op_t |
N-ary operations in the hashtable consist of length operands, an opcode, and a type. Result is the value number of the operation, and hashcode is stored to avoid having to calculate it repeatedly.
Phi nodes in the hashtable consist of their non-VN_TOP phi arguments, and the basic block the phi is in. Result is the value number of the operation, and hashcode is stored to avoid having to calculate it repeatedly. Phi nodes not in the same block are never considered equivalent.
| typedef struct vn_reference_op_struct vn_reference_op_s |
Reference operands only exist in reference operations structures. They consist of an opcode, type, and some number of operands. For a given opcode, some, all, or none of the operands may be used. The operands are there to store the information that makes up the portion of the addressing calculation that opcode performs.
| typedef vn_reference_op_s* vn_reference_op_t |
| typedef struct vn_reference_s * vn_reference_t |
A reference operation in the hashtable is representation as the vuse, representing the memory state at the time of the operation, and a collection of operands that make up the addressing calculation. If two vn_reference_t's have the same set of operands, they access the same memory location. We also store the resulting value number, and the hashcode.
| typedef struct vn_ssa_aux * vn_ssa_aux_t |
| enum vn_kind |
| enum vn_lookup_kind |
| 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 alloc_vn_nary_op_noinit(), and sizeof_vn_nary_op().
Referenced by alloc_vn_nary_op(), alloc_vn_nary_op_noinit(), get_or_alloc_expr_for_nary(), scc_vn_restore_ssa_info(), VN_INFO(), and vn_nary_build_or_lookup_1().
| 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_init_from_vn_reference(), 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, 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 ao_ref_init_from_vn_reference(), scc_vn_restore_ssa_info(), translate_vuse_through_block(), value_dies_in_block_x(), vn_reference_lookup(), vn_reference_lookup_3(), and vn_reference_lookup_pieces().
| void copy_reference_ops_from_ref | ( | tree | ref, |
| vec< vn_reference_op_s > * | result ) |
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(), copy_reference_ops_from_ref(), 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 compute_avail(), copy_reference_ops_from_call(), copy_reference_ops_from_ref(), scc_vn_restore_ssa_info(), valueize_shared_reference_ops_from_ref(), vn_reference_lookup(), vn_reference_lookup_3(), and vn_reference_maybe_forwprop_address().
| 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(), do_rpo_vn_1(), and free_rpo_vn().
Referenced by do_rpo_vn(), execute_early_warn_uninitialized(), tree_if_conversion(), tree_loop_unroll_and_jam(), and tree_unroll_loops_completely().
| unsigned eliminate_with_rpo_vn | ( | bitmap | inserted_exprs | ) |
Eliminate fully redundant computations.
References CDI_DOMINATORS, cfun, eliminate_dom_walker::eliminate_cleanup(), eliminate_with_rpo_vn(), rpo_avail, and dom_walker::walk().
Referenced by do_rpo_vn_1(), and eliminate_with_rpo_vn().
Tree SCC value numbering Copyright (C) 2007-2026 Free Software Foundation, Inc. Contributed by Daniel Berlin <dberlin@dberlin.org> This file is part of GCC. GCC is free software; you can redistribute it and/or modify under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, 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/>.
In tree-ssa-sccvn.cc
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 expressions_equal_p(), OEP_PURE_SAME, operand_equal_p(), TREE_CODE, and VN_TOP.
Referenced by cond_stmts_equal_p(), expressions_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().
| void free_rpo_vn | ( | void | ) |
Free VN associated data structures.
References constant_to_value_id, FOR_EACH_HASH_TABLE_ELEMENT, free_rpo_vn(), 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(), and 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(), fully_constant_vn_reference_p(), 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_vn_reference_p(), 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, get_constant_value_id(), vn_constant_s::hashcode, and vn_hash_constant_with_type().
Referenced by get_constant_value_id(), and scc_vn_restore_ssa_info().
| unsigned int get_max_constant_value_id | ( | void | ) |
Return the maximum constant value id we have ever seen.
References get_max_constant_value_id(), and next_constant_value_id.
Referenced by get_max_constant_value_id(), init_pre(), and scc_vn_restore_ssa_info().
| unsigned int get_max_value_id | ( | void | ) |
Return the maximum value id we have ever seen.
References get_max_value_id(), and next_value_id.
Referenced by get_max_value_id(), init_pre(), and scc_vn_restore_ssa_info().
| unsigned int get_next_constant_value_id | ( | void | ) |
Return the next unique value id for constants.
References gcc_checking_assert, get_next_constant_value_id(), and next_constant_value_id.
Referenced by get_next_constant_value_id(), get_or_alloc_constant_value_id(), and scc_vn_restore_ssa_info().
| unsigned int get_next_value_id | ( | void | ) |
Return the next unique value id.
References gcc_checking_assert, get_next_value_id(), and next_value_id.
Referenced by create_expression_by_pieces(), get_next_value_id(), get_or_alloc_expr_for_nary(), get_or_alloc_expr_for_reference(), run_rpo_vn(), scc_vn_restore_ssa_info(), 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(), get_or_alloc_constant_value_id(), vn_constant_s::hashcode, and vn_hash_constant_with_type().
Referenced by get_or_alloc_constant_value_id(), get_or_alloc_expr_for_constant(), run_rpo_vn(), scc_vn_restore_ssa_info(), set_value_id_for_result(), vn_reference_insert(), and vn_reference_lookup_or_insert_for_pieces().
Return the value numbering info for an SSA_NAME.
Return whether there is value numbering information for a given SSA name.
References hash_table< Descriptor, Lazy, Allocator >::find_with_hash(), has_VN_INFO(), SSA_NAME_VERSION, and vn_ssa_aux_hash.
Referenced by eliminate_dom_walker::eliminate_stmt(), has_VN_INFO(), and tail_merge_valueize().
| 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, init_vn_nary_op_from_stmt(), 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(), init_vn_nary_op_from_stmt(), scc_vn_restore_ssa_info(), vn_nary_build_or_lookup_1(), vn_nary_op_insert_stmt(), and vn_nary_op_lookup_stmt().
| 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(), print_vn_reference_ops(), tcc_declaration, TREE_CODE_CLASS, TREE_TYPE, vn_reference_op_struct::type, and TYPE_ALIGN.
Referenced by debug_vn_reference_ops(), print_pre_expr(), print_vn_reference_ops(), and scc_vn_restore_ssa_info().
| 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(), hash_table< Descriptor, Lazy, Allocator >::hash_table(), i, is_gimple_min_invariant(), NULL, print_generic_expr(), run_rpo_vn(), set_hashtable_value_ids(), SSA_VAL(), TDF_DETAILS, TREE_CODE, vn_ssa_aux::valnum, vn_reference_s::value_id, vn_ssa_aux::value_id, vn_ssa_aux::visited, VN_INFO(), and VN_TOP.
Referenced by run_rpo_vn().
| void scc_vn_restore_ssa_info | ( | void | ) |
References alloc_vn_nary_op_noinit(), ao_ref_init_from_vn_reference(), copy_reference_ops_from_ref(), get_constant_value_id(), get_max_constant_value_id(), get_max_value_id(), get_next_constant_value_id(), get_next_value_id(), get_or_alloc_constant_value_id(), init_vn_nary_op_from_stmt(), NULL, NULL_TREE, print_vn_reference_ops(), scc_vn_restore_ssa_info(), vn_nary_length_from_stmt(), vn_nary_may_trap(), vn_nary_op_compute_hash(), vn_nary_op_eq(), vn_nary_op_insert_pieces(), vn_nary_op_lookup_pieces(), vn_nary_op_lookup_stmt(), vn_pp_nary_for_addr(), vn_reference_compute_hash(), vn_reference_eq(), vn_reference_insert_pieces(), vn_reference_lookup(), vn_reference_lookup_call(), vn_reference_lookup_pieces(), vn_reference_may_trap(), and vn_reference_operands_for_lookup().
Referenced by scc_vn_restore_ssa_info().
|
inline |
Return the size of a vn_nary_op_t with LENGTH operands.
References vn_nary_op_s::length, and sizeof_vn_nary_op().
Referenced by alloc_vn_nary_op_noinit(), compute_avail(), get_or_alloc_expr_for_nary(), phi_translate_1(), sizeof_vn_nary_op(), vn_nary_op_lookup_pieces(), and vn_nary_op_lookup_stmt().
|
inline |
Return true if V is a value id for a constant.
References value_id_constant_p().
Referenced by add_to_value(), bitmap_find_leader(), bitmap_insert_into_set(), bitmap_set_contains_value(), bitmap_value_insert_into_set(), bitmap_value_replace_in_set(), compute_avail(), find_or_generate_expression(), get_or_alloc_expr_for_nary(), phi_translate(), value_id_constant_p(), and vn_valnum_from_value_id().
Compare the constants C1 and C2 with distinguishing type incompatible constants in the types_compatible_p sense.
References expressions_equal_p(), TREE_TYPE, types_compatible_p(), and vn_constant_eq_with_type().
Referenced by pre_expr_d::equal(), vn_constant_hasher::equal(), and vn_constant_eq_with_type().
References vn_get_expr_for().
Referenced by vn_get_expr_for().
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_get_stmt_kind(), VN_NARY, VN_NONE, VN_PHI, and VN_REFERENCE.
Referenced by compute_avail(), visit_nary_op(), visit_stmt(), and vn_get_stmt_kind().
|
inline |
Hash the constant CONSTANT with distinguishing type incompatible constants in the types_compatible_p sense.
References inchash::add_expr(), inchash::hash::end(), inchash::hash::merge_hash(), TREE_TYPE, vn_hash_constant_with_type(), and vn_hash_type().
Referenced by get_constant_value_id(), get_or_alloc_constant_value_id(), pre_expr_d::hash(), and vn_hash_constant_with_type().
|
inline |
Hash the type TYPE using bits that distinguishes it in the types_compatible_p sense.
References INTEGRAL_TYPE_P, TYPE_PRECISION, TYPE_UNSIGNED, and vn_hash_type().
Referenced by vn_hash_constant_with_type(), vn_hash_type(), and vn_phi_compute_hash().
|
extern |
References alloc_vn_nary_op_noinit(), boolean_false_node, boolean_true_node, boolean_type_node, build_int_cst(), dump_file, dump_flags, hash_table< Descriptor, Lazy, Allocator >::find_slot_with_hash(), 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(), 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_INFO(), 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_INFO(), 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().
| 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(), gimple_num_ops(), and vn_nary_length_from_stmt().
Referenced by compute_avail(), scc_vn_restore_ssa_info(), vn_nary_build_or_lookup_1(), vn_nary_length_from_stmt(), 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(), vn_nary_op_s::type, TYPE_OVERFLOW_TRAPS, and vn_nary_may_trap().
Referenced by compute_avail(), prune_clobbered_mems(), scc_vn_restore_ssa_info(), and vn_nary_may_trap().
| 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, tree_swap_operands_p(), and vn_nary_op_compute_hash().
Referenced by get_or_alloc_expr_for_nary(), scc_vn_restore_ssa_info(), vn_nary_op_compute_hash(), 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, types_compatible_p(), and vn_nary_op_eq().
Referenced by pre_expr_d::equal(), vn_nary_op_hasher::equal(), scc_vn_restore_ssa_info(), and vn_nary_op_eq().
| 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, vn_nary_op_insert_into(), and vn_nary_op_insert_pieces().
Referenced by scc_vn_restore_ssa_info(), vn_nary_op_insert_pieces(), and vn_reference_insert().
| 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(), vn_nary_op_lookup_1(), and vn_nary_op_lookup_pieces().
Referenced by compute_avail(), phi_translate_1(), process_bb(), scc_vn_restore_ssa_info(), valueized_wider_op(), visit_nary_op(), visit_phi(), vn_lookup_simplify_result(), vn_nary_op_lookup_pieces(), 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(), vn_nary_op_lookup_1(), and vn_nary_op_lookup_stmt().
Referenced by compute_avail(), scc_vn_restore_ssa_info(), visit_nary_op(), vn_nary_build_or_lookup_1(), and vn_nary_op_lookup_stmt().
| 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. Update NARY with a simplified expression if it fits.
References gimple_match_op::code, i, code_helper::is_tree_code(), vn_nary_op_s::length, gimple_match_op::MAX_NUM_OPS, NULL_TREE, gimple_match_op::num_ops, vn_nary_op_s::op, vn_nary_op_s::opcode, gimple_match_op::ops, SSA_NAME_OCCURS_IN_ABNORMAL_PHI, TREE_CODE, vn_nary_op_s::type, gimple_match_cond::UNCOND, vn_nary_build_or_lookup_1(), and vn_nary_simplify().
Referenced by phi_translate_1(), and vn_nary_simplify().
| bool vn_pp_nary_for_addr | ( | const vec< vn_reference_op_s > & | operands, |
| tree | ops[2] ) |
When OPERANDS is an ADDR_EXPR that can be possibly expressed as a POINTER_PLUS_EXPR return true and fill in its operands in OPS.
References poly_int< N, C >::coeffs, gcc_assert, i, known_eq, vn_reference_op_struct::off, vn_reference_op_struct::opcode, vn_reference_s::operands, sext_hwi(), sizetype, TYPE_PRECISION, vn_pp_nary_for_addr(), and wide_int_to_tree().
Referenced by compute_avail(), scc_vn_restore_ssa_info(), vn_pp_nary_for_addr(), vn_reference_insert(), and vn_reference_lookup().
|
inline |
References vn_reference_op_struct::align, and vn_ref_op_align_unit().
Referenced by copy_reference_ops_from_ref(), create_component_ref_by_pieces_1(), valueize_refs_1(), and vn_ref_op_align_unit().
| hashval_t vn_reference_compute_hash | ( | const vn_reference_t | vr1 | ) |
Compute a hash for the reference operation VR1 and return it.
References inchash::add_expr(), inchash::hash::add_int(), inchash::hash::add_poly_hwi(), inchash::hash::end(), FOR_EACH_VEC_ELT, poly_int< N, C >::force_shwi(), 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_compute_hash(), vn_reference_op_compute_hash(), and vn_reference_s::vuse.
Referenced by compute_avail(), phi_translate_1(), scc_vn_restore_ssa_info(), vn_reference_compute_hash(), 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, | ||
| bool | lexical ) |
Return true if reference operations VR1 and VR2 are equivalent. This means they have the same set of operands and vuses. If LEXICAL is true then the full access path has to be the same.
References COMPLETE_TYPE_P, expressions_equal_p(), get_deref_alias_set(), 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::op2, vn_reference_op_struct::opcode, operand_equal_p(), 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_ALIGN, TYPE_MODE, TYPE_PRECISION, TYPE_SIZE, TYPE_VECTOR_SUBPARTS(), types_compatible_p(), VECTOR_BOOLEAN_TYPE_P, vn_reference_eq(), vn_reference_op_eq(), and vn_reference_s::vuse.
Referenced by pre_expr_d::equal(), vn_reference_hasher::equal(), scc_vn_restore_ssa_info(), and vn_reference_eq().
| 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, 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, vn_reference_s::type, valid_info, vn_reference_s::value_id, valueize_refs(), vn_reference_compute_hash(), vn_reference_insert_pieces(), vn_tables_obstack, vn_reference_s::vuse, and vuse_ssa_val().
Referenced by scc_vn_restore_ssa_info(), vn_reference_insert_pieces(), 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, copy_reference_ops_from_ref(), fully_constant_vn_reference_p(), gcc_assert, 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, PROP_objsz, r, vn_reference_s::result, vn_reference_s::set, shared_lookup_references, TREE_TYPE, vn_reference_s::type, valueize_refs_1(), valueize_shared_reference_ops_from_ref(), vn_is_backedge(), vn_nary_op_lookup_pieces(), VN_NOWALK, vn_pp_nary_for_addr(), vn_reference_compute_hash(), vn_reference_lookup(), 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 eliminate_dom_walker::eliminate_stmt(), scc_vn_restore_ssa_info(), visit_nary_op(), visit_reference_op_load(), visit_reference_op_store(), and vn_reference_lookup().
| 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(), vn_reference_lookup_call(), and vn_reference_s::vuse.
Referenced by compute_avail(), scc_vn_restore_ssa_info(), visit_reference_op_call(), and vn_reference_lookup_call().
| 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, vn_reference_s::type, valueize_refs_1(), vn_is_backedge(), VN_NOWALK, vn_reference_compute_hash(), vn_reference_lookup_1(), vn_reference_lookup_2(), vn_reference_lookup_3(), vn_reference_lookup_pieces(), vn_reference_s::vuse, vuse_ssa_val(), vuse_valueize(), and walk_non_aliased_vuses().
Referenced by compute_avail(), phi_translate_1(), scc_vn_restore_ssa_info(), and vn_reference_lookup_pieces().
| 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, TYPE_MAX_VALUE, and vn_reference_may_trap().
Referenced by compute_avail(), prune_clobbered_mems(), scc_vn_restore_ssa_info(), and vn_reference_may_trap().
| 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(), and vn_reference_operands_for_lookup().
Referenced by compute_avail(), scc_vn_restore_ssa_info(), and vn_reference_operands_for_lookup().
|
extern |
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(), vn_lookup_simplify_result(), vn_nary_result_avail_or_insertable_p(), vn_reference_lookup_3(), and vn_valueize_for_srt().
|
extern |
TOP of the VN lattice.
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().
Valueize NAME if it is an SSA name, otherwise just return it. This hook is initialized by run_scc_vn.
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(), ssa_integral_conversion_op(), try_to_simplify(), valueize_refs_1(), valueized_wider_op(), visit_nary_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().