GCC Middle and Back End API Reference
|
Data Structures | |
struct | vn_nary_op_hasher |
struct | vn_phi_hasher |
struct | vn_reference_hasher |
struct | vn_tables_s |
struct | vn_constant_hasher |
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 |
Variables | |
static hash_table < vn_constant_hasher > | constant_to_value_id |
static bitmap | constant_value_ids |
static vn_tables_t | valid_info |
static vn_tables_t | optimistic_info |
static vn_tables_t | current_info |
static int * | rpo_numbers |
tree | VN_TOP |
static unsigned int | next_value_id |
static unsigned int | next_dfs_num |
static vec< tree > | sccstack |
static vec< vn_ssa_aux_t > | vn_ssa_aux_table |
static struct obstack | vn_ssa_aux_obstack |
static vec< vn_reference_op_s > | shared_lookup_references |
static tree * | last_vuse_ptr |
static vn_lookup_kind | vn_walk_kind |
static vn_lookup_kind | default_vn_walk_kind |
static vec< tree > | shared_lookup_phiargs |
typedef vn_nary_op_table_type::iterator vn_nary_op_iterator_type |
typedef vn_phi_table_type::iterator vn_phi_iterator_type |
typedef hash_table<vn_phi_hasher> vn_phi_table_type |
typedef vn_reference_table_type::iterator vn_reference_iterator_type |
typedef struct vn_tables_s * vn_tables_t |
The set of hashtables and alloc_pool's for their items.
|
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_tables_s::nary_obstack, vn_nary_op_s::result, vn_reference_s::result, vn_nary_op_s::value_id, and vn_reference_s::value_id.
Referenced by vn_nary_op_insert(), vn_nary_op_insert_pieces(), and vn_nary_op_insert_stmt().
|
static |
Allocate a vn_nary_op_t with LENGTH operands on STACK.
References sizeof_vn_nary_op().
Referenced by alloc_vn_nary_op(), and copy_nary().
|
static |
Allocate a value number table.
References hash_table< Descriptor, Allocator >::create(), create_alloc_pool(), vn_tables_s::nary, vn_tables_s::nary_obstack, vn_tables_s::phis, vn_tables_s::phis_pool, vn_tables_s::references, and vn_tables_s::references_pool.
Referenced by init_scc_vn().
bool ao_ref_init_from_vn_reference | ( | ao_ref * | ref, |
alias_set_type | set, | ||
tree | type, | ||
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_s::base, ao_ref_s::base_alias_set, get_alias_set(), get_deref_alias_set(), host_integerp(), HOST_WIDE_INT, ao_ref_s::max_size, vn_reference_op_struct::off, ao_ref_s::offset, offset, vn_reference_op_struct::op0, vn_reference_op_struct::op1, vn_reference_op_struct::op2, vn_reference_op_struct::opcode, ao_ref_s::ref, ao_ref_s::ref_alias_set, ao_ref_s::size, tree_low_cst(), vn_reference_op_struct::type, and ao_ref_s::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().
|
static |
Compare two operands by reverse postorder index
References gimple_bb(), gimple_nop_p(), gimple_uid(), basic_block_def::index, and rpo_numbers.
Referenced by sort_scc().
|
static |
Insert the no longer used nary ONARY to the hash INFO.
References alloc_vn_nary_op_noinit(), vn_nary_op_s::length, memcpy(), vn_tables_s::nary, vn_tables_s::nary_obstack, sizeof_vn_nary_op(), and vn_nary_op_insert_into().
Referenced by process_scc().
|
static |
Insert the no longer used phi OPHI to the hash INFO.
References hash_table< Descriptor, Allocator >::find_slot_with_hash(), vn_phi_s::hashcode, memcpy(), vn_phi_s::phiargs, vn_tables_s::phis, vn_tables_s::phis_pool, and pool_alloc().
Referenced by process_scc().
|
static |
Insert the no longer used reference OREF to the hash INFO.
References hash_table< Descriptor, Allocator >::find_slot_with_hash(), free_reference(), vn_reference_s::hashcode, memcpy(), vn_reference_s::operands, pool_alloc(), vn_tables_s::references, and vn_tables_s::references_pool.
Referenced by process_scc().
void copy_reference_ops_from_call | ( | gimple | call, |
vec< vn_reference_op_s > * | result | ||
) |
Copy the operations present in load/store/call REF into RESULT, a vector of vn_reference_op_s's.
References copy_reference_ops_from_ref(), gimple_call_arg(), gimple_call_chain(), gimple_call_fn(), gimple_call_lhs(), gimple_call_num_args(), gimple_call_return_type(), memset(), vn_reference_op_struct::off, vn_reference_op_struct::op0, vn_reference_op_struct::op1, vn_reference_op_struct::opcode, and vn_reference_op_struct::type.
Referenced by compute_avail(), create_reference_ops_from_call(), and valueize_shared_reference_ops_from_call().
void copy_reference_ops_from_ref | ( | ) |
Copy the operations present in load/store REF into RESULT, a vector of vn_reference_op_s's.
References array_ref_element_size(), array_ref_low_bound(), build_int_cst(), build_pointer_type(), component_ref_field_offset(), exact_log2(), double_int::fits_shwi(), host_integerp(), is_gimple_min_invariant(), double_int::low, memset(), 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, double_int::rshift(), tree_to_double_int(), and vn_reference_op_struct::type.
Referenced by copy_reference_ops_from_call(), valueize_shared_reference_ops_from_ref(), and vn_reference_lookup_3().
|
static |
Create a vector of vn_reference_op_s structures from CALL, a call statement. The vector is not shared.
References copy_reference_ops_from_call(), and vNULL.
Referenced by visit_reference_op_call().
|
static |
Set all definitions in STMT to value number to themselves. Return true if a value number changed.
References changed, and set_ssa_val_to().
Referenced by visit_use().
|
static |
Depth first search on NAME to discover and process SCC's in the SSA graph. Execution of this algorithm relies on the fact that the SCC's are popped off the stack in topological order. Returns true if successful, false if we stopped processing SCC's due to resource constraints.
References clear_and_done_ssa_iter(), vn_ssa_aux::dfsnum, extract_and_process_scc_for_name(), gimple_nop_p(), vn_ssa_aux::low, memcpy(), next_dfs_num, vn_ssa_aux::on_sccstack, op_iter_done(), op_iter_init_phiuse(), op_iter_init_use(), op_iter_next_use(), vn_ssa_aux::visited, visited, VN_INFO(), and vNULL.
Referenced by run_scc_vn().
|
static |
Referenced by visit_reference_op_load(), and visit_use().
|
static |
Return true if EXPR contains constants.
References is_gimple_min_invariant(), tcc_binary, tcc_declaration, tcc_reference, and tcc_unary.
bool expressions_equal_p | ( | ) |
Compare two expressions E1 and E2 and return true if they are equal.
References OEP_PURE_SAME, and operand_equal_p().
Referenced by visit_phi(), visit_reference_op_store(), vn_constant_eq_with_type(), vn_nary_op_eq(), vn_phi_eq(), vn_reference_eq(), and vn_reference_op_eq().
|
static |
Pop the components of the found SCC for NAME off the SCC stack and process them. Returns true if all went well, false if we run into resource limits.
References dump_file, dump_flags, vn_ssa_aux::on_sccstack, print_scc(), process_scc(), sort_scc(), VN_INFO(), and vNULL.
Referenced by DFS().
|
inlinestatic |
Free a reference operation structure VP.
References vn_reference_s::operands.
Referenced by copy_reference(), vn_reference_hasher::remove(), visit_reference_op_call(), vn_reference_insert(), and vn_reference_insert_pieces().
void free_scc_vn | ( | void | ) |
References hash_table< Descriptor, Allocator >::dispose(), free_vn_table(), release_ssa_name(), rpo_numbers, VN_INFO(), and vn_ssa_aux_obstack.
Referenced by do_pre(), execute_fre(), and run_scc_vn().
|
static |
Free a value number table.
References hash_table< Descriptor, Allocator >::dispose(), free_alloc_pool(), vn_tables_s::nary, vn_tables_s::nary_obstack, vn_tables_s::phis, vn_tables_s::phis_pool, vn_tables_s::references, and vn_tables_s::references_pool.
Referenced by free_scc_vn().
tree fully_constant_vn_reference_p | ( | ) |
Optimize the reference REF to a constant if possible or return NULL_TREE if not.
References build_call_expr(), build_int_cst_type(), compare_tree_int(), integer_zerop(), is_gimple_min_invariant(), vn_reference_op_struct::op0, vn_reference_op_struct::op1, vn_reference_op_struct::opcode, vn_reference_s::operands, tcc_constant, tree_int_cst_sgn(), and vn_reference_op_struct::type.
Referenced by fully_constant_expression(), vn_reference_lookup(), and vn_reference_lookup_pieces().
unsigned int get_constant_value_id | ( | ) |
Lookup a value id for CONSTANT and return it. If it does not exist returns 0.
References vn_constant_s::constant, hash_table< Descriptor, Allocator >::find_slot_with_hash(), vn_constant_s::hashcode, vn_constant_s::value_id, and vn_hash_constant_with_type().
Referenced by get_expr_value_id().
unsigned int get_max_value_id | ( | void | ) |
Return the maximum value id we have ever seen.
References next_value_id.
Referenced by init_pre(), and phi_translate_1().
unsigned int get_next_value_id | ( | void | ) |
Return the next unique value id.
References next_value_id.
Referenced by create_expression_by_pieces(), get_or_alloc_constant_value_id(), phi_translate_1(), run_scc_vn(), set_value_id_for_result(), and visit_reference_op_load().
unsigned int get_or_alloc_constant_value_id | ( | ) |
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 bitmap_set_bit(), vn_constant_s::constant, hash_table< Descriptor, Allocator >::find_slot_with_hash(), get_next_value_id(), vn_constant_s::hashcode, vn_constant_s::value_id, and vn_hash_constant_with_type().
Referenced by get_or_alloc_expr_for_constant(), run_scc_vn(), set_value_id_for_result(), vn_reference_insert(), and vn_reference_lookup_or_insert_for_pieces().
|
static |
References allocate_vn_table(), calculate_dominance_info(), CDI_DOMINATORS, hash_table< Descriptor, Allocator >::create(), create_tmp_var_raw(), vn_ssa_aux::expr, next_dfs_num, next_value_id, pre_and_rev_post_order_compute(), renumber_gimple_stmt_uids(), rpo_numbers, vn_ssa_aux::valnum, vn_ssa_aux::value_id, VN_INFO(), VN_INFO_GET(), vn_ssa_aux_obstack, and VN_TOP.
Referenced by run_scc_vn().
|
static |
Initialize VNO from OP.
References vn_nary_op_s::length, vn_nary_op_s::op, and vn_nary_op_s::type.
Referenced by vn_nary_op_insert(), and vn_nary_op_lookup().
|
static |
Initialize VNO from the pieces provided.
References vn_nary_op_s::length, memcpy(), vn_nary_op_s::op, vn_nary_op_s::type, and type().
Referenced by vn_nary_op_insert_pieces(), and vn_nary_op_lookup_pieces().
|
static |
Initialize VNO from STMT.
References gimple_assign_rhs1(), gimple_assign_rhs_code(), gimple_assign_single_p(), gimple_expr_type(), gimple_num_ops(), gimple_op(), vn_nary_op_s::length, vn_nary_op_s::op, and vn_nary_op_s::type.
Referenced by vn_nary_op_insert_stmt(), and vn_nary_op_lookup_stmt().
|
static |
Mark as processed all the definitions in the defining stmt of USE, or the USE itself.
References vn_ssa_aux::use_processed, and VN_INFO().
Referenced by visit_use().
|
static |
Print set of components in strongly connected component SCC to OUT.
References print_generic_expr().
Referenced by extract_and_process_scc_for_name().
|
static |
Process a strongly connected component in the SSA graph.
References cfun, changed, copy_nary(), copy_phi(), copy_reference(), dump_file, dump_flags, hash_table< Descriptor, Allocator >::empty(), empty_alloc_pool(), vn_ssa_aux::expr, vn_tables_s::nary, vn_tables_s::nary_obstack, optimistic_info, vn_tables_s::phis, vn_tables_s::phis_pool, vn_tables_s::references, vn_tables_s::references_pool, statistics_histogram_event(), vn_ssa_aux::use_processed, valid_info, visit_use(), and VN_INFO().
Referenced by extract_and_process_scc_for_name().
bool run_scc_vn | ( | ) |
Do SCCVN. Returns true if it finished, false if we bailed out due to resource constraints. DEFAULT_VN_WALK_KIND_ specifies how we use the alias oracle walking during the VN process.
References cfun, current_function_decl, default_vn_walk_kind, DFS(), dump_file, dump_flags, free_scc_vn(), get_next_value_id(), get_or_alloc_constant_value_id(), has_zero_uses(), init_scc_vn(), is_gimple_min_invariant(), print_generic_expr(), set_hashtable_value_ids(), ssa_default_def(), valid_info, vn_ssa_aux::valnum, vn_ssa_aux::value_id, visited, VN_INFO(), and VN_TOP.
Referenced by do_pre(), and execute_fre().
|
static |
Set the value ids in the valid hash tables.
References vn_tables_s::nary, vn_tables_s::phis, 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::value_id, vn_phi_s::value_id, and vn_reference_s::value_id.
Referenced by run_scc_vn().
|
inlinestatic |
Set the value number of FROM to TO, return true if it has changed as a result.
References dump_file, dump_flags, get_addr_base_and_unit_offset(), HOST_WIDE_INT, is_gimple_min_invariant(), operand_equal_p(), print_generic_expr(), vn_ssa_aux::valnum, 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_use().
|
static |
Set *ID according to RESULT.
References get_next_value_id(), get_or_alloc_constant_value_id(), is_gimple_min_invariant(), vn_ssa_aux::value_id, and VN_INFO().
Referenced by set_hashtable_value_ids().
|
static |
Simplify the binary expression RHS, and return the result if simplified.
References build_invariant_address(), fold_defer_overflow_warnings(), fold_undefer_overflow_warnings(), gimple_assign_rhs1(), gimple_assign_rhs2(), gimple_assign_rhs_code(), gimple_expr_type(), host_integerp(), is_gimple_min_invariant(), vn_reference_s::result, tcc_comparison, valid_gimple_rhs_p(), valueize_expr(), vn_get_expr_for(), VN_INFO(), and vn_valueize().
Referenced by try_to_simplify().
|
static |
Simplify the unary expression RHS, and return the result if simplified.
References gimple_assign_rhs1(), gimple_assign_rhs_code(), gimple_expr_type(), is_gimple_min_invariant(), vn_reference_s::result, valid_gimple_rhs_p(), valueize_expr(), vn_get_expr_for(), and VN_INFO().
Referenced by try_to_simplify().
|
static |
Sort an array containing members of a strongly connected component SCC so that the members are ordered by RPO number. This means that when the sort is complete, iterating through the array will give you the members in RPO order.
References compare_ops().
Referenced by extract_and_process_scc_for_name().
|
static |
Return true if STMT contains constants.
References get_gimple_rhs_class(), gimple_assign_rhs1(), gimple_assign_rhs2(), gimple_assign_rhs3(), gimple_assign_rhs_code(), GIMPLE_BINARY_RHS, GIMPLE_SINGLE_RHS, GIMPLE_TERNARY_RHS, GIMPLE_UNARY_RHS, and is_gimple_min_invariant().
Referenced by visit_use().
|
static |
Try to simplify RHS using equivalences and constant folding.
References gimple_assign_rhs_code(), gimple_fold_stmt_to_constant_1(), is_gimple_min_invariant(), simplify_binary_expression(), simplify_unary_expression(), tcc_binary, tcc_comparison, tcc_reference, tcc_unary, and vn_valueize().
Referenced by visit_use().
bool value_id_constant_p | ( | ) |
Return true if V is a value id for a constant.
References bitmap_bit_p().
Referenced by bitmap_find_leader(), bitmap_insert_into_set_1(), bitmap_remove_from_set(), bitmap_set_contains_value(), bitmap_set_replace_value(), bitmap_value_insert_into_set(), get_constant_for_value_id(), and phi_translate().
Referenced by simplify_binary_expression(), simplify_unary_expression(), and visit_reference_op_load().
|
static |
Replace SSA_NAMES in expr with their value numbers, and return the result. This is performed in place.
References tcc_binary, tcc_unary, and vn_valueize().
|
static |
|
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 double_int::fits_shwi(), double_int::low, 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, tree_to_double_int(), vn_reference_fold_indirect(), and vn_reference_maybe_forwprop_address().
Referenced by valueize_refs(), valueize_shared_reference_ops_from_ref(), and vn_reference_lookup_3().
|
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 visit_reference_op_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(), and vn_reference_lookup().
|
static |
Visit a copy between LHS and RHS, return true if the value number changed.
References vn_ssa_aux::expr, vn_ssa_aux::has_constants, set_ssa_val_to(), and VN_INFO().
Referenced by visit_phi(), and visit_use().
|
static |
Visit a nary operator RHS, value number it, and return true if the value number of LHS has changed as a result.
References changed, vn_phi_s::result, set_ssa_val_to(), vn_nary_op_insert_stmt(), and vn_nary_op_lookup_stmt().
Referenced by visit_use().
|
static |
Visit and value number PHI, return true if the value number changed.
References changed, vn_ssa_aux::expr, expressions_equal_p(), gimple_phi_num_args(), vn_ssa_aux::has_constants, is_gimple_min_invariant(), vn_reference_s::result, set_ssa_val_to(), visit_copy(), VN_INFO(), vn_phi_insert(), vn_phi_lookup(), and VN_TOP.
Referenced by ssa_propagate(), and visit_use().
|
static |
Visit a call STMT storing into LHS. Return true if the value number of the LHS has changed as a result.
References changed, create_reference_ops_from_call(), hash_table< Descriptor, Allocator >::find_slot_with_hash(), free_reference(), gimple_expr_type(), gimple_vdef(), gimple_vuse(), vn_ssa_aux::has_constants, vn_reference_s::hashcode, vn_reference_s::operands, pool_alloc(), vn_tables_s::references, vn_tables_s::references_pool, vn_reference_s::result, vn_reference_s::result_vdef, vn_reference_s::set, set_ssa_val_to(), vn_reference_s::type, valueize_refs(), valueize_shared_reference_ops_from_call(), VN_INFO(), vn_reference_compute_hash(), vn_reference_lookup_1(), and vn_reference_s::vuse.
Referenced by visit_use().
|
static |
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, default_vn_walk_kind, dump_file, dump_flags, vn_ssa_aux::expr, expr_has_constants(), get_next_value_id(), gimple_build_nop(), gimple_vuse(), vn_ssa_aux::has_constants, is_gimple_min_invariant(), last_vuse_ptr, make_temp_ssa_name(), vn_ssa_aux::needs_insertion, optimistic_info, print_generic_expr(), vn_reference_s::result, set_ssa_val_to(), useless_type_conversion_p(), valid_info, vn_ssa_aux::valnum, vn_ssa_aux::value_id, valueize_expr(), vn_get_expr_for(), VN_INFO(), VN_INFO_GET(), vn_nary_op_insert(), vn_nary_op_lookup(), vn_reference_insert(), and vn_reference_lookup().
Referenced by visit_use().
|
static |
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 changed, dump_file, dump_flags, expressions_equal_p(), gimple_vdef(), gimple_vuse(), is_gimple_min_invariant(), is_gimple_reg(), print_generic_expr(), vn_reference_s::result, vn_reference_s::result_vdef, set_ssa_val_to(), vn_ssa_aux::use_processed, VN_INFO(), VN_NOWALK, vn_reference_insert(), vn_reference_lookup(), and vn_reference_s::vuse.
Referenced by visit_use().
|
static |
Visit and value number USE, return true if the value number changed.
References changed, defs_to_varying(), dump_file, dump_flags, vn_ssa_aux::expr, expr_has_constants(), get_gimple_rhs_class(), gimple_assign_copy_p(), gimple_assign_lhs(), gimple_assign_rhs1(), gimple_assign_rhs_code(), GIMPLE_BINARY_RHS, gimple_call_flags(), gimple_call_internal_p(), gimple_call_lhs(), gimple_call_return_flags(), gimple_has_volatile_ops(), GIMPLE_TERNARY_RHS, GIMPLE_UNARY_RHS, gimple_vdef(), vn_ssa_aux::has_constants, is_gimple_assign(), is_gimple_call(), is_gimple_min_invariant(), mark_use_processed(), print_generic_expr(), print_gimple_expr(), print_gimple_stmt(), vn_reference_s::result, set_ssa_val_to(), stmt_has_constants(), try_to_simplify(), unshare_expr(), valid_gimple_rhs_p(), visit_copy(), visit_nary_op(), visit_phi(), visit_reference_op_call(), visit_reference_op_load(), visit_reference_op_store(), vn_get_stmt_kind(), VN_INFO(), VN_NARY, vn_nary_op_lookup(), and VN_REFERENCE.
Referenced by process_scc().
tree vn_get_expr_for | ( | ) |
Get the representative expression for the SSA_NAME NAME. Returns the representative SSA_NAME if there is no expression associated with it.
References vn_ssa_aux::expr, gimple_assign_rhs1(), gimple_assign_rhs2(), gimple_assign_rhs_code(), gimple_expr_type(), is_gimple_assign(), tcc_binary, tcc_exceptional, tcc_reference, tcc_unary, vn_ssa_aux::valnum, VN_INFO(), and VN_TOP.
Referenced by eliminate_insert(), simplify_binary_expression(), simplify_unary_expression(), and visit_reference_op_load().
enum vn_kind vn_get_stmt_kind | ( | ) |
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, VN_CONSTANT, VN_NARY, VN_NONE, VN_PHI, and VN_REFERENCE.
Referenced by compute_avail(), and visit_use().
vn_ssa_aux_t VN_INFO | ( | ) |
Return the value numbering information for a given SSA name.
Referenced by create_expression_by_pieces(), DFS(), do_regular_insertion(), eliminate_avail(), eliminate_bb(), eliminate_leave_block(), eliminate_push_avail(), extract_and_process_scc_for_name(), free_scc_vn(), get_expr_value_id(), get_representative_for(), init_scc_vn(), insert_into_preds_of_block(), mark_use_processed(), op_valid_in_sets(), phi_translate_1(), process_scc(), run_scc_vn(), sccvn_valnum_from_value_id(), set_ssa_val_to(), set_value_id_for_result(), simplify_binary_expression(), simplify_unary_expression(), visit_copy(), visit_phi(), visit_reference_op_call(), visit_reference_op_load(), visit_reference_op_store(), visit_use(), vn_get_expr_for(), vn_nary_op_insert(), vn_nary_op_insert_stmt(), vn_phi_insert(), vn_reference_insert(), vn_reference_lookup_or_insert_for_pieces(), and vn_valueize().
vn_ssa_aux_t VN_INFO_GET | ( | ) |
Initialize the value numbering info for a given SSA name. This should be called just once for every SSA name.
References memset(), and vn_ssa_aux_obstack.
Referenced by create_expression_by_pieces(), do_regular_insertion(), eliminate_insert(), get_representative_for(), init_scc_vn(), insert_into_preds_of_block(), and visit_reference_op_load().
|
inlinestatic |
Set the value numbering info for a given SSA name to a given value.
|
static |
Return the number of operands for a vn_nary ops structure from STMT.
References gimple_assign_rhs1(), gimple_assign_rhs_code(), and gimple_num_ops().
Referenced by vn_nary_op_insert_stmt(), and vn_nary_op_lookup_stmt().
bool vn_nary_may_trap | ( | ) |
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 vn_nary_op_s::length, vn_nary_op_s::op, operation_could_trap_helper_p(), tcc_binary, tcc_comparison, tcc_unary, tree_could_trap_p(), vn_nary_op_s::type, and type().
Referenced by compute_avail(), and prune_clobbered_mems().
hashval_t vn_nary_op_compute_hash | ( | ) |
Compute and return the hash value for nary operation VBO1.
References commutative_tree_code(), iterative_hash_expr(), iterative_hash_hashval_t(), vn_nary_op_s::length, vn_nary_op_s::op, and tree_swap_operands_p().
Referenced by vn_nary_op_insert_into(), and vn_nary_op_lookup_1().
bool vn_nary_op_eq | ( | ) |
Compare nary operations VNO1 and VNO2 and return true if they are equivalent.
References expressions_equal_p(), vn_nary_op_s::hashcode, vn_nary_op_s::length, vn_nary_op_s::op, vn_nary_op_s::type, and types_compatible_p().
Referenced by vn_nary_op_hasher::equal(), and pre_expr_d::equal().
vn_nary_op_t vn_nary_op_insert | ( | ) |
Insert OP into the current hash table with a value number of RESULT. Return the vn_nary_op_t structure we created and put in the hashtable.
References alloc_vn_nary_op(), init_vn_nary_op_from_op(), vn_tables_s::nary, vn_reference_s::value_id, VN_INFO(), and vn_nary_op_insert_into().
Referenced by visit_reference_op_load().
|
static |
Insert VNO into TABLE. If COMPUTE_HASH is true, then compute VNO->HASHCODE first.
References hash_table< Descriptor, Allocator >::find_slot_with_hash(), vn_nary_op_s::hashcode, and vn_nary_op_compute_hash().
Referenced by copy_nary(), vn_nary_op_insert(), vn_nary_op_insert_pieces(), 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, and vn_nary_op_insert_into().
Referenced by phi_translate_1().
vn_nary_op_t vn_nary_op_insert_stmt | ( | ) |
Insert the rhs of STMT into the current hash table with a value number of RESULT.
References alloc_vn_nary_op(), init_vn_nary_op_from_stmt(), vn_tables_s::nary, vn_reference_s::value_id, VN_INFO(), vn_nary_length_from_stmt(), and vn_nary_op_insert_into().
Referenced by visit_nary_op().
tree vn_nary_op_lookup | ( | ) |
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 operation is NULL. VNRESULT will contain the vn_nary_op_t from the hashtable if it exists.
References init_vn_nary_op_from_op(), sizeof_vn_nary_op(), and vn_nary_op_lookup_1().
Referenced by get_or_alloc_expr_for(), visit_reference_op_load(), and visit_use().
|
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, Allocator >::find_slot_with_hash(), vn_nary_op_s::hashcode, vn_tables_s::nary, vn_nary_op_s::result, and vn_nary_op_compute_hash().
Referenced by vn_nary_op_lookup(), 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().
tree vn_nary_op_lookup_stmt | ( | ) |
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 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(), and visit_nary_op().
|
inlinestatic |
Compute a hashcode for PHI operation VP1 and return it.
References vn_phi_s::block, basic_block_def::index, iterative_hash_expr(), vn_phi_s::phiargs, vn_reference_s::result, vn_phi_s::type, type(), vn_hash_type(), and VN_TOP.
Referenced by vn_phi_insert(), and vn_phi_lookup().
|
static |
vn_phi hashtable helpers.
Referenced by vn_phi_hasher::equal().
|
static |
Compare two phi entries for equality, ignoring VN_TOP arguments.
References vn_phi_s::block, expressions_equal_p(), vn_phi_s::hashcode, vn_phi_s::phiargs, vn_phi_s::type, types_compatible_p(), and VN_TOP.
|
static |
Insert PHI into the current hash table with a value number of RESULT.
References vn_phi_s::block, hash_table< Descriptor, Allocator >::find_slot_with_hash(), gimple_bb(), gimple_phi_num_args(), gimple_phi_result(), vn_phi_s::hashcode, vn_phi_s::phiargs, vn_tables_s::phis, vn_tables_s::phis_pool, pool_alloc(), vn_phi_s::result, vn_phi_s::type, vn_phi_s::value_id, vn_ssa_aux::value_id, VN_INFO(), vn_phi_compute_hash(), and vNULL.
Referenced by visit_phi().
|
static |
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, hash_table< Descriptor, Allocator >::find_slot_with_hash(), gimple_bb(), gimple_phi_num_args(), gimple_phi_result(), vn_phi_s::hashcode, vn_phi_s::phiargs, vn_tables_s::phis, vn_phi_s::result, shared_lookup_phiargs, vn_phi_s::type, and vn_phi_compute_hash().
Referenced by visit_phi().
hashval_t vn_reference_compute_hash | ( | ) |
Compute a hash for the reference operation VR1 and return it.
References HOST_WIDE_INT, iterative_hash_expr(), iterative_hash_hashval_t(), vn_reference_op_struct::off, vn_reference_op_struct::op0, vn_reference_op_struct::opcode, vn_reference_s::operands, vn_reference_op_compute_hash(), and vn_reference_s::vuse.
Referenced by visit_reference_op_call(), vn_reference_insert(), vn_reference_insert_pieces(), vn_reference_lookup(), vn_reference_lookup_3(), vn_reference_lookup_or_insert_for_pieces(), and vn_reference_lookup_pieces().
bool vn_reference_eq | ( | ) |
Return true if reference operations VR1 and VR2 are equivalent. This means they have the same set of operands and vuses.
References expressions_equal_p(), vn_reference_s::hashcode, HOST_WIDE_INT, memset(), vn_reference_op_struct::off, vn_reference_op_struct::op0, vn_reference_op_struct::opcode, vn_reference_s::operands, vn_reference_op_struct::type, vn_reference_s::type, vn_reference_op_eq(), and vn_reference_s::vuse.
Referenced by pre_expr_d::equal(), and vn_reference_hasher::equal().
void vn_reference_fold_indirect | ( | vec< vn_reference_op_s > * | ops, |
unsigned int * | i_p | ||
) |
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 double_int_to_tree(), double_int::from_shwi(), get_addr_base_and_unit_offset(), host_integerp(), HOST_WIDE_INT, vn_reference_op_struct::off, vn_reference_op_struct::op0, double_int::sext(), and tree_to_double_int().
Referenced by phi_translate_1(), valueize_refs_1(), and vn_reference_maybe_forwprop_address().
vn_reference_t vn_reference_insert | ( | ) |
Insert OP into the current hash table with a value number of RESULT, and return the resulting reference structure we created.
References hash_table< Descriptor, Allocator >::find_slot_with_hash(), free_reference(), get_alias_set(), get_or_alloc_constant_value_id(), vn_reference_s::hashcode, vn_reference_s::operands, pool_alloc(), vn_tables_s::references, vn_tables_s::references_pool, vn_reference_s::result, vn_reference_s::result_vdef, vn_reference_s::set, vn_reference_s::type, vn_reference_s::value_id, vn_ssa_aux::value_id, valueize_shared_reference_ops_from_ref(), VN_INFO(), vn_reference_compute_hash(), and vn_reference_s::vuse.
Referenced by visit_reference_op_load(), and visit_reference_op_store().
vn_reference_t vn_reference_insert_pieces | ( | tree | vuse, |
alias_set_type | set, | ||
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 hash_table< Descriptor, Allocator >::find_slot_with_hash(), free_reference(), vn_reference_s::hashcode, vn_reference_s::operands, pool_alloc(), vn_tables_s::references, vn_tables_s::references_pool, vn_reference_s::result, vn_reference_s::set, vn_reference_s::type, type(), vn_reference_s::value_id, valueize_refs(), vn_reference_compute_hash(), and vn_reference_s::vuse.
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 | ||
) |
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.
References ao_ref_init(), ao_ref_init_from_vn_reference(), fully_constant_vn_reference_p(), get_alias_set(), vn_reference_s::hashcode, vn_reference_s::operands, vn_reference_s::result, vn_reference_s::set, vn_reference_s::type, valueize_shared_reference_ops_from_ref(), VN_NOWALK, vn_reference_compute_hash(), vn_reference_lookup_1(), vn_reference_lookup_2(), vn_reference_lookup_3(), vn_walk_kind, vn_reference_s::vuse, and walk_non_aliased_vuses().
Referenced by compute_avail(), eliminate_bb(), 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, Allocator >::find_slot_with_hash(), vn_reference_s::hashcode, and vn_tables_s::references.
Referenced by visit_reference_op_call(), vn_reference_lookup(), 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 hash_table< Descriptor, Allocator >::find_slot_with_hash(), vn_reference_s::hashcode, last_vuse_ptr, vn_tables_s::references, and vn_reference_s::vuse.
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.
References ao_ref_base(), ao_ref_init(), ao_ref_init_from_vn_reference(), buffer, build_int_cst(), build_zero_cst(), copy_reference_ops_from_ref(), get_addr_base_and_unit_offset(), get_alias_set(), get_ref_base_and_extent(), gimple_assign_lhs(), gimple_assign_rhs1(), gimple_assign_rhs2(), gimple_assign_rhs_code(), gimple_assign_single_p(), gimple_call_arg(), gimple_call_builtin_p(), gimple_clobber_p(), handled_component_p(), vn_reference_s::hashcode, host_integerp(), HOST_WIDE_INT, integer_zerop(), is_gimple_assign(), is_gimple_min_invariant(), is_gimple_reg_type(), last_vuse_ptr, len, ao_ref_s::max_size, memset(), native_encode_expr(), native_interpret_expr(), vn_reference_op_struct::off, ao_ref_s::offset, offset, vn_reference_op_struct::op0, vn_reference_op_struct::opcode, operand_equal_p(), vn_reference_s::operands, refs_may_alias_p_1(), vn_reference_s::set, ao_ref_s::size, vn_reference_op_struct::type, vn_reference_s::type, types_compatible_p(), constructor_elt_d::value, valueize_refs(), valueize_refs_1(), vn_reference_compute_hash(), vn_reference_lookup_or_insert_for_pieces(), vn_reference_op_eq(), vn_walk_kind, VN_WALKREWRITE, and vNULL.
Referenced by vn_reference_lookup(), and vn_reference_lookup_pieces().
|
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 get_or_alloc_constant_value_id(), vn_reference_s::hashcode, vn_reference_s::operands, vn_reference_s::result, vn_reference_s::set, vn_reference_s::type, type(), vn_reference_s::value_id, 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_reference_lookup_3().
tree vn_reference_lookup_pieces | ( | tree | vuse, |
alias_set_type | 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(), fully_constant_vn_reference_p(), vn_reference_s::hashcode, memcpy(), vn_reference_s::operands, vn_reference_s::set, vn_reference_s::type, type(), valueize_refs(), VN_NOWALK, vn_reference_compute_hash(), vn_reference_lookup_1(), vn_reference_lookup_2(), vn_reference_lookup_3(), vn_walk_kind, vn_reference_s::vuse, and walk_non_aliased_vuses().
Referenced by compute_avail(), and phi_translate_1().
|
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 double_int_to_tree(), double_int::from_shwi(), get_addr_base_and_unit_offset(), gimple_assign_rhs1(), gimple_assign_rhs2(), gimple_assign_rhs_code(), host_integerp(), HOST_WIDE_INT, is_gimple_assign(), mem_ref_offset(), vn_reference_op_struct::off, vn_reference_op_struct::op0, vn_reference_op_struct::opcode, double_int::sext(), tree_to_double_int(), and vn_reference_fold_indirect().
Referenced by valueize_refs_1().
|
static |
Compute the hash for a reference operand VRO1.
References iterative_hash_expr(), iterative_hash_hashval_t(), 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 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, and types_compatible_p().
Referenced by vn_reference_eq(), and vn_reference_lookup_3().
|
static |
|
static |
|
static |
Pointer to the set of hashtables that is currently being used. Should always point to either the optimistic_info, or the valid_info.
|
static |
Referenced by run_scc_vn(), and visit_reference_op_load().
|
static |
Referenced by visit_reference_op_load(), vn_reference_lookup_2(), and vn_reference_lookup_3().
|
static |
Next DFS number and the stack for strongly connected component detection.
Referenced by DFS(), and init_scc_vn().
|
static |
Unique counter for our value ids.
Referenced by get_max_value_id(), get_next_value_id(), and init_scc_vn().
|
static |
Optimistic hashtables storing information we are making assumptions about during iterations.
Referenced by process_scc(), and visit_reference_op_load().
|
static |
Reverse post order index for each basic block.
Referenced by compare_ops(), free_scc_vn(), and init_scc_vn().
Referenced by vn_phi_lookup().
|
static |
Referenced by valueize_shared_reference_ops_from_call(), and valueize_shared_reference_ops_from_ref().
|
static |
Valid hashtables storing information we have proven to be correct.
Referenced by process_scc(), run_scc_vn(), and visit_reference_op_load().
|
static |
Referenced by free_scc_vn(), init_scc_vn(), and VN_INFO_GET().
|
static |
Table of vn_ssa_aux_t's, one per ssa_name. The vn_ssa_aux_t objects are allocated on an obstack for locality reasons, and to free them without looping over the vec.
tree VN_TOP |
This represents the top of the VN lattice, which is the universal value.
Referenced by eliminate_bb(), init_scc_vn(), run_scc_vn(), set_ssa_val_to(), visit_phi(), vn_get_expr_for(), vn_phi_compute_hash(), vn_phi_eq(), and vn_valueize().
|
static |
Referenced by vn_reference_lookup(), vn_reference_lookup_3(), and vn_reference_lookup_pieces().