GCC Middle and Back End API Reference
|
Data Structures | |
struct | param_analysis_info |
struct | ipa_cst_ref_desc |
struct | type_change_info |
struct | ipa_known_agg_contents_list |
Variables | |
vec< ipa_node_params_t > | ipa_node_params_vector |
vec < ipa_agg_replacement_value_p, va_gc > * | ipa_node_agg_replacements |
vec< ipa_edge_args_t, va_gc > * | ipa_edge_args_vector |
static struct cgraph_edge_hook_list * | edge_removal_hook_holder |
static struct cgraph_node_hook_list * | node_removal_hook_holder |
static struct cgraph_2edge_hook_list * | edge_duplication_hook_holder |
static struct cgraph_2node_hook_list * | node_duplication_hook_holder |
static struct cgraph_node_hook_list * | function_insertion_hook_holder |
static alloc_pool | ipa_refdesc_pool |
|
static |
Adjust the aggregate replacements in AGGVAL to reflect parameters skipped in NODE.
References bitmap_bit_p(), cgraph_node::clone, cgraph_clone_info::combined_args_to_skip, ipa_agg_replacement_value::index, and ipa_agg_replacement_value::next.
Referenced by ipcp_transform_function().
|
static |
Callback of walk_aliased_vdefs and a helper function for detect_type_change to check whether a particular statement may modify the virtual table pointer, and if possible also determine the new type of the (sub-)object. It stores its result into DATA, which points to a type_change_info structure.
References extr_type_from_vtbl_ptr_store(), type_change_info::known_current_type, type_change_info::multiple_types_encountered, stmt_may_be_vtbl_ptr_store(), type(), and type_change_info::type_maybe_changed.
Referenced by detect_type_change_1().
|
static |
Combine two controlled uses counts as done during inlining.
Referenced by propagate_controlled_uses().
|
static |
Update the jump function DST when the call graph edge corresponding to SRC is is being inlined, knowing that DST is of type ancestor and src of known type.
References HOST_WIDE_INT, ipa_get_jf_ancestor_offset(), ipa_get_jf_ancestor_type(), ipa_get_jf_known_type_base_type(), ipa_get_jf_known_type_offset(), and ipa_set_jf_known_type().
Referenced by update_jump_functions_after_inlining().
|
static |
Given that an actual argument is an SSA_NAME that is a result of a phi statement PHI, try to find out whether NAME is in fact a multiple-inheritance typecast from a descendant into an ancestor of a formal parameter and thus can be described by an ancestor jump function and if so, write the appropriate function into JFUNC. Essentially we want to match the following pattern: if (obj_2(D) != 0B) goto <bb 3>; else goto <bb 4>; <bb 3>: iftmp.1_3 = &obj_2(D)->D.1762; <bb 4>: # iftmp.1_1 = PHI <iftmp.1_3(3), 0B(2)> D.1879_6 = middleman_1 (iftmp.1_1, i_5(D)); return D.1879_6;
References detect_type_change(), get_ancestor_addr_info(), gimple_bb(), gimple_cond_code(), gimple_cond_lhs(), gimple_cond_rhs(), gimple_phi_num_args(), HOST_WIDE_INT, integer_zerop(), ipa_get_param_decl_index(), ipa_set_ancestor_jf(), last_stmt(), offset, parm_ref_data_pass_through_p(), single_pred(), and single_pred_p().
Referenced by ipa_compute_jump_functions_for_edge().
|
static |
Given that an actual argument is an SSA_NAME (given in NAME) and is a result of an assignment statement STMT, try to determine whether we are actually handling any of the following cases and construct an appropriate jump function into JFUNC if so: 1) The passed value is loaded from a formal parameter which is not a gimple register (most probably because it is addressable, the value has to be scalar) and we can guarantee the value has not changed. This case can therefore be described by a simple pass-through jump function. For example: foo (int a) { int a.0; a.0_2 = a; bar (a.0_2); 2) The passed value can be described by a simple arithmetic pass-through jump function. E.g. foo (int a) { int D.2064; D.2064_4 = a.1(D) + 4; bar (D.2064_4); This case can also occur in combination of the previous one, e.g.: foo (int a, int z) { int a.0; int D.2064; a.0_3 = a; D.2064_4 = a.0_3 + 4; foo (D.2064_4); 3) The passed value is an address of an object within another one (which also passed by reference). Such situations are described by an ancestor jump function and describe situations such as: B::foo() (struct B * const this) { struct A * D.1845; D.1845_2 = &this_1(D)->D.1748; A::bar (D.1845_2); INFO is the structure describing individual parameters access different stages of IPA optimizations. PARMS_AINFO contains the information that is only needed for intraprocedural analysis.
References ipa_node_params::descriptors, detect_type_change(), detect_type_change_ssa(), get_ref_base_and_extent(), gimple_assign_lhs(), gimple_assign_rhs1(), gimple_assign_rhs2(), gimple_assign_rhs_code(), gimple_assign_single_p(), gimple_expr_code(), HOST_WIDE_INT, ipa_get_param_decl_index(), ipa_set_ancestor_jf(), ipa_set_jf_arith_pass_through(), ipa_set_jf_simple_pass_through(), is_gimple_ip_invariant(), load_from_unmodified_param(), double_int::low, mem_ref_offset(), offset, parm_ref_data_pass_through_p(), tcc_comparison, and useless_type_conversion_p().
Referenced by ipa_compute_jump_functions_for_edge().
|
static |
Given OP which is passed as an actual argument to a called function, determine if it is possible to construct a KNOWN_TYPE jump function for it and if so, create one and store it to JFUNC.
References detect_type_change(), get_ref_base_and_extent(), HOST_WIDE_INT, ipa_set_jf_known_type(), is_global_var(), and offset.
Referenced by ipa_compute_jump_functions_for_edge(), and ipa_intraprocedural_devirtualization().
|
inlinestatic |
Return how many formal parameters FNDECL has.
References count, and gimple_has_body_p().
Referenced by ipa_get_vector_of_formal_parms(), ipa_initialize_node_params(), and ipcp_transform_function().
|
static |
Detect whether the dynamic type of ARG has changed (before callsite CALL) by looking for assignments to its virtual table pointer. If it is, return true and fill in the jump function JFUNC with relevant type information or set it to unknown. ARG is the object itself (not a pointer to it, unless dereferenced). BASE is the base of the memory access as returned by get_ref_base_and_extent, as is the offset.
References detect_type_change_1().
Referenced by compute_complex_ancestor_jump_func(), compute_complex_assign_jump_func(), compute_known_type_jump_func(), and ipa_analyze_virtual_call_uses().
|
static |
Like detect_type_change but with extra argument COMP_TYPE which will become the component type part of new JFUNC of dynamic type change is detected and the new base type is identified.
References ao_ref_init(), check_stmt_for_type_change(), get_base_address(), gimple_vuse(), handled_component_p(), IPA_JF_UNKNOWN, ipa_set_jf_known_type(), type_change_info::known_current_type, type_change_info::multiple_types_encountered, type_change_info::object, type_change_info::offset, offset, ipa_jump_func::type, type_change_info::type_maybe_changed, and walk_aliased_vdefs().
Referenced by detect_type_change(), and detect_type_change_ssa().
|
static |
Like detect_type_change but ARG is supposed to be a non-dereferenced pointer SSA name (its dereference will become the base and the offset is assumed to be zero).
References build_int_cst(), and detect_type_change_1().
Referenced by compute_complex_assign_jump_func(), ipa_analyze_virtual_call_uses(), and ipa_compute_jump_functions_for_edge().
|
static |
Traverse statements from CALL backwards, scanning whether an aggregate given in ARG is filled in with constant values. ARG can either be an aggregate expression or a pointer to an aggregate. JFUNC is the jump function into which the constants are subsequently stored.
References ipa_jump_func::agg, ao_ref_init(), ao_ref_init_from_ptr_and_size(), build_int_cst(), ipa_agg_jump_function::by_ref, ipa_known_agg_contents_list::constant, contains_bitfld_component_ref_p(), get_ref_base_and_extent(), get_ssa_def_if_simple_copy(), gimple_assign_lhs(), gimple_assign_rhs1(), gimple_assign_single_p(), gsi_end_p(), gsi_for_stmt(), gsi_prev(), gsi_stmt(), host_integerp(), HOST_WIDE_INT, integer_zerop(), is_gimple_ip_invariant(), is_gimple_reg_type(), ipa_agg_jump_function::items, ipa_known_agg_contents_list::next, ipa_agg_jf_item::offset, ipa_known_agg_contents_list::offset, ipa_known_agg_contents_list::size, stmt_may_clobber_ref_p_1(), tree_low_cst(), unshare_expr_without_location(), ipa_agg_jf_item::value, and vec_alloc().
Referenced by ipa_compute_jump_functions_for_edge().
|
static |
If STMT can be proved to be an assignment to the virtual method table pointer of ANALYZED_OBJ and the type associated with the new table identified, return the type. Otherwise return NULL_TREE.
References get_base_address(), get_ref_base_and_extent(), gimple_assign_lhs(), gimple_assign_rhs1(), gimple_assign_single_p(), HOST_WIDE_INT, type_change_info::object, type_change_info::offset, offset, and tree_int_cst_equal().
Referenced by check_stmt_for_type_change().
|
static |
Free stuff in PARMS_AINFO, assume there are PARAM_COUNT parameters.
Referenced by ipa_analyze_node(), and ipcp_transform_function().
|
static |
Extract the base, offset and MEM_REF expression from a statement ASSIGN if it looks like: iftmp.1_3 = &obj_2(D)->D.1762; The base of the MEM_REF must be a default definition SSA NAME of a parameter. Return NULL_TREE if it looks otherwise. If case of success, the whole MEM_REF expression is returned and the offset calculated from any handled components and the MEM_REF itself is stored into *OFFSET. The whole RHS stripped off the ADDR_EXPR is stored into *OBJ_P.
References get_ref_base_and_extent(), gimple_assign_rhs1(), gimple_assign_single_p(), HOST_WIDE_INT, double_int::low, and mem_ref_offset().
Referenced by compute_complex_ancestor_jump_func(), and ipa_analyze_virtual_call_uses().
|
inlinestatic |
If RHS is an SSA_NAME and it is defined by a simple copy assign statement, return the rhs of its defining statement. Otherwise return RHS as it is.
References gimple_assign_rhs1(), and gimple_assign_single_p().
Referenced by determine_known_aggregate_parts().
Return a heap allocated vector containing types of formal parameters of function type FNTYPE.
References count.
Referenced by ipa_modify_formal_parameters().
|
static |
Return true iff BASE_INDEX is in ADJUSTMENTS more than once.
References ipa_parm_adjustment::base_index, and len.
Referenced by ipa_combine_adjustments().
|
static |
Analyze newly added function into callgraph.
References ipa_analyze_node().
Referenced by ipa_register_cgraph_hooks().
void ipa_alloc_node_params | ( | ) |
Initialize the ipa_node_params structure associated with NODE to hold PARAM_COUNT parameters.
References ipa_node_params::descriptors.
Referenced by ipa_initialize_node_params(), and ipa_read_node_info().
|
static |
Analyze a call statement CALL whether and how it utilizes formal parameters of the caller (described by INFO). PARMS_AINFO is a pointer to a vector containing intermediate information about each formal parameter.
References gimple_call_fn(), ipa_analyze_indirect_call_uses(), ipa_analyze_virtual_call_uses(), and virtual_method_call_p().
Referenced by ipa_analyze_stmt_uses().
|
static |
Analyze the CALL and examine uses of formal parameters of the caller NODE (described by INFO). PARMS_AINFO is a pointer to a vector containing intermediate information about each formal parameter. Currently it checks whether the call calls a pointer that is a formal parameter and if so, the parameter is marked with the called flag and an indirect call graph edge describing the call is created. This is very simple for ordinary pointers represented in SSA but not-so-nice when it comes to member pointers. The ugly part of this function does nothing more than trying to match the pattern of such a call. An example of such a pattern is the gimple dump below, the call is on the last line: <bb 2>: f$__delta_5 = f.__delta; f$__pfn_24 = f.__pfn; or <bb 2>: f$__delta_5 = MEM[(struct *)&f]; f$__pfn_24 = MEM[(struct *)&f + 4B]; and a few lines below: <bb 5> D.2496_3 = (int) f$__pfn_24; D.2497_4 = D.2496_3 & 1; if (D.2497_4 != 0) goto <bb 3>; else goto <bb 4>; <bb 6>: D.2500_7 = (unsigned int) f$__delta_5; D.2501_8 = &S + D.2500_7; D.2502_9 = (int (*__vtbl_ptr_type) (void) * *) D.2501_8; D.2503_10 = *D.2502_9; D.2504_12 = f$__pfn_24 + -1; D.2505_13 = (unsigned int) D.2504_12; D.2506_14 = D.2503_10 + D.2505_13; D.2507_15 = *D.2506_14; iftmp.11_16 = (String:: *) D.2507_15; <bb 7>: # iftmp.11_1 = PHI <iftmp.11_16(3), f$__pfn_24(2)> D.2500_19 = (unsigned int) f$__delta_5; D.2508_20 = &S + D.2500_19; D.2493_21 = iftmp.11_1 (D.2508_20, 4); Such patterns are results of simple calls to a member pointer: int doprinting (int (MyString::* f)(int) const) { MyString S ("somestring"); return (S.*f)(4); } Moreover, the function also looks for called pointers loaded from aggregates passed by value or reference.
References cgraph_indirect_call_info::agg_contents, cgraph_indirect_call_info::by_ref, d1, d2, ipa_node_params::descriptors, gimple_assign_rhs1(), gimple_assign_rhs2(), gimple_assign_rhs_code(), gimple_assign_single_p(), gimple_bb(), gimple_cond_code(), gimple_cond_lhs(), gimple_cond_rhs(), gimple_phi_num_args(), HOST_WIDE_INT, cgraph_edge::indirect_info, integer_onep(), integer_zerop(), ipa_get_param_decl_index(), ipa_get_stmt_member_ptr_load_param(), ipa_is_ssa_with_stmt_def(), ipa_load_from_parm_agg_1(), ipa_note_param_call(), is_gimple_assign(), last_stmt(), cgraph_indirect_call_info::member_ptr, cgraph_indirect_call_info::offset, offset, parm_preserved_before_stmt_p(), ptrmemfunc_vbit_in_delta, single_pred(), single_pred_p(), single_succ(), and single_succ_p().
Referenced by ipa_analyze_call_uses().
void ipa_analyze_node | ( | ) |
Initialize the array describing properties of of formal parameters of NODE, analyze their uses and compute jump functions associated with actual arguments of calls from within NODE.
References symtab_node_base::decl, free_parms_ainfo(), ipa_analyze_params_uses(), ipa_check_create_edge_args(), ipa_check_create_node_params(), ipa_compute_jump_functions(), ipa_get_param_count(), ipa_initialize_node_params(), memset(), pop_cfun(), push_cfun(), and cgraph_node::symbol.
Referenced by inline_indirect_intraprocedural_analysis(), ipa_add_new_function(), and ipcp_generate_summary().
|
static |
Scan the function body of NODE and inspect the uses of formal parameters. Store the findings in various structures of the associated ipa_node_params structure, such as parameter flags, notes etc. PARMS_AINFO is a pointer to a vector containing intermediate information about each formal parameter.
References symtab_node_base::decl, gsi_end_p(), gsi_next(), gsi_start_bb(), gsi_start_phis(), gsi_stmt(), has_zero_uses(), ipa_analyze_stmt_uses(), ipa_func_spec_opts_forbid_analysis_p(), ipa_get_param(), ipa_get_param_count(), ipa_set_controlled_uses(), ipa_set_param_used(), is_gimple_call(), is_gimple_debug(), is_gimple_reg(), ssa_default_def(), cgraph_node::symbol, ipa_node_params::uses_analysis_done, visit_ref_for_mod_analysis(), and walk_stmt_load_store_addr_ops().
Referenced by ipa_analyze_node().
|
static |
Analyze the call statement STMT with respect to formal parameters (described in INFO) of caller given by NODE. Currently it only checks whether formal parameters are called. PARMS_AINFO is a pointer to a vector containing intermediate information about each formal parameter.
References ipa_analyze_call_uses(), and is_gimple_call().
Referenced by ipa_analyze_params_uses().
|
static |
Analyze a CALL to an OBJ_TYPE_REF which is passed in TARGET and if the object referenced in the expression is a formal parameter of the caller (described by INFO), create a call note for the statement.
References detect_type_change(), detect_type_change_ssa(), get_ancestor_addr_info(), HOST_WIDE_INT, cgraph_edge::indirect_info, ipa_get_param_decl_index(), ipa_note_param_call(), obj_type_ref_class(), cgraph_indirect_call_info::offset, cgraph_indirect_call_info::otr_token, cgraph_indirect_call_info::otr_type, cgraph_indirect_call_info::polymorphic, and tree_low_cst().
Referenced by ipa_analyze_call_uses().
tree ipa_binfo_from_known_type_jfunc | ( | ) |
Extract the acual BINFO being described by JFUNC which must be a known type jump function.
References ipa_known_type_data::base_type, ipa_known_type_data::component_type, get_binfo_at_offset(), ipa_jump_func::jump_func_value::known_type, ipa_known_type_data::offset, and ipa_jump_func::value.
Referenced by ipa_intraprocedural_devirtualization(), ipa_value_from_jfunc(), and propagate_scalar_accross_jump_function().
ipa_parm_adjustment_vec ipa_combine_adjustments | ( | ipa_parm_adjustment_vec | inner, |
ipa_parm_adjustment_vec | outer | ||
) |
Return adjustments that should have the same effect on function parameters and call arguments as if they were first changed according to adjustments in INNER and then by adjustments in OUTER.
References ipa_parm_adjustment::base_index, ipa_parm_adjustment::copy_param, index_in_adjustments_multiple_times_p(), memset(), ipa_parm_adjustment::offset, ipa_parm_adjustment::remove_param, and ipa_parm_adjustment::type.
|
static |
Compute jump functions for all edges - both direct and indirect - outgoing from NODE. Also count the actual arguments in the process.
References cgraph_edge::callee, cgraph_node::callees, cgraph_function_or_thunk_node(), symtab_node_base::definition, cgraph_node::indirect_calls, ipa_compute_jump_functions_for_edge(), cgraph_edge::next_callee, and cgraph_node::symbol.
Referenced by ipa_analyze_node().
|
static |
Compute jump function for all arguments of callsite CS and insert the information in the jump_functions array in the ipa_edge_args corresponding to this callsite.
References cgraph_edge::call_stmt, cgraph_edge::caller, compute_complex_ancestor_jump_func(), compute_complex_assign_jump_func(), compute_known_type_jump_func(), detect_type_change_ssa(), determine_known_aggregate_parts(), gimple_call_arg(), gimple_call_num_args(), ipa_func_spec_opts_forbid_analysis_p(), ipa_get_ith_jump_func(), ipa_get_jf_ancestor_agg_preserved(), ipa_get_jf_pass_through_agg_preserved(), ipa_get_param_decl_index(), IPA_JF_ANCESTOR, IPA_JF_PASS_THROUGH, ipa_set_jf_constant(), ipa_set_jf_simple_pass_through(), is_gimple_assign(), is_gimple_ip_invariant(), is_gimple_reg_type(), ipa_edge_args::jump_functions, parm_preserved_before_stmt_p(), parm_ref_data_pass_through_p(), ipa_jump_func::type, and vec_safe_grow_cleared().
Referenced by ipa_compute_jump_functions().
void ipa_dump_agg_replacement_values | ( | ) |
Dump the AV linked list.
References HOST_WIDE_INT_PRINT_DEC, ipa_agg_replacement_value::index, ipa_agg_replacement_value::next, ipa_agg_replacement_value::offset, print_generic_expr(), and ipa_agg_replacement_value::value.
Referenced by create_specialized_node(), and ipcp_transform_function().
void ipa_dump_param | ( | ) |
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, and print_generic_expr().
Referenced by decide_about_value(), estimate_local_effects(), find_more_scalar_values_for_callers_subset(), get_replacement_map(), and ipa_print_node_params().
void ipa_dump_param_adjustments | ( | FILE * | file, |
ipa_parm_adjustment_vec | adjustments, | ||
tree | fndecl | ||
) |
Dump the adjustments in the vector ADJUSTMENTS to dump_file in a human friendly way, assuming they are meant to be applied to FNDECL.
References ipa_parm_adjustment::base, ipa_parm_adjustment::base_index, ipa_parm_adjustment::by_ref, ipa_parm_adjustment::copy_param, first, ipa_get_vector_of_formal_parms(), len, ipa_parm_adjustment::new_ssa_base, ipa_parm_adjustment::offset, print_generic_expr(), print_node_brief(), ipa_parm_adjustment::reduction, ipa_parm_adjustment::remove_param, and ipa_parm_adjustment::type.
Referenced by ipa_early_sra().
|
static |
Hook that is called by cgraph.c when an edge is duplicated.
References ipa_jump_func::agg, cgraph_edge::caller, ipa_jump_func::jump_func_value::constant, ipa_cst_ref_desc::cs, cgraph_node::global, cgraph_global_info::inlined_to, ipa_check_create_edge_args(), ipa_get_ith_jump_func(), IPA_JF_CONST, ipa_agg_jump_function::items, jfunc_rdesc_usable(), ipa_edge_args::jump_functions, ipa_cst_ref_desc::next_duplicate, pool_alloc(), ipa_constant_data::rdesc, ipa_cst_ref_desc::refcount, ipa_jump_func::type, ipa_jump_func::value, vec_safe_copy(), and vec_safe_length().
Referenced by ipa_register_cgraph_hooks().
|
static |
Hook that is called by cgraph.c when an edge is removed.
References ipa_free_edge_args_substructures(), cgraph_edge::uid, and vec_safe_length().
Referenced by ipa_register_cgraph_hooks().
tree ipa_find_agg_cst_for_param | ( | struct ipa_agg_jump_function * | agg, |
HOST_WIDE_INT | offset, | ||
bool | by_ref | ||
) |
Retrieve value from aggregate jump function AGG for the given OFFSET or return NULL if there is not any. BY_REF specifies whether the value has to be passed by reference or by value.
References ipa_agg_jump_function::by_ref, is_gimple_ip_invariant(), ipa_agg_jump_function::items, ipa_agg_jf_item::offset, and ipa_agg_jf_item::value.
Referenced by evaluate_conditions_for_known_args(), ipa_get_indirect_edge_target_1(), and try_make_edge_direct_simple_call().
void ipa_free_all_edge_args | ( | void | ) |
Free all ipa_edge structures.
References ipa_free_edge_args_substructures(), and vec_free().
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 ipa_free_node_params_substructures().
Referenced by 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 free_alloc_pool(), ipa_free_all_edge_args(), ipa_free_all_node_params(), ipa_unregister_cgraph_hooks(), ipcp_agg_lattice_pool, ipcp_sources_pool, and ipcp_values_pool.
Referenced by ipa_inline().
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 free_alloc_pool(), ipa_free_all_edge_args(), ipa_free_all_node_params(), ipa_unregister_cgraph_hooks(), ipcp_agg_lattice_pool, ipcp_sources_pool, and ipcp_values_pool.
Referenced by ipcp_driver().
void ipa_free_edge_args_substructures | ( | ) |
Frees all dynamically allocated structures that the argument info points to.
References ipa_edge_args::jump_functions, memset(), and vec_free().
Referenced by ipa_edge_removal_hook(), and ipa_free_all_edge_args().
void ipa_free_node_params_substructures | ( | ) |
Frees all dynamically allocated structures that the param info points to.
References ipa_node_params::descriptors, free(), ipa_node_params::known_vals, ipa_node_params::lattices, and memset().
Referenced by ipa_free_all_node_params(), and ipa_node_removal_hook().
|
static |
Return true if DECL_FUNCTION_SPECIFIC_OPTIMIZATION of the decl associated with NODE should prevent us from analyzing it for the purposes of IPA-CP.
References symtab_node_base::decl, and cgraph_node::symbol.
Referenced by ipa_analyze_params_uses(), and ipa_compute_jump_functions_for_edge().
int ipa_get_param_decl_index | ( | ) |
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 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(), unmodified_parm_or_parm_agg_item(), visit_ref_for_mod_analysis(), will_be_nonconstant_expr_predicate(), and will_be_nonconstant_predicate().
|
static |
Return index of the formal whose tree is PTREE in function which corresponds to INFO.
References count.
Referenced by ipa_get_param_decl_index(), ipa_load_from_parm_agg_1(), and load_from_unmodified_param().
|
static |
If STMT looks like a statement loading a value from a member pointer formal parameter, return that parameter and store the offset of the field to *OFFSET_P, if it is non-NULL. Otherwise return NULL (but *OFFSET_P still might be clobbered). If USE_DELTA, then we look for a use of the delta field rather than the pfn.
References byte_position(), gimple_assign_rhs1(), gimple_assign_single_p(), int_bit_position(), integer_nonzerop(), tree_int_cst_equal(), and type_like_member_ptr_p().
Referenced by ipa_analyze_indirect_call_uses().
Return a heap allocated vector containing formal parameters of FNDECL.
References count, and count_formal_params().
Referenced by ipa_dump_param_adjustments(), ipa_modify_formal_parameters(), and turn_representatives_into_adjustments().
void ipa_initialize_node_params | ( | ) |
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_base::decl, ipa_node_params::descriptors, ipa_alloc_node_params(), ipa_populate_param_decls(), and cgraph_node::symbol.
Referenced by ipa_analyze_node().
tree ipa_intraprocedural_devirtualization | ( | ) |
Given a statement CALL which must be a GIMPLE_CALL calling an OBJ_TYPE_REF attempt a type-based devirtualization. If successful, return the target function declaration, otherwise return NULL.
References compute_known_type_jump_func(), gimple_call_fn(), gimple_get_virt_method_for_binfo(), ipa_binfo_from_known_type_jfunc(), IPA_JF_KNOWN_TYPE, IPA_JF_UNKNOWN, token(), tree_low_cst(), and ipa_jump_func::type.
Referenced by eliminate_bb().
|
static |
Returns true iff T is an SSA_NAME defined by a statement.
Referenced by ipa_analyze_indirect_call_uses().
bool ipa_load_from_parm_agg | ( | struct ipa_node_params * | info, |
gimple | stmt, | ||
tree | op, | ||
int * | index_p, | ||
HOST_WIDE_INT * | offset_p, | ||
bool * | by_ref_p | ||
) |
Just like the previous function, just without the param_analysis_info pointer, for users outside of this file.
References ipa_node_params::descriptors, and ipa_load_from_parm_agg_1().
Referenced by unmodified_parm_or_parm_agg_item().
|
static |
Return true if we can prove that OP is a memory reference loading unmodified data from an aggregate passed as a parameter and if the aggregate is passed by reference, that the alias type of the load corresponds to the type of the formal parameter (so that we can rely on this type for TBAA in callers). 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.
References get_ref_base_and_extent(), HOST_WIDE_INT, integer_zerop(), ipa_get_param_decl_index_1(), load_from_unmodified_param(), parm_preserved_before_stmt_p(), and parm_ref_data_preserved_p().
Referenced by ipa_analyze_indirect_call_uses(), ipa_load_from_parm_agg(), and ipcp_transform_function().
|
read |
If TARGET is an addr_expr of a function declaration, make it the destination of an indirect edge IE and return the edge. Otherwise, return NULL.
References builtin_decl_implicit(), eni_weights_d::call_cost, cgraph_edge::call_stmt, inline_edge_summary::call_stmt_size, inline_edge_summary::call_stmt_time, cgraph_edge::callee, cgraph_edge::caller, canonicalize_constructor_val(), cgraph_get_create_node(), cgraph_get_create_real_symbol_node(), cgraph_get_node(), cgraph_make_edge_direct(), cgraph_node_name(), dump_file, eni_size_weights, eni_time_weights, cgraph_node::global, eni_weights_d::indirect_call_cost, cgraph_edge::indirect_info, inline_edge_summary(), cgraph_global_info::inlined_to, ipa_check_create_node_params(), cgraph_edge::lto_stmt_uid, cgraph_indirect_call_info::member_ptr, symtab_node_base::order, cgraph_indirect_call_info::polymorphic, print_gimple_stmt(), and cgraph_node::symbol.
Referenced by ipcp_discover_new_direct_edges(), try_make_edge_direct_simple_call(), and try_make_edge_direct_virtual_call().
void ipa_modify_call_arguments | ( | struct cgraph_edge * | cs, |
gimple | stmt, | ||
ipa_parm_adjustment_vec | adjustments | ||
) |
Modify actual arguments of a function call CS as indicated in ADJUSTMENTS. If this is a directly recursive call, CS must be NULL. Otherwise it must contain the corresponding call graph edge.
References ipa_parm_adjustment::alias_ptr_type, ipa_parm_adjustment::base, ipa_parm_adjustment::base_index, build_aligned_type(), build_int_cst(), ipa_parm_adjustment::by_ref, cgraph_edge::callee, CDI_DOMINATORS, cgraph_get_node(), cgraph_set_call_stmt(), ipa_parm_adjustment::copy_param, current_function_decl, symtab_node_base::decl, decl_debug_args_insert(), dump_file, dump_flags, fold_convert_loc(), fold_convertible_p(), force_gimple_operand_gsi(), free_dominance_info(), get_addr_base_and_unit_offset(), get_pointer_alignment_1(), gimple_block(), gimple_build_call_vec(), gimple_call_arg(), gimple_call_chain(), gimple_call_copy_flags(), gimple_call_fndecl(), gimple_call_lhs(), gimple_call_set_chain(), gimple_call_set_lhs(), gimple_has_location(), gimple_location(), gimple_set_block(), gimple_set_location(), gsi_end_p(), gsi_for_stmt(), gsi_insert_before(), gsi_prev(), gsi_replace(), GSI_SAME_STMT, gsi_stmt(), HOST_WIDE_INT, int_const_binop(), ipa_record_stmt_references(), ipa_remove_stmt_references(), is_gimple_reg_type(), len, double_int::low, ipa_parm_adjustment::offset, print_gimple_stmt(), ipa_parm_adjustment::remove_param, double_int::sext(), cgraph_node::symbol, tree_to_double_int(), ipa_parm_adjustment::type, unshare_expr(), update_ssa(), useless_type_conversion_p(), vec_safe_iterate(), and vec_safe_push().
Referenced by convert_callers(), and convert_callers_for_node().
void ipa_modify_formal_parameters | ( | tree | fndecl, |
ipa_parm_adjustment_vec | adjustments, | ||
const char * | synth_parm_prefix | ||
) |
Modify the function declaration FNDECL and its type according to the plan in ADJUSTMENTS. It also sets base fields of individual adjustments structures to reflect the actual parameters being modified which are determined by the base_index field.
References ipa_parm_adjustment::base, ipa_parm_adjustment::base_index, build_distinct_type_copy(), build_function_type(), build_pointer_type(), ipa_parm_adjustment::by_ref, ipa_parm_adjustment::copy_param, create_tmp_var_name(), get_vector_of_formal_parm_types(), ipa_get_vector_of_formal_parms(), layout_decl(), len, NOT_BUILT_IN, nreverse(), ipa_parm_adjustment::reduction, ipa_parm_adjustment::remove_param, tree_last(), and ipa_parm_adjustment::type.
Referenced by modify_function().
|
static |
Hook that is called by cgraph.c when a node is duplicated.
References ipa_node_params::descriptors, ipa_check_create_node_params(), ipa_get_agg_replacements_for_node(), ipa_set_node_agg_value_chain(), ipa_node_params::ipcp_orig_node, ipa_node_params::lattices, memcpy(), ipa_agg_replacement_value::next, ipa_node_params::node_enqueued, and ipa_node_params::uses_analysis_done.
Referenced by ipa_register_cgraph_hooks().
|
static |
Hook that is called by cgraph.c when a node is removed.
References ipa_free_node_params_substructures(), cgraph_node::uid, and vec_safe_length().
Referenced by ipa_register_cgraph_hooks().
|
staticread |
Find the indirect call graph edge corresponding to STMT and mark it as a call to a parameter number PARAM_INDEX. NODE is the caller. Return the indirect call graph edge.
References cgraph_indirect_call_info::agg_contents, cgraph_edge(), cgraph_edge::indirect_info, cgraph_indirect_call_info::member_ptr, cgraph_indirect_call_info::offset, cgraph_indirect_call_info::param_index, and cgraph_indirect_call_info::polymorphic.
Referenced by ipa_analyze_indirect_call_uses(), and ipa_analyze_virtual_call_uses().
|
static |
Populate the param_decl field in parameter DESCRIPTORS that correspond to NODE.
References symtab_node_base::decl, estimate_move_cost(), gimple_has_body_p(), and cgraph_node::symbol.
Referenced by ipa_initialize_node_params(), and ipcp_transform_function().
void ipa_print_all_jump_functions | ( | ) |
Print ipa_jump_func data structures of all nodes in the call graph to F.
References ipa_print_node_jump_functions().
Referenced by ipcp_driver().
void ipa_print_all_params | ( | ) |
Print ipa_tree_map data structures of all functions in the callgraph to F.
References ipa_print_node_params().
Referenced by ipcp_driver().
void ipa_print_node_jump_functions | ( | ) |
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_node_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, symtab_node_base::order, cgraph_indirect_call_info::param_index, cgraph_indirect_call_info::polymorphic, print_gimple_stmt(), and cgraph_node::symbol.
Referenced by inline_indirect_intraprocedural_analysis(), and ipa_print_all_jump_functions().
|
static |
Print the jump functions associated with call graph edge CS to file F.
References ipa_jump_func::agg, ipa_pass_through_data::agg_preserved, ipa_ancestor_jf_data::agg_preserved, ipa_jump_func::jump_func_value::ancestor, ipa_known_type_data::base_type, ipa_agg_jump_function::by_ref, ipa_known_type_data::component_type, ipa_jump_func::jump_func_value::constant, count, ipa_pass_through_data::formal_id, ipa_ancestor_jf_data::formal_id, HOST_WIDE_INT_PRINT_DEC, ipa_get_cs_argument_count(), ipa_get_ith_jump_func(), IPA_JF_ANCESTOR, IPA_JF_CONST, IPA_JF_KNOWN_TYPE, IPA_JF_PASS_THROUGH, IPA_JF_UNKNOWN, ipa_agg_jump_function::items, ipa_jump_func::jump_func_value::known_type, ipa_known_type_data::offset, ipa_ancestor_jf_data::offset, ipa_agg_jf_item::offset, ipa_pass_through_data::operand, ipa_pass_through_data::operation, ipa_jump_func::jump_func_value::pass_through, print_generic_expr(), tree_code_name, tree_low_cst(), ipa_ancestor_jf_data::type, ipa_jump_func::type, type(), ipa_constant_data::value, ipa_agg_jf_item::value, and ipa_jump_func::value.
Referenced by ipa_print_node_jump_functions().
void ipa_print_node_params | ( | ) |
Print ipa_tree_map data structures of all functions in the callgraph to F.
References cgraph_node_name(), count, symtab_node_base::definition, ipa_dump_param(), ipa_get_controlled_uses(), ipa_get_param_count(), ipa_is_param_used(), symtab_node_base::order, and cgraph_node::symbol.
Referenced by inline_indirect_intraprocedural_analysis(), and ipa_print_all_params().
void ipa_prop_read_all_agg_replacement | ( | void | ) |
Read IPA-CP aggregate replacements.
References len, lto_get_file_decl_data(), lto_get_section_data(), LTO_section_ipcp_transform, and read_replacements_section().
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(), len, lto_get_file_decl_data(), lto_get_section_data(), and LTO_section_jump_functions.
Referenced by inline_read_summary(), and ipcp_read_summary().
|
static |
Read section in file FILE_DATA of length LEN with data DATA.
References lto_function_header::cfg_size, cgraph(), count, symtab_node_base::definition, ipa_read_node_info(), lto_data_in_create(), lto_data_in_delete(), lto_free_section_data(), LTO_section_jump_functions, lto_symtab_encoder_deref(), lto_function_header::main_size, streamer_read_uhwi(), lto_function_header::string_size, cgraph_node::symbol, lto_file_decl_data::symtab_node_encoder, and vNULL.
Referenced by ipa_prop_read_jump_functions().
void ipa_prop_write_all_agg_replacement | ( | void | ) |
Write all aggregate replacement for nodes in set.
References cgraph_function_with_gimple_body_p(), output_block::cgraph_node, count, create_output_block(), output_block::decl_state, destroy_output_block(), ipa_get_agg_replacements_for_node(), lsei_cgraph_node(), lsei_end_p(), lsei_next_function_in_partition(), lsei_start_function_in_partition(), LTO_section_ipcp_transform, output_block::main_stream, produce_asm(), streamer_write_char_stream(), streamer_write_uhwi(), lto_out_decl_state::symtab_node_encoder, and write_agg_replacement_chain().
void ipa_prop_write_jump_functions | ( | void | ) |
Write jump functions for nodes in SET.
References cgraph_function_with_gimple_body_p(), output_block::cgraph_node, count, create_output_block(), output_block::decl_state, destroy_output_block(), 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, produce_asm(), streamer_write_char_stream(), streamer_write_uhwi(), and lto_out_decl_state::symtab_node_encoder.
Referenced by inline_write_summary(), and ipcp_write_summary().
bool ipa_propagate_indirect_call_infos | ( | struct cgraph_edge * | cs, |
vec< cgraph_edge_p > * | 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, propagate_controlled_uses(), and propagate_info_to_inlined_callees().
Referenced by inline_call().
|
static |
Read in parts of cgraph_indirect_call_info corresponding to CS that are relevant to indirect inlining from IB.
References cgraph_indirect_call_info::agg_contents, bp_unpack_value(), cgraph_indirect_call_info::by_ref, HOST_WIDE_INT, cgraph_edge::indirect_info, cgraph_indirect_call_info::member_ptr, cgraph_indirect_call_info::offset, cgraph_indirect_call_info::otr_token, cgraph_indirect_call_info::otr_type, cgraph_indirect_call_info::param_index, cgraph_indirect_call_info::polymorphic, streamer_read_bitpack(), and streamer_read_hwi().
Referenced by ipa_read_node_info().
|
static |
Read in jump function JUMP_FUNC from IB.
References ipa_jump_func::agg, bp_unpack_value(), ipa_agg_jump_function::by_ref, count, HOST_WIDE_INT, IPA_JF_ANCESTOR, IPA_JF_CONST, IPA_JF_KNOWN_TYPE, IPA_JF_PASS_THROUGH, IPA_JF_UNKNOWN, ipa_set_ancestor_jf(), ipa_set_jf_arith_pass_through(), ipa_set_jf_constant(), ipa_set_jf_known_type(), ipa_set_jf_simple_pass_through(), ipa_agg_jump_function::items, ipa_agg_jf_item::offset, offset, streamer_read_bitpack(), streamer_read_uhwi(), ipa_jump_func::type, ipa_agg_jf_item::value, and vec_alloc().
Referenced by ipa_read_node_info().
|
static |
Stream in NODE info from IB.
References bp_unpack_value(), cgraph_node::callees, count, ipa_node_params::descriptors, cgraph_node::indirect_calls, ipa_alloc_node_params(), ipa_get_cs_argument_count(), ipa_get_ith_jump_func(), ipa_get_param_count(), ipa_read_indirect_edge_info(), ipa_read_jump_function(), ipa_set_controlled_uses(), ipa_set_param_used(), ipa_edge_args::jump_functions, cgraph_edge::next_callee, ipa_node_params::node_enqueued, streamer_read_bitpack(), streamer_read_hwi(), streamer_read_uhwi(), ipa_node_params::uses_analysis_done, and vec_safe_grow_cleared().
Referenced by ipa_prop_read_section().
void ipa_register_cgraph_hooks | ( | void | ) |
Register our cgraph hooks if they are not already there.
References cgraph_add_edge_duplication_hook(), cgraph_add_edge_removal_hook(), cgraph_add_function_insertion_hook(), cgraph_add_node_duplication_hook(), cgraph_add_node_removal_hook(), ipa_add_new_function(), ipa_edge_duplication_hook(), ipa_edge_removal_hook(), ipa_node_duplication_hook(), and ipa_node_removal_hook().
Referenced by inline_generate_summary(), inline_read_summary(), ipa_prop_read_jump_functions(), and ipcp_generate_summary().
|
static |
Set JFUNC to be an ancestor jump function.
References ipa_ancestor_jf_data::agg_preserved, ipa_jump_func::jump_func_value::ancestor, ipa_ancestor_jf_data::formal_id, IPA_JF_ANCESTOR, ipa_ancestor_jf_data::offset, offset, ipa_ancestor_jf_data::type, ipa_jump_func::type, type(), and ipa_jump_func::value.
Referenced by compute_complex_ancestor_jump_func(), compute_complex_assign_jump_func(), and ipa_read_jump_function().
|
static |
Set JFUNC to be an arithmetic pass through jump function.
References ipa_pass_through_data::agg_preserved, ipa_pass_through_data::formal_id, IPA_JF_PASS_THROUGH, ipa_pass_through_data::operand, ipa_pass_through_data::operation, ipa_jump_func::jump_func_value::pass_through, ipa_jump_func::type, unshare_expr_without_location(), and ipa_jump_func::value.
Referenced by compute_complex_assign_jump_func(), and ipa_read_jump_function().
|
static |
Set JFUNC to be a constant jmp function.
References ipa_jump_func::jump_func_value::constant, create_alloc_pool(), ipa_cst_ref_desc::cs, IPA_JF_CONST, ipa_cst_ref_desc::next_duplicate, pool_alloc(), ipa_constant_data::rdesc, ipa_cst_ref_desc::refcount, ipa_jump_func::type, unshare_expr(), unshare_expr_without_location(), ipa_constant_data::value, and ipa_jump_func::value.
Referenced by ipa_compute_jump_functions_for_edge(), and ipa_read_jump_function().
|
static |
Set JFUNC to be a known type jump function.
References ipa_known_type_data::base_type, ipa_known_type_data::component_type, IPA_JF_KNOWN_TYPE, ipa_jump_func::jump_func_value::known_type, ipa_known_type_data::offset, offset, ipa_jump_func::type, and ipa_jump_func::value.
Referenced by combine_known_type_and_ancestor_jfs(), compute_known_type_jump_func(), detect_type_change_1(), and ipa_read_jump_function().
|
static |
Set JFUNC to be a simple pass-through jump function.
References ipa_pass_through_data::agg_preserved, ipa_pass_through_data::formal_id, IPA_JF_PASS_THROUGH, ipa_pass_through_data::operand, ipa_pass_through_data::operation, ipa_jump_func::jump_func_value::pass_through, ipa_jump_func::type, and ipa_jump_func::value.
Referenced by compute_complex_assign_jump_func(), ipa_compute_jump_functions_for_edge(), and ipa_read_jump_function().
void ipa_set_node_agg_value_chain | ( | struct cgraph_node * | node, |
struct ipa_agg_replacement_value * | aggvals | ||
) |
Set the aggregate replacements of NODE to be AGGVALS.
References cgraph_max_uid, cgraph_node::uid, vec_safe_grow_cleared(), and vec_safe_length().
Referenced by create_specialized_node(), ipa_node_duplication_hook(), and read_agg_replacement_chain().
|
static |
Unregister our cgraph hooks if they are not already there.
References cgraph_remove_edge_duplication_hook(), cgraph_remove_edge_removal_hook(), cgraph_remove_function_insertion_hook(), cgraph_remove_node_duplication_hook(), and cgraph_remove_node_removal_hook().
Referenced by ipa_free_all_structures_after_iinln(), and ipa_free_all_structures_after_ipa_cp().
void ipa_update_after_lto_read | ( | void | ) |
After merging units, we can get mismatch in argument counts. Also decl merging might've rendered parameter lists obsolete. Also compute called_with_variable_arg info.
References ipa_check_create_edge_args(), and ipa_check_create_node_params().
Referenced by ipa_inline(), and ipcp_propagate_stage().
|
static |
Stream out parts of cgraph_indirect_call_info corresponding to CS that are relevant to indirect inlining to OB.
References cgraph_indirect_call_info::agg_contents, bitpack_create(), bp_pack_value(), cgraph_indirect_call_info::by_ref, cgraph_edge::indirect_info, output_block::main_stream, cgraph_indirect_call_info::member_ptr, cgraph_indirect_call_info::offset, cgraph_indirect_call_info::otr_token, cgraph_indirect_call_info::otr_type, cgraph_indirect_call_info::param_index, cgraph_indirect_call_info::polymorphic, streamer_write_bitpack(), and streamer_write_hwi().
Referenced by ipa_write_node_info().
|
static |
Stream out jump function JUMP_FUNC to OB.
References ipa_jump_func::agg, ipa_pass_through_data::agg_preserved, ipa_ancestor_jf_data::agg_preserved, ipa_jump_func::jump_func_value::ancestor, ipa_known_type_data::base_type, bitpack_create(), bp_pack_value(), ipa_agg_jump_function::by_ref, ipa_known_type_data::component_type, ipa_jump_func::jump_func_value::constant, count, ipa_pass_through_data::formal_id, ipa_ancestor_jf_data::formal_id, IPA_JF_ANCESTOR, IPA_JF_CONST, IPA_JF_KNOWN_TYPE, IPA_JF_PASS_THROUGH, IPA_JF_UNKNOWN, ipa_agg_jump_function::items, ipa_jump_func::jump_func_value::known_type, output_block::main_stream, ipa_known_type_data::offset, ipa_ancestor_jf_data::offset, ipa_agg_jf_item::offset, ipa_pass_through_data::operand, ipa_pass_through_data::operation, ipa_jump_func::jump_func_value::pass_through, streamer_write_bitpack(), streamer_write_uhwi(), ipa_ancestor_jf_data::type, ipa_jump_func::type, ipa_constant_data::value, ipa_agg_jf_item::value, ipa_jump_func::value, and vec_safe_length().
Referenced by ipa_write_node_info().
|
static |
Stream out NODE info to OB.
References bitpack_create(), bp_pack_value(), output_block::decl_state, ipa_get_controlled_uses(), ipa_get_cs_argument_count(), ipa_get_ith_jump_func(), ipa_get_param_count(), ipa_get_param_move_cost(), ipa_is_param_used(), ipa_write_indirect_edge_info(), ipa_write_jump_function(), ipa_node_params::ipcp_orig_node, lto_symtab_encoder_encode(), output_block::main_stream, cgraph_edge::next_callee, ipa_node_params::node_enqueued, streamer_write_bitpack(), streamer_write_hwi(), streamer_write_uhwi(), lto_out_decl_state::symtab_node_encoder, and ipa_node_params::uses_analysis_done.
Referenced by ipa_prop_write_jump_functions().
unsigned int ipcp_transform_function | ( | ) |
Function body transformation phase.
References adjust_agg_replacement_values(), ipa_agg_replacement_value::by_ref, cfg_changed, cfun, cgraph_node_name(), count_formal_params(), current_function_decl, symtab_node_base::decl, dump_file, dump_flags, fold_convertible_p(), free_parms_ainfo(), gimple_assign_load_p(), gimple_assign_rhs1(), gimple_assign_set_rhs_from_tree(), gimple_purge_dead_eh_edges(), gsi_end_p(), gsi_next(), gsi_start_bb(), gsi_stmt(), handled_component_p(), HOST_WIDE_INT, ipa_agg_replacement_value::index, ipa_dump_agg_replacement_values(), ipa_get_agg_replacements_for_node(), ipa_load_from_parm_agg_1(), ipa_populate_param_decls(), is_gimple_ip_invariant(), is_gimple_reg_type(), maybe_clean_eh_stmt(), memset(), ipa_agg_replacement_value::next, ipa_agg_replacement_value::offset, offset, symtab_node_base::order, print_generic_expr(), print_gimple_stmt(), cgraph_node::symbol, cgraph_node::uid, update_stmt(), useless_type_conversion_p(), ipa_agg_replacement_value::value, and vNULL.
|
staticread |
If JFUNC has a reference description with refcount different from IPA_UNDESCRIBED_USE, return the reference description, otherwise return NULL. JFUNC must be a constant jump function.
References ipa_get_jf_constant_rdesc(), and ipa_cst_ref_desc::refcount.
Referenced by ipa_edge_duplication_hook(), propagate_controlled_uses(), and try_make_edge_direct_simple_call().
|
static |
If STMT is an assignment that loads a value from an parameter declaration, return the index of the parameter in ipa_node_params which has not been modified. Otherwise return -1.
References gimple_assign_rhs1(), gimple_assign_single_p(), ipa_get_param_decl_index_1(), and parm_preserved_before_stmt_p().
Referenced by compute_complex_assign_jump_func(), and ipa_load_from_parm_agg_1().
Callback of walk_aliased_vdefs. Flags that it has been invoked to the boolean variable pointed to by DATA.
Referenced by parm_preserved_before_stmt_p(), parm_ref_data_pass_through_p(), and parm_ref_data_preserved_p().
|
static |
Return true if a load from a formal parameter PARM_LOAD is known to retrieve a value known not to be modified in this function before reaching the statement STMT. PARM_AINFO is a pointer to a structure containing temporary information about the parameter.
References ao_ref_init(), gimple_vuse(), mark_modified(), param_analysis_info::parm_modified, param_analysis_info::parm_visited_statements, and walk_aliased_vdefs().
Referenced by ipa_analyze_indirect_call_uses(), ipa_compute_jump_functions_for_edge(), ipa_load_from_parm_agg_1(), and load_from_unmodified_param().
|
static |
Return true if the data pointed to by PARM is known to be unmodified in this function before reaching call statement CALL into which it is passed. PARM_AINFO is a pointer to a structure containing temporary information about PARM.
References ao_ref_init_from_ptr_and_size(), gimple_vuse(), mark_modified(), param_analysis_info::pt_modified, param_analysis_info::pt_visited_statements, and walk_aliased_vdefs().
Referenced by compute_complex_ancestor_jump_func(), compute_complex_assign_jump_func(), and ipa_compute_jump_functions_for_edge().
|
static |
Return true if memory reference REF loads data that are known to be unmodified in this function before reaching statement STMT. PARM_AINFO, if non-NULL, is a pointer to a structure containing temporary information about PARM.
References ao_ref_init(), gimple_vuse(), mark_modified(), param_analysis_info::ref_modified, and walk_aliased_vdefs().
Referenced by ipa_load_from_parm_agg_1().
|
static |
Propagate number of controlled users from CS->caleee to the new root of the tree of inlined nodes.
References cgraph_edge::callee, cgraph_edge::caller, cgraph_get_node(), cgraph_node_name(), cgraph_node::clone, combine_controlled_uses_counters(), count, ipa_cst_ref_desc::cs, dump_file, ipa_pass_through_data::formal_id, cgraph_node::global, cgraph_global_info::inlined_to, ipa_find_reference(), ipa_get_controlled_uses(), ipa_get_cs_argument_count(), ipa_get_ith_jump_func(), ipa_get_jf_constant(), ipa_get_jf_pass_through_formal_id(), ipa_get_jf_pass_through_operation(), ipa_get_param_count(), IPA_JF_CONST, IPA_JF_PASS_THROUGH, ipa_remove_reference(), ipa_set_controlled_uses(), ipa_node_params::ipcp_orig_node, jfunc_rdesc_usable(), ipa_node_params::known_vals, ipa_jump_func::jump_func_value::pass_through, ipa_cst_ref_desc::refcount, remove_described_reference(), ipa_jump_func::type, and ipa_jump_func::value.
Referenced by ipa_propagate_indirect_call_infos().
|
static |
Recursively traverse subtree of NODE (including node) made of inlined cgraph_edges when CS has been inlined and invoke update_indirect_edges_after_inlining on all nodes and update_jump_functions_after_inlining on all non-inlined edges that lead out of this subtree. 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, cgraph_node::callees, cgraph_node::indirect_calls, cgraph_edge::inline_failed, cgraph_edge::next_callee, update_indirect_edges_after_inlining(), and update_jump_functions_after_inlining().
Referenced by ipa_propagate_indirect_call_infos().
|
static |
Stream in the aggregate value replacement chain for NODE from IB.
References bp_unpack_value(), count, ipa_set_node_agg_value_chain(), streamer_read_bitpack(), and streamer_read_uhwi().
Referenced by read_replacements_section().
|
static |
Read replacements section in file FILE_DATA of length LEN with data DATA.
References lto_function_header::cfg_size, cgraph(), count, symtab_node_base::definition, lto_data_in_create(), lto_data_in_delete(), lto_free_section_data(), LTO_section_jump_functions, lto_symtab_encoder_deref(), lto_function_header::main_size, read_agg_replacement_chain(), streamer_read_uhwi(), lto_function_header::string_size, cgraph_node::symbol, lto_file_decl_data::symtab_node_encoder, and vNULL.
Referenced by ipa_prop_read_all_agg_replacement().
|
static |
Remove a reference to SYMBOL from the list of references of a node given by reference description RDESC.
References cgraph_edge::call_stmt, cgraph_edge::caller, cgraph_node_name(), ipa_cst_ref_desc::cs, dump_file, ipa_find_reference(), ipa_remove_reference(), cgraph_edge::lto_stmt_uid, symtab_node_base::order, cgraph_node::symbol, and symtab_node_name().
Referenced by propagate_controlled_uses(), and try_make_edge_direct_simple_call().
|
static |
Return true if STMT can modify a virtual method table pointer. This function makes special assumptions about both constructors and destructors which are all the functions that are allowed to alter the VMT pointers. It assumes that destructors begin with assignment into all VMT pointers and that constructors essentially look in the following way: 1) The very first thing they do is that they call constructors of ancestor sub-objects that have them. 2) Then VMT pointers of this and all its ancestors is set to new values corresponding to the type corresponding to the constructor. 3) Only afterwards, other stuff such as constructor of member sub-objects and the code written by the user is run. Only this may include calling virtual functions, directly or indirectly. There is no way to call a constructor of an ancestor sub-object in any other way. This means that we do not have to care whether constructors get the correct type information because they will always change it (in fact, if we define the type to be given by the VMT pointer, it is undefined). The most important fact to derive from the above is that if, for some statement in the section 3, we try to detect whether the dynamic type has changed, we can safely ignore all calls as we examine the function body backwards until we reach statements in section 2 because these calls cannot be ancestor constructors or destructors (if the input is not bogus) and so do not change the dynamic type (this holds true only for automatically allocated objects but at the moment we devirtualize only these). We then must detect that statements in section 2 change the dynamic type and can try to derive the new type. That is enough and we can stop, we will never see the calls into constructors of sub-objects in this code. Therefore we can safely ignore all call statements that we traverse.
References gimple_assign_lhs(), is_gimple_assign(), and is_gimple_call().
Referenced by check_stmt_for_type_change().
|
staticread |
Try to find a destination for indirect edge IE that corresponds to a simple call or a call of a member function pointer and where the destination is a pointer formal parameter described by jump function JFUNC. If it can be determined, return the newly direct edge, otherwise return NULL. NEW_ROOT_INFO is the node info that JFUNC lattices are relative to.
References ipa_jump_func::agg, cgraph_indirect_call_info::agg_contents, cgraph_indirect_call_info::by_ref, cgraph_edge::callee, ipa_cst_ref_desc::cs, cgraph_edge::indirect_info, ipa_find_agg_cst_for_param(), IPA_JF_CONST, ipa_make_edge_direct_to_target(), ipa_value_from_jfunc(), jfunc_rdesc_usable(), cgraph_indirect_call_info::offset, ipa_cst_ref_desc::refcount, remove_described_reference(), cgraph_edge::speculative, and ipa_jump_func::type.
Referenced by update_indirect_edges_after_inlining().
|
staticread |
Try to find a destination for indirect edge IE that corresponds to a virtual call based on a formal parameter which is described by jump function JFUNC and if it can be determined, make it direct and return the direct edge. Otherwise, return NULL. NEW_ROOT_INFO is the node info that JFUNC lattices are relative to.
References get_binfo_at_offset(), gimple_extract_devirt_binfo_from_cst(), gimple_get_virt_method_for_binfo(), cgraph_edge::indirect_info, ipa_make_edge_direct_to_target(), ipa_value_from_jfunc(), cgraph_indirect_call_info::offset, cgraph_indirect_call_info::otr_token, and cgraph_indirect_call_info::otr_type.
Referenced by update_indirect_edges_after_inlining().
|
static |
Inspect the given TYPE and return true iff it has the same structure (the same number of fields of the same types) as a C++ member pointer. If METHOD_PTR and DELTA are non-NULL, store the trees representing the corresponding fields there.
References host_integerp().
Referenced by ipa_get_stmt_member_ptr_load_param().
|
static |
Update the param called notes associated with NODE when CS is being inlined, assuming NODE is (potentially indirectly) inlined into CS->callee. Moreover, if the callee is discovered to be constant, create a new cgraph edge for it. 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_indirect_call_info::agg_contents, cgraph_edge::call_stmt, cgraph_edge::call_stmt_cannot_inline_p, cgraph_edge::callee, cgraph_edge::caller, symtab_node_base::decl, gimple_check_call_matching_types(), cgraph_node::global, cgraph_node::indirect_calls, cgraph_edge::indirect_info, cgraph_edge::indirect_inlining_edge, cgraph_global_info::inlined_to, ipa_check_create_edge_args(), ipa_get_cs_argument_count(), ipa_get_ith_jump_func(), ipa_get_jf_ancestor_agg_preserved(), ipa_get_jf_ancestor_formal_id(), ipa_get_jf_ancestor_offset(), ipa_get_jf_pass_through_agg_preserved(), ipa_get_jf_pass_through_formal_id(), ipa_get_jf_pass_through_operation(), IPA_JF_ANCESTOR, IPA_JF_PASS_THROUGH, cgraph_edge::next_callee, cgraph_indirect_call_info::offset, cgraph_indirect_call_info::param_index, cgraph_indirect_call_info::polymorphic, cgraph_node::symbol, try_make_edge_direct_simple_call(), try_make_edge_direct_virtual_call(), and ipa_jump_func::type.
Referenced by propagate_info_to_inlined_callees().
|
static |
Update the jump functions associated with call graph edge E when the call graph edge CS is being inlined, assuming that E->caller is already (possibly indirectly) inlined into CS->callee and that E has not been inlined.
References ipa_jump_func::agg, ipa_pass_through_data::agg_preserved, ipa_ancestor_jf_data::agg_preserved, ipa_jump_func::jump_func_value::ancestor, ipa_agg_jump_function::by_ref, combine_known_type_and_ancestor_jfs(), count, ipa_pass_through_data::formal_id, ipa_ancestor_jf_data::formal_id, ipa_get_cs_argument_count(), ipa_get_ith_jump_func(), IPA_JF_ANCESTOR, IPA_JF_KNOWN_TYPE, IPA_JF_PASS_THROUGH, IPA_JF_UNKNOWN, ipa_agg_jump_function::items, ipa_ancestor_jf_data::offset, ipa_agg_jf_item::offset, ipa_pass_through_data::operation, ipa_jump_func::jump_func_value::pass_through, ipa_jump_func::type, ipa_jump_func::value, and vec_safe_copy().
Referenced by propagate_info_to_inlined_callees().
Callback of walk_stmt_load_store_addr_ops for the visit_load. If OP is a parameter declaration, mark it as used in the info structure passed in DATA.
References get_base_address(), ipa_get_param_decl_index(), and ipa_set_param_used().
Referenced by ipa_analyze_params_uses().
void write_agg_replacement_chain | ( | ) |
References bitpack_create(), bp_pack_value(), ipa_agg_replacement_value::by_ref, count, output_block::decl_state, ipa_agg_replacement_value::index, ipa_get_agg_replacements_for_node(), lto_symtab_encoder_encode(), output_block::main_stream, ipa_agg_replacement_value::next, ipa_agg_replacement_value::offset, streamer_write_bitpack(), streamer_write_uhwi(), lto_out_decl_state::symtab_node_encoder, and ipa_agg_replacement_value::value.
Referenced by ipa_prop_write_all_agg_replacement().
|
static |
|
static |
Holders of ipa cgraph hooks:
|
static |
vec<ipa_edge_args_t, va_gc>* ipa_edge_args_vector |
Vector where the parameter infos are actually stored.
vec<ipa_agg_replacement_value_p, va_gc>* ipa_node_agg_replacements |
Vector of known aggregate values in cloned nodes.
vec<ipa_node_params_t> ipa_node_params_vector |
Vector where the parameter infos are actually stored.
Referenced by create_specialized_node(), early_inliner(), estimate_function_body_sizes(), evaluate_properties_for_edge(), inline_merge_summary(), inline_node_duplication_hook(), ipa_check_create_node_params(), and remap_edge_change_prob().
|
static |
Allocation pool for reference descriptions.
|
static |
|
static |