GCC Middle and Back End API Reference
|
Go to the source code of this file.
Data Structures | |
struct | ipa_constant_data |
struct | ipa_pass_through_data |
struct | ipa_load_agg_data |
struct | ipa_ancestor_jf_data |
struct | ipa_agg_jf_item |
union | ipa_agg_jf_item::jump_func_agg_value |
struct | ipa_agg_jump_function |
struct | ipa_argagg_value |
class | ipa_argagg_value_list |
class | ipa_vr |
struct | ipa_jump_func |
union | ipa_jump_func::jump_func_value |
class | ipa_auto_call_arg_values |
class | ipa_call_arg_values |
struct | ipa_param_descriptor |
class | ipa_node_params |
struct | ipa_param_aa_status |
struct | ipa_bb_info |
struct | ipa_func_body_info |
struct | ipa_uid_to_idx_map_elt |
struct | ipcp_transformation |
class | ipa_edge_args |
class | ipa_node_params_t |
class | ipa_edge_args_sum_t |
class | ipcp_transformation_t |
Macros | |
#define | IPA_UNDESCRIBED_USE -1 |
#define | IPA_PROP_ARG_INDEX_LIMIT_BITS 16 |
Enumerations | |
enum | jump_func_type { IPA_JF_UNKNOWN = 0 , IPA_JF_CONST , IPA_JF_PASS_THROUGH , IPA_JF_LOAD_AGG , IPA_JF_ANCESTOR } |
#define IPA_PROP_ARG_INDEX_LIMIT_BITS 16 |
Index identifying an actualargument or a formal parameter may have only this many bits.
Referenced by ipa_analyze_node().
#define IPA_UNDESCRIBED_USE -1 |
Interprocedural analyses. Copyright (C) 2005-2024 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GCC; see the file COPYING3. If not see <http://www.gnu.org/licenses/>.
The following definitions and interfaces are used by interprocedural analyses or parameters.
Referenced by adjust_references_in_caller(), combine_controlled_uses_counters(), ipa_analyze_controlled_uses(), ipa_duplicate_jump_function(), ipa_get_controlled_uses(), ipa_get_param_load_dereferenced(), ipa_print_node_params(), ipa_write_node_info(), ipcp_discover_new_direct_edges(), jfunc_rdesc_usable(), and propagate_controlled_uses().
enum jump_func_type |
ipa-prop.cc stuff (ipa-cp, indirect inlining):
A jump function for a callsite represents the values passed as actual arguments of the callsite. They were originally proposed in a paper called "Interprocedural Constant Propagation", by David Callahan, Keith D Cooper, Ken Kennedy, Linda Torczon in Comp86, pg 152-161. There are three main types of values : Pass-through - the caller's formal parameter is passed as an actual argument, possibly one simple operation performed on it. Constant - a constant (is_gimple_ip_invariant)is passed as an actual argument. Unknown - neither of the above. IPA_JF_LOAD_AGG is a compound pass-through jump function, in which primary operation on formal parameter is memory dereference that loads a value from a part of an aggregate, which is represented or pointed to by the formal parameter. Moreover, an additional unary/binary operation can be applied on the loaded value, and final result is passed as actual argument of callee (e.g. *(param_1(D) + 4) op 24 ). It is meant to describe usage of aggregate parameter or by-reference parameter referenced in argument passing, commonly found in C++ and Fortran. IPA_JF_ANCESTOR is a special pass-through jump function, which means that the result is an address of a part of the object pointed to by the formal parameter to which the function refers. It is mainly intended to represent getting addresses of ancestor fields in C++ (e.g. &this_1(D)->D.1766.D.1756). Note that if the original pointer is NULL, ancestor jump function must behave like a simple pass-through. Other pass-through functions can either simply pass on an unchanged formal parameter or can apply one simple binary operation to it (such jump functions are called polynomial). Jump functions are computed in ipa-prop.cc by function update_call_notes_after_inlining. Some information can be lost and jump functions degraded accordingly when inlining, see update_call_notes_after_inlining in the same file.
Enumerator | |
---|---|
IPA_JF_UNKNOWN | |
IPA_JF_CONST | |
IPA_JF_PASS_THROUGH | |
IPA_JF_LOAD_AGG | |
IPA_JF_ANCESTOR |
tree build_ref_for_offset | ( | location_t | loc, |
tree | base, | ||
poly_int64 | offset, | ||
bool | reverse, | ||
tree | exp_type, | ||
gimple_stmt_iterator * | gsi, | ||
bool | insert_after ) |
From tree-sra.cc:
Construct a MEM_REF that would reference a part of aggregate BASE of type EXP_TYPE at the given OFFSET and with storage order REVERSE. If BASE is something for which get_addr_base_and_unit_offset returns NULL, gsi must be non-NULL and is used to insert new statements either before or below the current one as specified by INSERT_AFTER. This function is not capable of handling bitfields.
References build_aligned_type(), build_fold_addr_expr, build_int_cst(), build_pointer_type(), build_qualified_type(), ENCODE_QUAL_ADDR_SPACE, fold_build2_loc(), gcc_checking_assert, get_addr_base_and_unit_offset(), get_object_alignment_1(), gimple_build_assign(), gimple_set_location(), gsi_insert_after(), gsi_insert_before(), GSI_NEW_STMT, GSI_SAME_STMT, int_const_binop(), make_ssa_name(), MIN, offset, REF_REVERSE_STORAGE_ORDER, reference_alias_ptr_type(), STRIP_USELESS_TYPE_CONVERSION, TREE_CODE, TREE_OPERAND, TREE_SIDE_EFFECTS, TREE_THIS_VOLATILE, TREE_TYPE, TYPE_ADDR_SPACE, TYPE_ALIGN, TYPE_QUALS, and unshare_expr().
Referenced by analyze_access_subtree(), and build_ref_for_model().
int count_formal_params | ( | tree | fndecl | ) |
Return how many formal parameters FNDECL has.
References count, DECL_ARGUMENTS, DECL_CHAIN, gcc_assert, and gimple_has_body_p().
Referenced by analyze_function_body(), ipa_icf::sem_function::init(), ipa_analyze_node(), ipa_initialize_node_params(), ipcp_transform_function(), and ipcp_transformation::maybe_create_parm_idx_map().
tree ipa_agg_value_from_jfunc | ( | ipa_node_params * | info, |
cgraph_node * | node, | ||
const ipa_agg_jf_item * | item ) |
Determine whether ITEM, jump function for an aggregate part, evaluates to a single known constant value and if so, return it. Otherwise return NULL. NODE and INFO describes the caller node or the one it is inlined to, and its related info.
References ipcp_param_lattices::aggs, ipcp_param_lattices::aggs_bottom, ipcp_param_lattices::aggs_by_ref, ipcp_param_lattices::aggs_contain_variable, ipa_load_agg_data::by_ref, ipa_agg_jf_item::jump_func_agg_value::constant, ipa_pass_through_data::formal_id, gcc_checking_assert, ipa_argagg_value_list::get_value(), ipa_get_jf_arith_result(), ipa_get_parm_lattices(), IPA_JF_CONST, IPA_JF_LOAD_AGG, IPA_JF_PASS_THROUGH, IPA_JF_UNKNOWN, ipcp_get_transformation_summary(), ipa_node_params::ipcp_orig_node, ipcp_lattice< valtype >::is_single_const(), ipcp_param_lattices::itself, ipa_agg_jf_item::jftype, ipa_node_params::known_csts, ipa_node_params::lattices, ipa_agg_jf_item::jump_func_agg_value::load_agg, ipcp_agg_lattice::next, NULL_TREE, ipa_agg_jf_item::offset, ipa_load_agg_data::offset, ipcp_agg_lattice::offset, ipa_pass_through_data::operand, ipa_pass_through_data::operation, ipa_agg_jf_item::jump_func_agg_value::pass_through, TREE_TYPE, ipa_agg_jf_item::type, ipa_load_agg_data::type, UINT_MAX, useless_type_conversion_p(), ipa_agg_jf_item::value, ipcp_value< valtype >::value, and ipcp_lattice< valtype >::values.
Referenced by ipa_find_agg_cst_from_jfunc_items(), ipa_push_agg_values_from_jfunc(), and push_agg_values_for_index_from_edge().
void ipa_analyze_node | ( | struct cgraph_node * | node | ) |
Functions related to both.
Initialize the array describing properties of formal parameters of NODE, analyze their uses and compute jump functions associated with actual arguments of calls from within NODE.
References ipa_func_body_info::aa_walk_budget, ipa_node_params::analysis_done, ipa_func_body_info::bb_infos, calculate_dominance_info(), cgraph_node::callees, CDI_DOMINATORS, cfun, ipa_bb_info::cg_edges, count_formal_params(), symtab_node::decl, DECL_STRUCT_FUNCTION, disable_ranger(), enable_ranger(), ENTRY_BLOCK_PTR_FOR_FN, free_dominance_info(), gcc_assert, gimple_bb(), cgraph_node::indirect_calls, ipa_func_body_info::info, ipa_analyze_controlled_uses(), ipa_check_create_edge_args(), ipa_check_create_node_params(), ipa_func_spec_opts_forbid_analysis_p(), ipa_get_bb_info(), ipa_get_param_count(), ipa_initialize_node_params(), ipa_node_params_sum, IPA_PROP_ARG_INDEX_LIMIT_BITS, ipa_release_body_info(), last_basic_block_for_fn, cgraph_edge::next_callee, ipa_func_body_info::node, opt_for_fn, ipa_func_body_info::param_count, pop_cfun(), push_cfun(), vNULL, and dom_walker::walk().
Referenced by cgraph_node::expand_all_artificial_thunks(), inline_indirect_intraprocedural_analysis(), ipa_add_new_function(), and ipcp_generate_summary().
void ipa_check_create_edge_args | ( | void | ) |
Ensure that array of edge arguments infos is big enough to accommodate a structure for all edges and reallocates it if not. Also, allocate associated hash tables is they do not already exist.
References hash_table< Descriptor, Lazy, Allocator >::create_ggc(), ggc_alloc_no_dtor(), ipa_edge_args_sum, ipa_vr_hash_table, and symtab.
Referenced by ipa_analyze_node(), ipa_prop_read_jump_functions(), ipa_register_cgraph_hooks(), ipcp_driver(), and update_indirect_edges_after_inlining().
|
inline |
This function ensures the array of node param infos is big enough to accommodate a structure for all nodes and reallocates it if not.
References ggc_alloc_no_dtor(), ipa_node_params_sum, and symtab.
Referenced by analyze_function_body(), ipa_analyze_node(), ipa_make_edge_direct_to_target(), ipa_prop_read_jump_functions(), ipa_register_cgraph_hooks(), and ipcp_driver().
ipa_polymorphic_call_context ipa_context_from_jfunc | ( | ipa_node_params * | info, |
cgraph_edge * | cs, | ||
int | csidx, | ||
ipa_jump_func * | jfunc ) |
Determine whether JFUNC evaluates to single known polymorphic context, given that INFO describes the caller node or the one it is inlined to, CS is the call graph edge corresponding to JFUNC and CSIDX index of the described parameter.
References ipa_polymorphic_call_context::combine_with(), cgraph_edge::in_polymorphic_cdtor, ipa_edge_args_sum, ipa_get_ith_polymorhic_call_context(), ipa_get_jf_ancestor_formal_id(), ipa_get_jf_ancestor_offset(), ipa_get_jf_ancestor_type_preserved(), ipa_get_jf_pass_through_formal_id(), ipa_get_jf_pass_through_operation(), ipa_get_jf_pass_through_type_preserved(), ipa_get_param_count(), ipa_get_poly_ctx_lat(), IPA_JF_ANCESTOR, IPA_JF_PASS_THROUGH, ipa_node_params::ipcp_orig_node, ipcp_lattice< valtype >::is_single_const(), ipa_node_params::known_contexts, ipa_node_params::lattices, NULL, ipa_polymorphic_call_context::offset_by(), ipa_polymorphic_call_context::possible_dynamic_type_change(), ipa_jump_func::type, ipa_polymorphic_call_context::useless_p(), and ipcp_lattice< valtype >::values.
Referenced by evaluate_properties_for_edge(), find_more_contexts_for_caller_subset(), and update_indirect_edges_after_inlining().
void ipa_cp_cc_finalize | ( | void | ) |
In ipa-cp.cc
Reset all state within ipa-cp.cc so that we can rerun the compiler within the same process. For use by toplev::finalize.
References base_count, ipcp_free_transformation_sum(), orig_overall_size, overall_size, and profile_count::uninitialized().
Referenced by toplev::finalize().
void ipa_create_all_edge_args | ( | void | ) |
void ipa_create_all_node_params | ( | void | ) |
Creating and freeing ipa_node_params and ipa_edge_args.
void ipa_dump_jump_function | ( | FILE * | f, |
ipa_jump_func * | jump_func, | ||
class ipa_polymorphic_call_context * | ctx ) |
Print contents of JFUNC to F. If CTX is non-NULL, dump it too.
References ipa_jump_func::agg, ipa_ancestor_jf_data::agg_preserved, ipa_pass_through_data::agg_preserved, ipa_jump_func::jump_func_value::ancestor, ipa_agg_jump_function::by_ref, ipa_load_agg_data::by_ref, ipa_agg_jf_item::jump_func_agg_value::constant, ipa_jump_func::jump_func_value::constant, ipa_polymorphic_call_context::dump(), ipa_vr::dump(), dump_file, FOR_EACH_VEC_ELT, ipa_ancestor_jf_data::formal_id, ipa_pass_through_data::formal_id, get_tree_code_name(), HOST_WIDE_INT_PRINT_DEC, IPA_JF_ANCESTOR, IPA_JF_CONST, IPA_JF_LOAD_AGG, IPA_JF_PASS_THROUGH, IPA_JF_UNKNOWN, ipa_print_constant_value(), ipa_agg_jump_function::items, ipa_agg_jf_item::jftype, ipa_ancestor_jf_data::keep_null, ipa_agg_jf_item::jump_func_agg_value::load_agg, ipa_jump_func::m_vr, ipa_agg_jf_item::offset, ipa_ancestor_jf_data::offset, ipa_load_agg_data::offset, ipa_pass_through_data::operand, ipa_pass_through_data::operation, ipa_agg_jf_item::jump_func_agg_value::pass_through, ipa_jump_func::jump_func_value::pass_through, print_generic_expr(), ipa_pass_through_data::refdesc_decremented, tree_to_uhwi(), ipa_agg_jf_item::type, ipa_jump_func::type, TYPE_SIZE, ipa_polymorphic_call_context::useless_p(), ipa_agg_jf_item::value, ipa_constant_data::value, and ipa_jump_func::value.
Referenced by ipa_print_node_jump_functions_for_edge().
void ipa_dump_param | ( | FILE * | file, |
class ipa_node_params * | info, | ||
int | i ) |
Return the declaration of Ith formal parameter of the function corresponding to INFO. Note there is no setter function as this array is built just once using ipa_initialize_node_params.
References ipa_node_params::descriptors, i, and print_generic_expr().
Referenced by decide_about_value(), estimate_local_effects(), find_more_contexts_for_caller_subset(), find_more_scalar_values_for_callers_subset(), get_replacement_map(), and ipa_print_node_params().
|
inline |
Returns true if edge summary contains a record for EDGE. The main purpose of this function is that debug dumping function can check info availability without causing allocations.
References ipa_edge_args_sum.
Referenced by ipa_print_node_jump_functions().
Aggregate jump function related functions.
Check whether SCALAR could be used to look up an aggregate interprocedural invariant from a static constructor and if so, return it. Otherwise return NULL.
References DECL_INITIAL, find_constructor_constant_at_offset(), is_global_var(), NULL, offset, TREE_CODE, TREE_OPERAND, TREE_READONLY, and VAR_P.
Referenced by evaluate_conditions_for_known_args(), ipa_get_indirect_edge_target_1(), try_make_edge_direct_simple_call(), and try_make_edge_direct_virtual_call().
void ipa_free_all_edge_args | ( | void | ) |
Free all ipa_edge structures.
References ggc_delete(), ipa_edge_args_sum, and NULL.
Referenced by ipa_free_all_structures_after_iinln(), and ipa_free_all_structures_after_ipa_cp().
void ipa_free_all_node_params | ( | void | ) |
Free all ipa_node_params structures.
References ggc_delete(), ipa_node_params_sum, and NULL.
Referenced by analyze_function_body(), ipa_free_all_structures_after_iinln(), and ipa_free_all_structures_after_ipa_cp().
void ipa_free_all_structures_after_iinln | ( | void | ) |
Free all ipa_node_params and all ipa_edge_args structures if they are no longer needed after indirect inlining.
References ipa_free_all_edge_args(), ipa_free_all_node_params(), ipa_refdesc_pool, ipa_unregister_cgraph_hooks(), ipcp_agg_lattice_pool, ipcp_cst_values_pool, ipcp_poly_ctx_values_pool, and ipcp_sources_pool.
void ipa_free_all_structures_after_ipa_cp | ( | void | ) |
Free all ipa_node_params and all ipa_edge_args structures if they are no longer needed after ipa-cp.
References ipa_free_all_edge_args(), ipa_free_all_node_params(), ipa_refdesc_pool, ipa_unregister_cgraph_hooks(), ipcp_agg_lattice_pool, ipcp_cst_values_pool, ipcp_poly_ctx_values_pool, and ipcp_sources_pool.
Referenced by ipcp_driver().
tree ipa_get_callee_param_type | ( | struct cgraph_edge * | e, |
int | i ) |
Return the Ith param type of callee associated with call graph edge E.
References cgraph_edge::call_stmt, cgraph_edge::callee, symtab_node::decl, DECL_ARGUMENTS, gimple_call_fntype(), i, NULL, TREE_CHAIN, TREE_TYPE, TREE_VALUE, TYPE_ARG_TYPES, and void_list_node.
Referenced by ipa_compute_jump_functions_for_edge().
|
inline |
Return how many uses described by ipa-prop a parameter has or IPA_UNDESCRIBED_USE if there is a use that is not described by these structures.
References ipa_node_params::descriptors, i, IPA_UNDESCRIBED_USE, and vec_safe_length().
Referenced by adjust_references_in_caller(), create_specialized_node(), ipa_duplicate_jump_function(), ipa_get_param_load_dereferenced(), ipa_print_node_params(), ipa_write_node_info(), ipcp_discover_new_direct_edges(), and propagate_controlled_uses().
|
inline |
ipa_edge_args access functions. Please use these to access fields that are or will be shared among various passes.
Return the number of actual arguments.
References vec_safe_length().
Referenced by cgraph_edge_brings_all_scalars_for_node(), check_argument_count(), ipa_icf_gimple::func_checker::compare_gimple_call(), evaluate_properties_for_edge(), find_more_contexts_for_caller_subset(), find_more_scalar_values_for_callers_subset(), ipa_merge_fn_summary_after_inlining(), ipa_print_node_jump_functions_for_edge(), ipa_write_node_info(), propagate_constants_across_call(), propagate_controlled_uses(), push_agg_values_from_edge(), remap_edge_params(), update_indirect_edges_after_inlining(), and update_jump_functions_after_inlining().
tree ipa_get_indirect_edge_target | ( | struct cgraph_edge * | ie, |
ipa_call_arg_values * | avals, | ||
bool * | speculative ) |
Indirect edge processing and target discovery.
If an indirect edge IE can be turned into a direct one based on data in AVALS, return the destination. Store into *SPECULATIVE a boolean determinig whether the discovered target is only speculative guess.
References ipa_get_indirect_edge_target_1(), ipa_call_arg_values::m_known_contexts, and ipa_call_arg_values::m_known_vals.
Referenced by estimate_edge_devirt_benefit().
|
inline |
Returns a pointer to the jump function for the ith argument. Please note there is no setter function as jump functions are all set up in ipa_compute_jump_functions.
References i.
Referenced by adjust_references_in_caller(), cgraph_edge_brings_all_scalars_for_node(), ipa_icf_gimple::func_checker::compare_gimple_call(), ipa_edge_args_sum_t::duplicate(), evaluate_properties_for_edge(), find_more_contexts_for_caller_subset(), find_more_scalar_values_for_callers_subset(), ipa_compute_jump_functions_for_edge(), ipa_merge_fn_summary_after_inlining(), ipa_print_node_jump_functions_for_edge(), ipa_read_edge_info(), ipa_write_node_info(), propagate_constants_across_call(), propagate_controlled_uses(), push_agg_values_for_index_from_edge(), remap_edge_params(), update_indirect_edges_after_inlining(), and update_jump_functions_after_inlining().
|
inline |
Returns a pointer to the polymorphic call context for the ith argument. NULL if contexts are not computed.
Referenced by ipa_compute_jump_functions_for_edge(), ipa_context_from_jfunc(), ipa_print_node_jump_functions_for_edge(), ipa_read_edge_info(), ipa_write_node_info(), propagate_context_across_jump_function(), and update_jump_functions_after_inlining().
|
inline |
Return the agg_preserved flag of an ancestor jump function JFUNC.
References ipa_ancestor_jf_data::agg_preserved, ipa_jump_func::jump_func_value::ancestor, gcc_checking_assert, IPA_JF_ANCESTOR, ipa_jump_func::type, and ipa_jump_func::value.
Referenced by ipa_compute_jump_functions_for_edge(), ipa_merge_fn_summary_after_inlining(), propagate_aggs_across_jump_function(), push_agg_values_for_index_from_edge(), update_indirect_edges_after_inlining(), and update_jump_functions_after_inlining().
|
inline |
Return the number of the caller's formal parameter that an ancestor jump function JFUNC refers to.
References ipa_jump_func::jump_func_value::ancestor, ipa_ancestor_jf_data::formal_id, gcc_checking_assert, IPA_JF_ANCESTOR, ipa_jump_func::type, and ipa_jump_func::value.
Referenced by ipa_context_from_jfunc(), ipa_merge_fn_summary_after_inlining(), ipa_value_from_jfunc(), propagate_aggs_across_jump_function(), propagate_bits_across_jump_function(), propagate_context_across_jump_function(), propagate_scalar_across_jump_function(), push_agg_values_for_index_from_edge(), remap_edge_params(), update_indirect_edges_after_inlining(), and update_jump_functions_after_inlining().
|
inline |
Return if jfunc represents an operation whether we first check the formal parameter for non-NULLness unless it does not matter because the offset is zero anyway.
References ipa_jump_func::jump_func_value::ancestor, gcc_checking_assert, IPA_JF_ANCESTOR, ipa_ancestor_jf_data::keep_null, ipa_jump_func::type, and ipa_jump_func::value.
Referenced by ipa_get_jf_ancestor_result(), propagate_bits_across_jump_function(), and update_jump_functions_after_inlining().
|
inline |
Return the offset of an ancestor jump function JFUNC.
References ipa_jump_func::jump_func_value::ancestor, gcc_checking_assert, IPA_JF_ANCESTOR, ipa_ancestor_jf_data::offset, ipa_jump_func::type, and ipa_jump_func::value.
Referenced by ipa_context_from_jfunc(), ipa_get_jf_ancestor_result(), ipa_merge_fn_summary_after_inlining(), propagate_aggs_across_jump_function(), propagate_bits_across_jump_function(), propagate_context_across_jump_function(), push_agg_values_for_index_from_edge(), update_indirect_edges_after_inlining(), and update_jump_functions_after_inlining().
|
inline |
Return true if ancestor jump function JFUNC presrves type information.
References ipa_ancestor_jf_data::agg_preserved, ipa_jump_func::jump_func_value::ancestor, gcc_checking_assert, IPA_JF_ANCESTOR, ipa_jump_func::type, and ipa_jump_func::value.
Referenced by ipa_context_from_jfunc(), propagate_context_across_jump_function(), update_indirect_edges_after_inlining(), and update_jump_functions_after_inlining().
|
inline |
Return the constant stored in a constant jump functin JFUNC.
References ipa_jump_func::jump_func_value::constant, gcc_checking_assert, IPA_JF_CONST, ipa_jump_func::type, ipa_constant_data::value, and ipa_jump_func::value.
Referenced by ipa_jump_functions_equivalent_p(), ipa_value_from_jfunc(), propagate_controlled_uses(), propagate_scalar_across_jump_function(), remap_edge_params(), symtab_node_for_jfunc(), and try_make_edge_direct_virtual_call().
|
inline |
|
inline |
Return the agg_preserved flag of a pass through jump function JFUNC.
References ipa_pass_through_data::agg_preserved, gcc_checking_assert, IPA_JF_PASS_THROUGH, ipa_jump_func::jump_func_value::pass_through, ipa_jump_func::type, and ipa_jump_func::value.
Referenced by agg_pass_through_permissible_p(), ipa_compute_jump_functions_for_edge(), ipa_merge_fn_summary_after_inlining(), push_agg_values_for_index_from_edge(), update_indirect_edges_after_inlining(), and update_jump_functions_after_inlining().
|
inline |
Return the number of the caller's formal parameter that a pass through jump function JFUNC refers to.
References ipa_pass_through_data::formal_id, gcc_checking_assert, IPA_JF_PASS_THROUGH, ipa_jump_func::jump_func_value::pass_through, ipa_jump_func::type, and ipa_jump_func::value.
Referenced by adjust_references_in_caller(), ipa_context_from_jfunc(), ipa_duplicate_jump_function(), ipa_merge_fn_summary_after_inlining(), ipa_value_from_jfunc(), ipa_value_range_from_jfunc(), propagate_aggs_across_jump_function(), propagate_bits_across_jump_function(), propagate_context_across_jump_function(), propagate_controlled_uses(), propagate_scalar_across_jump_function(), propagate_vr_across_jump_function(), push_agg_values_for_index_from_edge(), remap_edge_params(), self_recursive_pass_through_p(), update_indirect_edges_after_inlining(), and update_jump_functions_after_inlining().
|
inline |
Return the operand of a pass through jmp function JFUNC.
References gcc_checking_assert, IPA_JF_PASS_THROUGH, ipa_pass_through_data::operand, ipa_jump_func::jump_func_value::pass_through, ipa_jump_func::type, and ipa_jump_func::value.
Referenced by find_more_scalar_values_for_callers_subset(), ipa_get_jf_pass_through_result(), ipa_vr_intersect_with_arith_jfunc(), propagate_bits_across_jump_function(), propagate_vals_across_pass_through(), and update_jump_functions_after_inlining().
|
inline |
Return operation of a pass through jump function JFUNC.
References gcc_checking_assert, IPA_JF_PASS_THROUGH, ipa_pass_through_data::operation, ipa_jump_func::jump_func_value::pass_through, ipa_jump_func::type, and ipa_jump_func::value.
Referenced by adjust_references_in_caller(), find_more_scalar_values_for_callers_subset(), ipa_context_from_jfunc(), ipa_get_jf_pass_through_result(), ipa_merge_fn_summary_after_inlining(), ipa_vr_intersect_with_arith_jfunc(), propagate_aggs_across_jump_function(), propagate_bits_across_jump_function(), propagate_context_across_jump_function(), propagate_controlled_uses(), propagate_vals_across_pass_through(), propagate_vr_across_jump_function(), push_agg_values_for_index_from_edge(), self_recursive_pass_through_p(), update_indirect_edges_after_inlining(), and update_jump_functions_after_inlining().
|
inline |
Return the refdesc_decremented flag of a pass through jump function JFUNC.
References gcc_checking_assert, IPA_JF_PASS_THROUGH, ipa_jump_func::jump_func_value::pass_through, ipa_pass_through_data::refdesc_decremented, ipa_jump_func::type, and ipa_jump_func::value.
Referenced by adjust_references_in_caller(), propagate_controlled_uses(), and update_jump_functions_after_inlining().
|
inline |
Return true if pass through jump function JFUNC preserves type information.
References ipa_pass_through_data::agg_preserved, gcc_checking_assert, IPA_JF_PASS_THROUGH, ipa_jump_func::jump_func_value::pass_through, ipa_jump_func::type, and ipa_jump_func::value.
Referenced by ipa_context_from_jfunc(), propagate_context_across_jump_function(), update_indirect_edges_after_inlining(), and update_jump_functions_after_inlining().
|
inline |
Return the declaration of Ith formal parameter of the function corresponding to INFO. Note there is no setter function as this array is built just once using ipa_initialize_node_params. This function should not be called in WPA.
References ipa_node_params::descriptors, gcc_checking_assert, i, and ipa_get_param().
|
inline |
Return the parameter declaration in DESCRIPTORS at index I and assert it is indeed a PARM_DECL.
References ipa_node_params::descriptors, gcc_checking_assert, i, and TREE_CODE.
Referenced by ipa_analyze_controlled_uses(), and ipa_get_param().
|
inline |
ipa_node_params access functions. Please use these to access fields that are or will be shared among various passes.
Return the number of formal parameters.
References ipa_node_params::descriptors, and vec_safe_length().
Referenced by add_all_node_vals_to_toposort(), cgraph_edge_brings_all_scalars_for_node(), check_argument_count(), create_specialized_node(), decide_whether_version_node(), ipa_fn_summary_t::duplicate(), ipa_cached_call_context::duplicate_from(), ipa_call_context::equal_to(), estimate_calls_size_and_time(), estimate_local_effects(), evaluate_properties_for_edge(), find_more_contexts_for_caller_subset(), find_more_scalar_values_for_callers_subset(), gather_context_independent_values(), initialize_node_lattices(), ipa_analyze_controlled_uses(), ipa_analyze_node(), ipa_context_from_jfunc(), ipa_get_parm_lattices(), ipa_merge_fn_summary_after_inlining(), ipa_print_node_params(), ipa_read_node_info(), ipa_value_from_jfunc(), ipa_write_node_info(), ipcp_propagate_stage(), ipcp_store_vr_results(), ipcp_verify_propagated_values(), print_all_lattices(), propagate_constants_across_call(), propagate_controlled_uses(), push_agg_values_from_edge(), and want_remove_some_param_p().
int ipa_get_param_decl_index | ( | class ipa_node_params * | info, |
tree | ptree ) |
Return index of the formal whose tree is PTREE in function which corresponds to INFO.
References ipa_node_params::descriptors, and ipa_get_param_decl_index_1().
Referenced by analyze_agg_content_value(), compute_complex_ancestor_jump_func(), compute_complex_assign_jump_func(), ipa_analyze_indirect_call_uses(), ipa_analyze_virtual_call_uses(), ipa_compute_jump_functions_for_edge(), load_or_store_of_ptr_parameter(), unmodified_parm_or_parm_agg_item(), visit_ref_for_mod_analysis(), will_be_nonconstant_expr_predicate(), and will_be_nonconstant_predicate().
|
inline |
Assuming a parameter does not have IPA_UNDESCRIBED_USE controlled uses, return flag which indicates it has been dereferenced but only in a load.
References ipa_node_params::descriptors, gcc_assert, i, ipa_get_controlled_uses(), and IPA_UNDESCRIBED_USE.
Referenced by adjust_references_in_caller(), create_specialized_node(), ipa_print_node_params(), ipa_write_node_info(), ipcp_discover_new_direct_edges(), and propagate_controlled_uses().
|
inline |
Return the move cost of Ith formal parameter of the function corresponding to INFO.
References ipa_node_params::descriptors, gcc_checking_assert, and i.
Referenced by gather_context_independent_values(), and ipa_write_node_info().
|
inline |
Return the type of Ith formal parameter of the function corresponding to INFO if it is known or NULL if not.
References ipa_node_params::descriptors, gcc_checking_assert, i, NULL, TREE_CODE, TREE_TYPE, TYPE_P, and vec_safe_length().
Referenced by cgraph_edge_brings_all_scalars_for_node(), evaluate_properties_for_edge(), find_more_scalar_values_for_callers_subset(), initialize_node_lattices(), ipa_value_range_from_jfunc(), ipa_write_node_info(), ipcp_store_vr_results(), load_from_unmodified_param_or_agg(), propagate_bits_across_jump_function(), propagate_constants_across_call(), propagate_vr_across_jump_function(), and update_indirect_edges_after_inlining().
tree ipa_impossible_devirt_target | ( | struct cgraph_edge * | ie, |
tree | target ) |
Return the target to be used in cases of impossible devirtualization. IE and target (the latter can be NULL) are dumped when dumping is enabled.
References builtin_decl_unreachable(), cgraph_edge::caller, DECL_ASSEMBLER_NAME, dump_file, symtab_node::dump_name(), cgraph_node::get_create(), and IDENTIFIER_POINTER.
Referenced by ipa_get_indirect_edge_target_1(), and try_make_edge_direct_virtual_call().
void ipa_initialize_node_params | ( | struct cgraph_node * | node | ) |
Function formal parameters related computations.
Initialize the ipa_node_params structure associated with NODE by counting the function parameters, creating the descriptors and populating their param_decls.
References count_formal_params(), symtab_node::decl, ipa_node_params::descriptors, ipa_alloc_node_params(), ipa_node_params_sum, and ipa_populate_param_decls().
Referenced by analyze_function_body(), and ipa_analyze_node().
|
inline |
Return the used flag corresponding to the Ith formal parameter of the function associated with INFO.
References ipa_node_params::descriptors, gcc_checking_assert, and i.
Referenced by create_specialized_node(), decide_whether_version_node(), gather_context_independent_values(), ipa_print_node_params(), ipa_write_node_info(), ipa_icf::sem_function::param_used_p(), push_agg_values_from_edge(), and want_remove_some_param_p().
|
inline |
Return the used_by_indirect_call flag corresponding to the Ith formal parameter of the function associated with INFO.
References ipa_node_params::descriptors, gcc_checking_assert, and i.
Referenced by ipa_cached_call_context::duplicate_from(), ipa_call_context::equal_to(), estimate_calls_size_and_time(), evaluate_properties_for_edge(), and ipa_print_node_params().
|
inline |
Return the used_by_ipa_predicates flag corresponding to the Ith formal parameter of the function associated with INFO.
References ipa_node_params::descriptors, gcc_checking_assert, and i.
Referenced by ipa_cached_call_context::duplicate_from(), ipa_call_context::equal_to(), evaluate_properties_for_edge(), and ipa_print_node_params().
|
inline |
Return the used_by_polymorphic_call flag corresponding to the Ith formal parameter of the function associated with INFO.
References ipa_node_params::descriptors, gcc_checking_assert, and i.
Referenced by ipa_cached_call_context::duplicate_from(), ipa_call_context::equal_to(), estimate_calls_size_and_time(), evaluate_properties_for_edge(), and ipa_print_node_params().
bool ipa_jump_functions_equivalent_p | ( | ipa_jump_func * | jf1, |
ipa_jump_func * | jf2 ) |
Return true if the two jump functions are known to be equivalent. The function can be used before the IPA phase of IPA-CP or inlining because it cannot cope with refdesc changes these passes can carry out.
References ipa_jump_func::agg, ipa_ancestor_jf_data::agg_preserved, ipa_jump_func::jump_func_value::ancestor, ipa_agg_jump_function::by_ref, ipa_vr::equal_p(), ipa_ancestor_jf_data::formal_id, gcc_assert, gcc_unreachable, i, ipa_agg_jump_functions_equivalent_p(), ipa_agg_pass_through_jf_equivalent_p(), ipa_get_jf_constant(), IPA_JF_ANCESTOR, IPA_JF_CONST, IPA_JF_PASS_THROUGH, IPA_JF_UNKNOWN, ipa_agg_jump_function::items, jfunc_rdesc_usable(), ipa_ancestor_jf_data::keep_null, ipa_jump_func::m_vr, ipa_cst_ref_desc::next_duplicate, ipa_ancestor_jf_data::offset, ipa_jump_func::jump_func_value::pass_through, ipa_cst_ref_desc::refcount, ipa_jump_func::type, ipa_jump_func::value, values_equal_for_ipcp_p(), and vec_safe_length().
Referenced by ipa_icf_gimple::func_checker::compare_gimple_call().
bool ipa_load_from_parm_agg | ( | struct ipa_func_body_info * | fbi, |
vec< ipa_param_descriptor, va_gc > * | descriptors, | ||
gimple * | stmt, | ||
tree | op, | ||
int * | index_p, | ||
HOST_WIDE_INT * | offset_p, | ||
poly_int64 * | size_p, | ||
bool * | by_ref_p, | ||
bool * | guaranteed_unmodified ) |
Return true if we can prove that OP is a memory reference loading data from an aggregate passed as a parameter. The function works in two modes. If GUARANTEED_UNMODIFIED is NULL, it return false if it cannot prove that the value has not been modified before the load in STMT. If GUARANTEED_UNMODIFIED is not NULL, it will return true even if it cannot prove the value has not been modified, in that case it will store false to *GUARANTEED_UNMODIFIED, otherwise it will store true there. INFO and PARMS_AINFO describe parameters of the current function (but the latter can be NULL), STMT is the load statement. If function returns true, *INDEX_P, *OFFSET_P and *BY_REF is filled with the parameter index, offset within the aggregate and whether it is a load from a value passed by reference respectively. Return false if the offset divided by BITS_PER_UNIT would not fit into an unsigned int.
References DECL_P, get_ref_base_and_extent_hwi(), integer_zerop(), ipa_get_param_decl_index_1(), load_from_unmodified_param(), parm_preserved_before_stmt_p(), parm_ref_data_preserved_p(), SSA_NAME_DEF_STMT, SSA_NAME_IS_DEFAULT_DEF, SSA_NAME_VAR, TREE_CODE, TREE_OPERAND, TREE_THIS_VOLATILE, and UINT_MAX.
Referenced by ipcp_modif_dom_walker::before_dom_children(), ipa_analyze_indirect_call_uses(), load_from_unmodified_param_or_agg(), and unmodified_parm_or_parm_agg_item().
struct cgraph_edge * ipa_make_edge_direct_to_target | ( | struct cgraph_edge * | ie, |
tree | target, | ||
bool | speculative ) |
If TARGET is an addr_expr of a function declaration, make it the (SPECULATIVE)destination of an indirect edge IE and return the edge. Otherwise, return NULL.
References profile_count::apply_scale(), builtin_decl_unreachable(), eni_weights::call_cost, cgraph_edge::call_stmt, ipa_call_summary::call_stmt_size, ipa_call_summary::call_stmt_time, cgraph_edge::callee, cgraph_edge::caller, symtab_node::can_be_discarded_p(), canonicalize_constructor_val(), cgraph_edge::count, dbg_cnt(), dump_enabled_p(), dump_file, symtab_node::dump_name(), dump_printf_loc(), dyn_cast(), eni_size_weights, eni_time_weights, gcc_assert, cgraph_node::get(), cgraph_node::get_create(), eni_weights::indirect_call_cost, cgraph_edge::indirect_info, cgraph_node::inlined_to, ipa_call_summaries, ipa_check_create_node_params(), is_gimple_ip_invariant(), cgraph_edge::lto_stmt_uid, cgraph_edge::make_direct(), cgraph_edge::make_speculative(), cgraph_indirect_call_info::member_ptr, MSG_OPTIMIZED_LOCATIONS, symtab_node::noninterposable_alias(), NULL, cgraph_indirect_call_info::polymorphic, print_gimple_stmt(), cgraph_edge::speculative, cgraph_edge::speculative_call_for_target(), TDF_SLIM, TREE_CODE, TREE_OPERAND, and TREE_PUBLIC.
Referenced by ipcp_discover_new_direct_edges(), try_make_edge_direct_simple_call(), and try_make_edge_direct_virtual_call().
void ipa_print_all_jump_functions | ( | FILE * | f | ) |
Print ipa_jump_func data structures of all nodes in the call graph to F.
References FOR_EACH_FUNCTION, and ipa_print_node_jump_functions().
Referenced by ipcp_driver().
void ipa_print_all_params | ( | FILE * | f | ) |
Print ipa_tree_map data structures of all functions in the callgraph to F.
References FOR_EACH_FUNCTION, and ipa_print_node_params().
Referenced by ipcp_driver().
void ipa_print_constant_value | ( | FILE * | f, |
tree | val ) |
Print VAL which is extracted from a jump function to F.
References DECL_IN_CONSTANT_POOL, DECL_INITIAL, print_generic_expr(), TREE_CODE, and TREE_OPERAND.
Referenced by ipa_dump_jump_function(), and print_ipcp_constant_value().
void ipa_print_node_jump_functions | ( | FILE * | f, |
struct cgraph_node * | node ) |
Print the jump functions of all arguments on all call graph edges going from NODE to file F.
References cgraph_indirect_call_info::agg_contents, cgraph_indirect_call_info::by_ref, cgraph_edge::call_stmt, cgraph_edge::callee, cgraph_node::callees, cgraph_indirect_call_info::context, ipa_polymorphic_call_context::dump(), symtab_node::dump_name(), HOST_WIDE_INT_PRINT_DEC, cgraph_node::indirect_calls, cgraph_edge::indirect_info, ipa_edge_args_info_available_for_edge_p(), ipa_print_node_jump_functions_for_edge(), cgraph_indirect_call_info::member_ptr, cgraph_edge::next_callee, cgraph_indirect_call_info::offset, cgraph_indirect_call_info::param_index, cgraph_indirect_call_info::polymorphic, print_gimple_stmt(), and TDF_SLIM.
Referenced by inline_indirect_intraprocedural_analysis(), and ipa_print_all_jump_functions().
void ipa_print_node_params | ( | FILE * | f, |
struct cgraph_node * | node ) |
Debugging interface.
Print ipa_tree_map data structures of all functions in the callgraph to F.
References count, symtab_node::definition, symtab_node::dump_name(), i, ipa_dump_param(), ipa_get_controlled_uses(), ipa_get_param_count(), ipa_get_param_load_dereferenced(), ipa_is_param_used(), ipa_is_param_used_by_indirect_call(), ipa_is_param_used_by_ipa_predicates(), ipa_is_param_used_by_polymorphic_call(), ipa_node_params_sum, and IPA_UNDESCRIBED_USE.
Referenced by inline_indirect_intraprocedural_analysis(), and ipa_print_all_params().
void ipa_prop_cc_finalize | ( | void | ) |
Reset all state within ipa-prop.cc so that we can rerun the compiler within the same process. For use by toplev::finalize.
References function_insertion_hook_holder, ggc_delete(), ipa_edge_args_sum, ipa_node_params_sum, NULL, symbol_table::remove_cgraph_insertion_hook(), and symtab.
Referenced by toplev::finalize().
void ipa_prop_read_jump_functions | ( | void | ) |
Read ipcp jump functions.
References ipa_check_create_edge_args(), ipa_check_create_node_params(), ipa_prop_read_section(), ipa_register_cgraph_hooks(), lto_get_file_decl_data(), lto_get_summary_section_data(), and LTO_section_jump_functions.
Referenced by ipa_fn_summary_read().
void ipa_prop_write_jump_functions | ( | void | ) |
Write jump functions for nodes in SET.
References count, create_output_block(), output_block::decl_state, destroy_output_block(), cgraph_node::has_gimple_body_p(), ipa_edge_args_sum, ipa_node_params_sum, ipa_write_node_info(), lsei_cgraph_node(), lsei_end_p(), lsei_next_function_in_partition(), lsei_start_function_in_partition(), LTO_section_jump_functions, output_block::main_stream, NULL, produce_asm(), streamer_write_char_stream(), streamer_write_uhwi(), output_block::symbol, and lto_out_decl_state::symtab_node_encoder.
Referenced by ipa_fn_summary_write().
bool ipa_propagate_indirect_call_infos | ( | struct cgraph_edge * | cs, |
vec< cgraph_edge * > * | new_edges ) |
Update jump functions and call note functions on inlining the call site CS. CS is expected to lead to a node already cloned by cgraph_clone_inline_nodes. Newly discovered indirect edges will be added to *NEW_EDGES, unless NEW_EDGES is NULL. Return true iff a new edge(s) were + created.
References cgraph_edge::callee, changed, ipa_cst_ref_desc::cs, FOR_EACH_VEC_ELT, gcc_assert, i, ipa_edge_args_sum, ipa_get_jf_constant_rdesc(), IPA_JF_CONST, ipa_node_params_sum, ipcp_transformation_sum, propagate_controlled_uses(), propagate_info_to_inlined_callees(), ipa_edge_args_sum_t::remove(), and ipa_jump_func::type.
Referenced by inline_call().
void ipa_push_agg_values_from_jfunc | ( | ipa_node_params * | info, |
cgraph_node * | node, | ||
ipa_agg_jump_function * | agg_jfunc, | ||
unsigned | dst_index, | ||
vec< ipa_argagg_value > * | res ) |
Process all items in AGG_JFUNC relative to caller (or the node the original caller is inlined to) NODE which described by INFO and push the results to RES as describing values passed in parameter DST_INDEX.
References ipa_agg_jump_function::by_ref, ipa_argagg_value::by_ref, gcc_assert, ipa_argagg_value::index, ipa_agg_value_from_jfunc(), ipa_agg_jump_function::items, ipa_argagg_value::killed, ipa_agg_jf_item::offset, ipa_argagg_value::unit_offset, and ipa_argagg_value::value.
Referenced by evaluate_properties_for_edge().
Set R to the range of [VAL, VAL] while normalizing addresses to non-zero.
References r, TREE_CODE, and TREE_TYPE.
Referenced by evaluate_conditions_for_known_args(), and ipa_vr_intersect_with_arith_jfunc().
void ipa_record_return_value_range | ( | value_range | val | ) |
Record that current function return value range is VAL.
References hash_table< Descriptor, Lazy, Allocator >::create_ggc(), current_function_decl, value_range::dump(), dump_file, dump_flags, cgraph_node::get(), ggc_alloc_no_dtor(), ipa_get_value_range(), ipa_return_value_sum, ipa_vr_hash_table, symtab, and TDF_DETAILS.
Referenced by execute_ranger_vrp().
void ipa_register_cgraph_hooks | ( | void | ) |
Register our cgraph hooks if they are not already there.
References symbol_table::add_cgraph_insertion_hook(), function_insertion_hook_holder, ipa_add_new_function(), ipa_check_create_edge_args(), ipa_check_create_node_params(), NULL, and symtab.
Referenced by ipa_fn_summary_generate(), ipa_fn_summary_read(), ipa_prop_read_jump_functions(), and ipcp_generate_summary().
void ipa_release_body_info | ( | struct ipa_func_body_info * | fbi | ) |
Release body info FBI.
References ipa_func_body_info::bb_infos, FOR_EACH_VEC_ELT, free_ipa_bb_info(), and i.
Referenced by analyze_function_body(), and ipa_analyze_node().
bool ipa_return_value_range | ( | value_range & | range, |
tree | decl ) |
Return true if value range of DECL is known and if so initialize RANGE.
References AVAIL_AVAILABLE, symtab_node::decl, cgraph_node::get(), ipa_vr::get_vrange(), ipa_return_value_sum, TREE_TYPE, cgraph_node::ultimate_alias_target(), useless_type_conversion_p(), and ipa_return_value_summary::vr.
Referenced by fold_using_range::range_of_call().
|
inline |
Set the controlled counter of a given parameter.
References ipa_node_params::descriptors, gcc_checking_assert, and i.
Referenced by adjust_references_in_caller(), ipa_analyze_controlled_uses(), ipa_duplicate_jump_function(), ipa_read_node_info(), ipcp_discover_new_direct_edges(), and propagate_controlled_uses().
|
inline |
Set the refdesc_decremented flag of a pass through jump function JFUNC to VALUE.
References gcc_checking_assert, IPA_JF_PASS_THROUGH, ipa_jump_func::jump_func_value::pass_through, ipa_pass_through_data::refdesc_decremented, ipa_jump_func::type, and ipa_jump_func::value.
Referenced by adjust_references_in_caller().
void ipa_set_node_agg_value_chain | ( | struct cgraph_node * | node, |
vec< ipa_argagg_value, va_gc > * | aggs ) |
Set the aggregate replacements of NODE to be AGGVALS.
References ipcp_transformation_initialize(), ipcp_transformation_sum, and ipcp_transformation::m_agg_values.
Referenced by create_specialized_node().
|
inline |
Set the load_dereferenced flag of a given parameter.
References ipa_node_params::descriptors, gcc_checking_assert, and i.
Referenced by ipa_analyze_controlled_uses(), ipa_read_node_info(), and propagate_controlled_uses().
|
inline |
Set the used flag corresponding to the Ith formal parameter of the function associated with INFO to VAL.
References ipa_node_params::descriptors, gcc_checking_assert, and i.
Referenced by ipa_analyze_controlled_uses(), ipa_read_node_info(), and visit_ref_for_mod_analysis().
|
inline |
Set the used_by_indirect_call flag corresponding to the Ith formal parameter of the function associated with INFO to VAL.
References ipa_node_params::descriptors, gcc_checking_assert, and i.
Referenced by ipa_note_param_call(), ipa_read_indirect_edge_info(), and update_indirect_edges_after_inlining().
|
inline |
Set the used_by_ipa_predicates flag corresponding to the Ith formal parameter of the function associated with INFO to VAL.
References ipa_node_params::descriptors, gcc_checking_assert, and i.
Referenced by add_condition(), and inline_read_section().
|
inline |
Set the .used_by_polymorphic_call flag corresponding to the Ith formal parameter of the function associated with INFO to VAL.
References ipa_node_params::descriptors, gcc_checking_assert, and i.
Referenced by ipa_note_param_call(), ipa_read_indirect_edge_info(), and update_indirect_edges_after_inlining().
tree ipa_value_from_jfunc | ( | class ipa_node_params * | info, |
struct ipa_jump_func * | jfunc, | ||
tree | parm_type ) |
Determine whether JFUNC evaluates to a single known constant value and if so, return it. Otherwise return NULL. INFO describes the caller node or the one it is inlined to, so that pass-through jump functions can be evaluated. PARM_TYPE is the type of the parameter to which the result is passed.
References ipa_get_jf_ancestor_formal_id(), ipa_get_jf_ancestor_result(), ipa_get_jf_constant(), ipa_get_jf_pass_through_formal_id(), ipa_get_jf_pass_through_result(), ipa_get_param_count(), ipa_get_scalar_lat(), IPA_JF_ANCESTOR, IPA_JF_CONST, IPA_JF_PASS_THROUGH, ipa_node_params::ipcp_orig_node, ipcp_lattice< valtype >::is_single_const(), ipa_node_params::known_csts, ipa_node_params::lattices, NULL_TREE, ipa_jump_func::type, and ipcp_lattice< valtype >::values.
Referenced by cgraph_edge_brings_all_scalars_for_node(), evaluate_properties_for_edge(), find_more_scalar_values_for_callers_subset(), and try_make_edge_direct_simple_call().
void ipa_value_range_from_jfunc | ( | vrange & | vr, |
ipa_node_params * | info, | ||
cgraph_edge * | cs, | ||
ipa_jump_func * | jfunc, | ||
tree | parm_type ) |
Determine range of JFUNC given that INFO describes the caller node or the one it is inlined to, CS is the call graph edge corresponding to JFUNC and PARM_TYPE of the parameter.
References cgraph_edge::caller, cgraph_node::inlined_to, ipa_get_jf_pass_through_formal_id(), ipa_get_type(), IPA_JF_PASS_THROUGH, ipa_vr_intersect_with_arith_jfunc(), ipa_vr_operation_and_type_effects(), ipcp_get_transformation_summary(), ipa_vr::known_p(), ipa_jump_func::m_vr, ipcp_transformation::m_vr, vrange::set_varying(), vrange::singleton_p(), ipa_jump_func::type, and ipa_vr::type().
Referenced by evaluate_properties_for_edge().
|
inline |
Make JFUNC not participate in any further reference counting.
References ipa_jump_func::jump_func_value::constant, gcc_checking_assert, IPA_JF_CONST, NULL, ipa_constant_data::rdesc, ipa_jump_func::type, and ipa_jump_func::value.
Referenced by adjust_references_in_caller(), and update_jump_functions_after_inlining().
void ipcp_free_transformation_sum | ( | void | ) |
Release the IPA CP transformation summary.
References ggc_free(), ipcp_transformation_sum, and NULL.
Referenced by ipa_cp_cc_finalize().
tree ipcp_get_aggregate_const | ( | struct function * | func, |
tree | parm, | ||
bool | by_ref, | ||
HOST_WIDE_INT | bit_offset, | ||
HOST_WIDE_INT | bit_size ) |
If IPA-CP discovered a constant in parameter PARM at OFFSET of a given SIZE - whether passed by reference or not is given by BY_REF - return that constant. Otherwise return NULL_TREE. The is supposed to be used only after clone materialization and transformation is done (because it asserts that killed constants have been pruned).
References ipa_argagg_value::by_ref, function::decl, gcc_assert, cgraph_node::get(), ipa_argagg_value_list::get_elt(), ipcp_transformation::get_param_index(), ipcp_get_transformation_summary(), ipa_argagg_value::killed, ipcp_transformation::m_agg_values, ipa_func_body_info::node, NULL_TREE, tree_to_poly_int64(), TREE_TYPE, TYPE_SIZE, and ipa_argagg_value::value.
Referenced by vn_reference_lookup_2().
bool ipcp_get_parm_bits | ( | tree | parm, |
tree * | value, | ||
widest_int * | mask ) |
Return true if we have recorded VALUE and MASK about PARM. Set VALUE and MASk accordingly.
References current_function_decl, cgraph_node::get(), clone_info::get(), value_range::get_bitmask(), ipa_param_adjustments::get_original_index(), ipcp_transformation::get_param_index(), i, ipa_vr_supported_type_p(), ipcp_get_transformation_summary(), ipcp_transformation::m_vr, irange_bitmask::mask(), clone_info::param_adjustments, TREE_TYPE, TYPE_SIGN, value_range::undefined_p(), irange_bitmask::value(), value_range::varying_p(), vec_safe_length(), and wide_int_to_tree().
Referenced by get_default_value().
|
inline |
References ipcp_transformation_sum, and NULL.
Referenced by cgraph_edge_brings_all_agg_vals_for_node(), cgraph_edge_brings_value_p(), ipa_param_body_adjustments::common_initialization(), ipa_agg_value_from_jfunc(), ipa_value_range_from_jfunc(), ipcp_get_aggregate_const(), ipcp_get_parm_bits(), ipcp_transform_function(), ipcp_write_transformation_summaries(), and push_agg_values_for_index_from_edge().
void ipcp_read_transformation_summaries | ( | void | ) |
Read IPA-CP aggregate replacements.
References lto_get_file_decl_data(), lto_get_summary_section_data(), LTO_section_ipcp_transform, and read_replacements_section().
unsigned int ipcp_transform_function | ( | struct cgraph_node * | node | ) |
IPCP transformation phase doing propagation of aggregate values.
References ipa_func_body_info::aa_walk_budget, adjust_agg_replacement_values(), ipa_func_body_info::bb_infos, calculate_dominance_info(), CDI_DOMINATORS, cfg_changed, cfun, ipcp_modif_dom_walker::cleanup_eh(), count_formal_params(), current_function_decl, symtab_node::decl, delete_unreachable_blocks_update_callgraph(), ipa_argagg_value_list::dump(), dump_file, symtab_node::dump_name(), ENTRY_BLOCK_PTR_FOR_FN, FOR_EACH_VEC_ELT, free_dominance_info(), free_ipa_bb_info(), gcc_checking_assert, i, ipa_func_body_info::info, ipa_populate_param_decls(), ipcp_get_transformation_summary(), ipcp_update_vr(), ipa_argagg_value::killed, last_basic_block_for_fn, ipcp_transformation::m_agg_values, ipcp_transformation::m_vr, ipcp_transformation::maybe_create_parm_idx_map(), ipa_func_body_info::node, NULL, opt_for_fn, ipa_func_body_info::param_count, ipcp_transformation::remove_argaggs_if(), TODO_update_ssa_only_virtuals, vec_free(), vec_safe_grow_cleared(), vec_safe_is_empty(), vNULL, and dom_walker::walk().
void ipcp_transformation_initialize | ( | void | ) |
Initialize IPA CP transformation summary and also allocate any necessary hash tables if they do not already exist.
References hash_table< Descriptor, Lazy, Allocator >::create_ggc(), ipcp_transformation_t::create_ggc(), ipa_vr_hash_table, ipcp_transformation_sum, NULL, and symtab.
Referenced by ipa_set_node_agg_value_chain(), ipcp_store_vr_results(), and read_ipcp_transformation_info().
void ipcp_verify_propagated_values | ( | void | ) |
If checking is enabled, verify that no lattice is in the TOP state, i.e. not bottom, not containing a variable component and without any known value at the same time.
References ipcp_lattice< valtype >::bottom, ipcp_lattice< valtype >::contains_variable, count, symtab_node::decl, symbol_table::dump(), dump_file, FOR_EACH_FUNCTION_WITH_GIMPLE_BODY, gcc_unreachable, i, ipa_get_param_count(), ipa_get_scalar_lat(), ipa_node_params_sum, opt_for_fn, print_all_lattices(), symtab, and ipcp_lattice< valtype >::values_count.
Referenced by ipcp_propagate_stage().
void ipcp_write_transformation_summaries | ( | void | ) |
Write all aggregate replacement for nodes in set.
References count, create_output_block(), output_block::decl_state, destroy_output_block(), dyn_cast(), i, ipcp_get_transformation_summary(), LTO_section_ipcp_transform, lto_symtab_encoder_deref(), lto_symtab_encoder_encode_body_p(), lto_symtab_encoder_size(), output_block::main_stream, NULL, produce_asm(), streamer_write_char_stream(), streamer_write_uhwi(), output_block::symbol, lto_out_decl_state::symtab_node_encoder, useful_ipcp_transformation_info_p(), and write_ipcp_transformation_info().
bool unadjusted_ptr_and_unit_offset | ( | tree | op, |
tree * | ret, | ||
poly_int64 * | offset_ret ) |
Walk pointer adjustemnts from OP (such as POINTER_PLUS and ADDR_EXPR) to find original pointer. Initialize RET to the pointer which results from the walk. If offset is known return true and initialize OFFSET_RET.
References get_addr_base_and_unit_offset(), get_base_address(), gimple_assign_rhs1(), gimple_assign_rhs2(), gimple_assign_rhs_code(), gimple_assign_single_p(), i, is_gimple_assign(), mem_ref_offset(), offset, ptrdiff_tree_p(), SSA_NAME_DEF_STMT, SSA_NAME_IS_DEFAULT_DEF, TREE_CODE, and TREE_OPERAND.
|
extern |
Call summary to store information about edges such as jump functions.
Edge summary for IPA-CP edge information.
Referenced by adjust_references_in_caller(), analyze_function_body(), cgraph_edge_brings_all_scalars_for_node(), check_argument_count(), ipa_icf_gimple::func_checker::compare_gimple_call(), evaluate_properties_for_edge(), find_more_contexts_for_caller_subset(), find_more_scalar_values_for_callers_subset(), ipa_check_create_edge_args(), ipa_compute_jump_functions_for_edge(), ipa_context_from_jfunc(), ipa_edge_args_info_available_for_edge_p(), ipa_free_all_edge_args(), ipa_merge_fn_summary_after_inlining(), ipa_print_node_jump_functions_for_edge(), ipa_prop_cc_finalize(), ipa_prop_write_jump_functions(), ipa_propagate_indirect_call_infos(), ipa_read_edge_info(), ipa_write_node_info(), propagate_constants_across_call(), propagate_context_across_jump_function(), propagate_controlled_uses(), push_agg_values_for_index_from_edge(), push_agg_values_from_edge(), remap_edge_params(), update_indirect_edges_after_inlining(), and update_jump_functions_after_inlining().
|
extern |
Function summary where the parameter infos are actually stored.
Interprocedural analyses. Copyright (C) 2005-2024 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GCC; see the file COPYING3. If not see <http://www.gnu.org/licenses/>.
Function summary where the parameter infos are actually stored.
Referenced by add_all_node_vals_to_toposort(), adjust_references_in_caller(), analyze_function_body(), calls_same_node_or_its_all_contexts_clone_p(), cgraph_edge_brings_all_agg_vals_for_node(), cgraph_edge_brings_all_scalars_for_node(), cgraph_edge_brings_value_p(), cgraph_edge_brings_value_p(), check_argument_count(), create_specialized_node(), decide_about_value(), decide_whether_version_node(), ipa_fn_summary_t::duplicate(), ipa_cached_call_context::duplicate_from(), early_inliner(), ipa_call_context::equal_to(), estimate_calls_size_and_time(), estimate_local_effects(), evaluate_properties_for_edge(), find_aggregate_values_for_callers_subset(), find_more_contexts_for_caller_subset(), find_more_scalar_values_for_callers_subset(), gather_caller_stats(), get_info_about_necessary_edges(), good_cloning_opportunity_p(), has_undead_caller_from_outside_scc_p(), identify_dead_nodes(), initialize_node_lattices(), inline_read_section(), ipa_alloc_node_params(), ipa_analyze_controlled_uses(), ipa_analyze_node(), ipa_check_create_node_params(), ipa_compute_jump_functions_for_edge(), ipa_duplicate_jump_function(), ipa_free_all_node_params(), ipa_initialize_node_params(), ipa_merge_fn_summary_after_inlining(), ipa_note_param_call(), ipa_print_node_params(), ipa_prop_cc_finalize(), ipa_prop_write_jump_functions(), ipa_propagate_indirect_call_infos(), ipa_read_node_info(), ipa_write_node_info(), ipcp_discover_new_direct_edges(), ipcp_propagate_stage(), ipcp_store_vr_results(), ipcp_verify_propagated_values(), ipcp_versionable_function_p(), ipa_icf::sem_function::param_used_p(), pop_node_from_stack(), print_all_lattices(), propagate_aggregate_lattice(), propagate_aggs_across_jump_function(), propagate_bits_across_jump_function(), propagate_constants_across_call(), propagate_constants_topo(), propagate_context_across_jump_function(), propagate_controlled_uses(), propagate_scalar_across_jump_function(), propagate_vr_across_jump_function(), push_agg_values_for_index_from_edge(), push_node_to_stack(), remap_edge_params(), self_recursive_agg_pass_through_p(), self_recursive_pass_through_p(), set_single_call_flag(), spread_undeadness(), update_indirect_edges_after_inlining(), and want_remove_some_param_p().
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
Function summary where the IPA CP transformations are actually stored.
Referenced by ipa_propagate_indirect_call_infos(), ipa_set_node_agg_value_chain(), ipcp_free_transformation_sum(), ipcp_get_transformation_summary(), ipcp_store_vr_results(), ipcp_transformation_initialize(), and read_ipcp_transformation_info().