GCC Middle and Back End API Reference
|
Data Structures | |
struct | agg_position_info |
struct | record_modified_bb_info |
struct | growth_data |
Typedefs | |
typedef struct predicate | predicate_t |
Enumerations | |
enum | predicate_conditions { predicate_false_condition = 0, predicate_not_inlined_condition = 1, predicate_first_dynamic_condition = 2 } |
Variables | |
static struct cgraph_node_hook_list * | function_insertion_hook_holder |
static struct cgraph_node_hook_list * | node_removal_hook_holder |
static struct cgraph_2node_hook_list * | node_duplication_hook_holder |
static struct cgraph_2edge_hook_list * | edge_duplication_hook_holder |
static struct cgraph_edge_hook_list * | edge_removal_hook_holder |
vec< inline_summary_t, va_gc > * | inline_summary_vec |
vec< inline_edge_summary_t > | inline_edge_summary_vec |
vec< int > | node_growth_cache |
vec< edge_growth_cache_entry > | edge_growth_cache |
static alloc_pool | edge_predicate_pool |
typedef struct predicate predicate_t |
We keep info about constantness of SSA names.
enum predicate_conditions |
|
static |
Record SIZE and TIME under condition PRED into the inline summary.
References predicate::clause, inline_summary::conds, dump_file, dump_flags, dump_predicate(), inline_summary::entry, false_predicate_p(), size_time_entry::predicate, predicates_equal_p(), size_time_entry::size, size_time_entry::time, vec_safe_iterate(), and vec_safe_push().
Referenced by compute_inline_parameters(), estimate_function_body_sizes(), inline_merge_summary(), and inline_node_duplication_hook().
|
inlinestatic |
Add clause CLAUSE into the predicate P.
References predicate::clause, false_predicate_p(), i2, invert_tree_comparison(), condition::operand_num, predicate_false_condition, predicate_first_dynamic_condition, and condition::val.
Referenced by and_predicates(), or_predicates(), and remap_predicate_after_duplication().
|
staticread |
Add condition to condition list CONDS. AGGPOS describes whether the used oprand is loaded from an aggregate and where in the aggregate it is. It can be NULL, which means this not a load from an aggregate.
References condition::agg_contents, agg_position_info::agg_contents, condition::by_ref, agg_position_info::by_ref, HOST_WIDE_INT, condition::offset, agg_position_info::offset, offset, condition::operand_num, predicate_first_dynamic_condition, single_cond_predicate(), true_predicate(), condition::val, vec_safe_iterate(), and vec_safe_push().
Referenced by remap_predicate(), set_cond_stmt_execution_predicate(), set_switch_stmt_execution_predicate(), will_be_nonconstant_expr_predicate(), and will_be_nonconstant_predicate().
|
static |
Called when new function is inserted to callgraph late.
References inline_analyze_function().
Referenced by inline_generate_summary(), and inline_read_summary().
|
staticread |
Return P & P2.
References add_clause(), predicate::clause, false_predicate_p(), and true_predicate_p().
Referenced by compute_bb_predicates(), estimate_function_body_sizes(), remap_hint_predicate(), remap_predicate(), and set_switch_stmt_execution_predicate().
|
staticread |
Return predicate specifying when array index in access OP becomes non-constant.
References false_predicate(), handled_component_p(), and or_predicates().
Referenced by estimate_function_body_sizes().
|
static |
For each BB in NODE attach to its AUX pointer predicate under which it is executable.
References and_predicates(), edge_def::aux, basic_block_def::aux, inline_summary::conds, symtab_node_base::decl, false_predicate(), false_predicate_p(), or_predicates(), pool_alloc(), predicates_equal_p(), basic_block_def::preds, set_cond_stmt_execution_predicate(), set_switch_stmt_execution_predicate(), edge_def::src, cgraph_node::symbol, true_predicate(), and true_predicate_p().
Referenced by estimate_function_body_sizes().
void compute_inline_parameters | ( | ) |
Compute parameters of functions used by inliner. EARLY is true when we compute parameters for the early inliner
References account_size_time(), BUILT_IN_NORMAL, cgraph_edge::call_stmt_cannot_inline_p, inline_edge_summary::call_stmt_size, inline_edge_summary::call_stmt_time, cgraph_edge::callee, cgraph_node::callees, cgraph_local_info::can_change_signature, symtab_node_base::decl, estimate_function_body_sizes(), inline_summary::estimated_self_stack_size, estimated_stack_frame_size(), inline_summary::estimated_stack_size, cgraph_node::global, HOST_WIDE_INT, inline_summary::inlinable, inline_edge_summary(), inline_summary(), inline_summary_alloc(), inline_update_overall_summary(), cgraph_global_info::inlined_to, cgraph_node::local, cgraph_edge::next_callee, pop_cfun(), push_cfun(), reset_inline_summary(), inline_summary::self_size, inline_summary::self_time, inline_summary::size, inline_summary::stack_frame_offset, cgraph_node::symbol, cgraph_node::thunk, cgraph_thunk_info::thunk_p, inline_summary::time, tree_inlinable_function_p(), and true_predicate().
Referenced by cgraph_process_new_functions(), compute_inline_parameters_for_current(), convert_callers_for_node(), inline_analyze_function(), and split_function().
|
static |
Compute parameters of functions used by inliner using current_function_decl.
References cgraph_get_node(), compute_inline_parameters(), and current_function_decl.
DEBUG_FUNCTION void debug_inline_summary | ( | ) |
References dump_inline_summary().
inline_hints do_estimate_edge_hints | ( | ) |
Estimate the growth of the caller when inlining EDGE. Only to be called via estimate_edge_size.
References cgraph_edge::callee, cgraph_function_or_thunk_node(), do_estimate_edge_time(), estimate_node_size_and_time(), evaluate_properties_for_edge(), cgraph_edge::inline_failed, simple_edge_hints(), cgraph_edge::uid, and vNULL.
Referenced by estimate_edge_hints().
int do_estimate_edge_size | ( | ) |
Return estimated callee growth after inlining EDGE. Only to be called via estimate_edge_size.
References cgraph_edge::callee, cgraph_function_or_thunk_node(), do_estimate_edge_time(), estimate_node_size_and_time(), evaluate_properties_for_edge(), cgraph_edge::inline_failed, cgraph_edge::uid, and vNULL.
Referenced by estimate_edge_size().
int do_estimate_edge_time | ( | ) |
Estimate the time cost for the caller when inlining EDGE. Only to be called via estimate_edge_time, that handles the caching mechanism. When caching, also update the cache entry. Compute both time and size, since we always need both metrics eventually.
References cgraph_edge::callee, cgraph_edge_max_uid, cgraph_function_or_thunk_node(), estimate_node_size_and_time(), evaluate_properties_for_edge(), inline_edge_summary(), cgraph_edge::inline_failed, inline_edge_summary::param, simple_edge_hints(), and cgraph_edge::uid.
Referenced by do_estimate_edge_hints(), do_estimate_edge_size(), and estimate_edge_time().
int do_estimate_growth | ( | ) |
Estimate the growth caused by inlining NODE into all callees.
References cgraph_can_remove_if_no_direct_calls_p(), cgraph_for_node_and_aliases(), cgraph_max_uid, cgraph_will_be_removed_from_program_if_no_direct_calls(), symtab_node_base::decl, do_estimate_growth_1(), growth_data::growth, inline_summary(), growth_data::self_recursive, inline_summary::size, cgraph_node::symbol, and cgraph_node::uid.
Referenced by estimate_growth().
|
static |
Worker for do_estimate_growth. Collect growth for all callers.
References cgraph_edge::caller, cgraph_node::callers, estimate_edge_growth(), cgraph_node::global, growth_data::growth, cgraph_edge::inline_failed, cgraph_global_info::inlined_to, cgraph_edge::next_caller, and growth_data::self_recursive.
Referenced by do_estimate_growth().
|
static |
|
static |
Dump conditional COND.
References condition::agg_contents, condition::by_ref, HOST_WIDE_INT_PRINT_DEC, condition::offset, op_symbol_code(), condition::operand_num, predicate_false_condition, predicate_first_dynamic_condition, predicate_not_inlined_condition, print_generic_expr(), and condition::val.
Referenced by dump_clause(), and estimate_node_size_and_time().
|
static |
Dump edge summaries associated to NODE and recursively to all clones. Indent by INDENT.
References inline_edge_summary::call_stmt_size, inline_edge_summary::call_stmt_time, cgraph_edge::callee, cgraph_node::callees, cgraph_function_or_thunk_node(), cgraph_inline_failed_string(), cgraph_node_name(), inline_summary::conds, dump_predicate(), cgraph_edge::frequency, cgraph_node::indirect_calls, inline_edge_summary(), cgraph_edge::inline_failed, inline_edge_summary::loop_depth, cgraph_edge::next_callee, symtab_node_base::order, inline_edge_summary::param, inline_edge_summary::predicate, prob, and cgraph_node::symbol.
Referenced by dump_inline_summary().
void dump_inline_hints | ( | ) |
Dump inline hints.
References INLINE_HINT_array_index, INLINE_HINT_cross_module, INLINE_HINT_declared_inline, INLINE_HINT_in_scc, INLINE_HINT_indirect_call, INLINE_HINT_loop_iterations, INLINE_HINT_loop_stride, and INLINE_HINT_same_scc.
Referenced by edge_badness().
void dump_inline_summaries | ( | ) |
References dump_inline_summary(), cgraph_node::global, and cgraph_global_info::inlined_to.
Referenced by ipa_inline().
void dump_inline_summary | ( | ) |
References inline_summary::array_index, cgraph_node_name(), inline_summary::conds, symtab_node_base::decl, symtab_node_base::definition, dump_inline_edge_summary(), dump_predicate(), inline_summary::entry, inline_summary::estimated_self_stack_size, inline_summary::estimated_stack_size, inline_summary::growth, inline_summary::inlinable, inline_summary(), inline_summary::loop_iterations, inline_summary::loop_stride, symtab_node_base::order, size_time_entry::predicate, inline_summary::scc_no, inline_summary::self_size, inline_summary::self_time, size_time_entry::size, inline_summary::size, cgraph_node::symbol, size_time_entry::time, inline_summary::time, and vec_safe_iterate().
Referenced by debug_inline_summary(), dump_inline_summaries(), and estimate_function_body_sizes().
|
static |
Dump predicate PREDICATE.
References predicate::clause, dump_clause(), and true_predicate_p().
Referenced by account_size_time(), dump_inline_edge_summary(), dump_inline_summary(), estimate_function_body_sizes(), and predicate_for_phi_result().
|
static |
Set predicate for edge E.
References inline_edge_summary(), pool_alloc(), pool_free(), inline_edge_summary::predicate, and true_predicate_p().
Referenced by estimate_function_body_sizes(), inline_edge_duplication_hook(), inline_merge_summary(), inline_node_duplication_hook(), read_inline_edge_summary(), and remap_edge_summaries().
|
static |
See if statement might disappear after inlining. 0 - means not eliminated 1 - half of statements goes away 2 - for sure it is eliminated. We are not terribly sophisticated, basically looking for simple abstraction penalty wrappers.
References get_base_address(), gimple_assign_lhs(), gimple_assign_rhs1(), gimple_assign_rhs_class(), gimple_assign_rhs_code(), gimple_num_ops(), GIMPLE_SINGLE_RHS, is_gimple_min_invariant(), is_gimple_reg(), and unmodified_parm().
Referenced by estimate_function_body_sizes().
|
static |
Increase SIZE and TIME for size and time needed to handle all calls in NODE. POSSIBLE_TRUTHS, KNOWN_VALS and KNOWN_BINFOS describe context of the call site.
References cgraph_edge::callee, cgraph_node::callees, estimate_edge_size_and_time(), evaluate_predicate(), cgraph_node::indirect_calls, inline_edge_summary(), cgraph_edge::inline_failed, cgraph_edge::next_callee, and inline_edge_summary::predicate.
Referenced by inline_update_overall_summary().
|
static |
Estimate benefit devirtualizing indirect edge IE, provided KNOWN_VALS and KNOWN_BINFOS.
References eni_weights_d::call_cost, cgraph_get_node(), symtab_node_base::definition, eni_size_weights, eni_time_weights, eni_weights_d::indirect_call_cost, inline_summary::inlinable, inline_summary(), ipa_get_indirect_edge_target(), and cgraph_node::symbol.
Referenced by estimate_edge_size_and_time().
|
inlinestatic |
Increase SIZE and TIME for size and time needed to handle edge E.
References apply_probability(), inline_edge_summary::call_stmt_size, inline_edge_summary::call_stmt_time, cgraph_edge::callee, cgraph_maybe_hot_edge_p(), estimate_edge_devirt_benefit(), cgraph_edge::frequency, inline_edge_summary(), and INLINE_HINT_indirect_call.
Referenced by estimate_calls_size_and_time().
|
static |
Compute function body size parameters for NODE. When EARLY is true, we compute only simple summaries without non-trivial predicates to drive the early inliner.
References account_size_time(), and_predicates(), array_index_predicate(), edge_def::aux, basic_block_def::aux, bb_loop_depth(), calculate_dominance_info(), inline_edge_summary::call_stmt_size, inline_edge_summary::call_stmt_time, CDI_DOMINATORS, function::cfg, cfun, cgraph_edge(), cgraph_node_name(), compute_bb_predicates(), compute_call_stmt_bb_frequency(), inline_summary::conds, count, symtab_node_base::decl, dump_file, dump_flags, dump_inline_summary(), dump_predicate(), edge_set_predicate(), eliminated_by_inlining_prob(), eni_size_weights, eni_time_weights, inline_summary::entry, estimate_num_insns(), loop::exits, false_predicate(), false_predicate_p(), flow_loops_dump(), free(), free_dominance_info(), get_loop_body(), get_loop_exit_edges(), gimple_assign_load_p(), gimple_assign_rhs1(), gimple_call_builtin_p(), gimple_call_lhs(), gimple_call_num_args(), gimple_get_lhs(), gimple_store_p(), gsi_end_p(), gsi_next(), gsi_start_bb(), gsi_start_phis(), gsi_stmt(), loop::header, basic_block_def::index, inline_edge_summary(), inline_summary(), ipa_node_params_vector, is_gimple_call(), is_gimple_min_invariant(), loop_containing_stmt(), inline_edge_summary::loop_depth, loop_optimizer_finalize(), loop_optimizer_init(), LOOPS_HAVE_RECORDED_EXITS, tree_niter_desc::niter, not_inlined_predicate(), loop::num_nodes, number_of_iterations_exit(), order, inline_edge_summary::param, param_change_prob(), phi_result_unknown_predicate(), pool_free(), pre_and_rev_post_order_compute(), predicate_for_phi_result(), print_gimple_stmt(), prob, scev_finalize(), scev_initialize(), inline_summary::self_size, inline_summary::self_time, set_hint_predicate(), simple_iv(), affine_iv::step, basic_block_def::succs, cgraph_node::symbol, true_predicate(), true_predicate_p(), vNULL, will_be_nonconstant_expr_predicate(), and will_be_nonconstant_predicate().
Referenced by compute_inline_parameters().
void estimate_ipcp_clone_size_and_time | ( | struct cgraph_node * | node, |
vec< tree > | known_vals, | ||
vec< tree > | known_binfos, | ||
vec< ipa_agg_jump_function_p > | known_aggs, | ||
int * | ret_size, | ||
int * | ret_time, | ||
inline_hints * | hints | ||
) |
Estimate size and time needed to execute callee of EDGE assuming that parameters known to be constant at caller of EDGE are propagated. KNOWN_VALS and KNOWN_BINFOS are vectors of assumed known constant values and types for parameters.
References estimate_node_size_and_time(), evaluate_conditions_for_known_args(), and vNULL.
Referenced by estimate_local_effects().
|
static |
Estimate size and time needed to execute NODE assuming POSSIBLE_TRUTHS clause, and KNOWN_VALS and KNOWN_BINFOS information about NODE's arguments.
References apply_probability(), cgraph_node_name(), inline_summary::conds, dump_condition(), dump_file, dump_flags, inline_summary::entry, evaluate_predicate(), inline_summary(), symtab_node_base::order, size_time_entry::predicate, predicate_first_dynamic_condition, predicate_not_inlined_condition, predicate_probability(), prob, size_time_entry::size, inline_summary::size, cgraph_node::symbol, size_time_entry::time, inline_summary::time, vec_safe_iterate(), and vec_safe_length().
Referenced by do_estimate_edge_hints(), do_estimate_edge_size(), do_estimate_edge_time(), and estimate_ipcp_clone_size_and_time().
int estimate_size_after_inlining | ( | struct cgraph_node * | node, |
struct cgraph_edge * | edge | ||
) |
Estimate the size of NODE after inlining EDGE which should be an edge to either NODE or a call inlined into NODE.
References estimate_edge_growth(), false_predicate_p(), inline_edge_summary(), inline_summary(), inline_edge_summary::predicate, and inline_summary::size.
Referenced by caller_growth_limits(), and recursive_inlining().
int estimate_time_after_inlining | ( | struct cgraph_node * | node, |
struct cgraph_edge * | edge | ||
) |
Estimate self time of the function NODE after inlining EDGE.
References estimate_edge_time(), false_predicate_p(), inline_edge_summary(), inline_summary(), inline_edge_summary::predicate, and inline_summary::time.
|
static |
KNOWN_VALS is partial mapping of parameters of NODE to constant values. KNOWN_AGGS is a vector of aggreggate jump functions for each parameter. Return clause of possible truths. When INLINE_P is true, assume that we are inlining. ERROR_MARK means compile time invariant.
References condition::agg_contents, condition::by_ref, predicate::clause, inline_summary::conds, fold_binary_to_constant(), inline_summary(), integer_zerop(), ipa_find_agg_cst_for_param(), condition::offset, condition::operand_num, predicate_first_dynamic_condition, predicate_not_inlined_condition, condition::val, and vec_safe_iterate().
Referenced by estimate_ipcp_clone_size_and_time(), evaluate_properties_for_edge(), and inline_node_duplication_hook().
|
static |
Having partial truth assignment in POSSIBLE_TRUTHS, return false if predicate P is known to be false.
References predicate::clause, predicate_false_condition, and true_predicate_p().
Referenced by estimate_calls_size_and_time(), and estimate_node_size_and_time().
|
static |
Work out what conditions might be true at invocation of E.
References ipa_jump_func::agg, cgraph_edge::call_stmt_cannot_inline_p, cgraph_edge::callee, cgraph_edge::caller, cgraph_function_or_thunk_node(), inline_summary::conds, count, evaluate_conditions_for_known_args(), cgraph_node::global, inline_edge_summary(), inline_summary(), cgraph_global_info::inlined_to, ipa_get_cs_argument_count(), ipa_get_ith_jump_func(), ipa_node_params_vector, ipa_value_from_jfunc(), inline_edge_summary::param, predicate_not_inlined_condition, and vNULL.
Referenced by do_estimate_edge_hints(), do_estimate_edge_size(), do_estimate_edge_time(), and inline_merge_summary().
|
staticread |
Return false predicate. First clause require false condition.
References predicate_false_condition, and single_cond_predicate().
Referenced by array_index_predicate(), compute_bb_predicates(), estimate_function_body_sizes(), phi_result_unknown_predicate(), remap_predicate(), remap_predicate_after_duplication(), set_switch_stmt_execution_predicate(), will_be_nonconstant_expr_predicate(), and will_be_nonconstant_predicate().
|
inlinestatic |
Return true if P is (false).
References predicate::clause, and predicate_false_condition.
Referenced by account_size_time(), add_clause(), and_predicates(), compute_bb_predicates(), estimate_function_body_sizes(), estimate_size_after_inlining(), estimate_time_after_inlining(), inline_merge_summary(), inline_node_duplication_hook(), or_predicates(), predicate_probability(), remap_edge_summaries(), remap_hint_predicate(), and set_hint_predicate().
void free_growth_caches | ( | void | ) |
Free growth caches.
Referenced by inline_small_functions().
void initialize_growth_caches | ( | void | ) |
Initialize growth caches.
References cgraph_edge_max_uid, and cgraph_max_uid.
Referenced by inline_small_functions().
void initialize_inline_failed | ( | ) |
Give initial reasons why inlining would fail on EDGE. This gets either nullified or usually overwritten by more precise reasons later.
References cgraph_edge::call_stmt_cannot_inline_p, cgraph_edge::callee, symtab_node_base::definition, cgraph_edge::indirect_unknown_callee, cgraph_edge::inline_failed, cgraph_node::local, cgraph_local_info::redefined_extern_inline, and cgraph_node::symbol.
Referenced by cgraph_create_edge(), cgraph_create_indirect_edge(), cgraph_make_edge_direct(), and cgraph_turn_edge_to_speculative().
|
static |
Note function body size.
References cgraph_node_name(), compute_inline_parameters(), symtab_node_base::decl, dump_file, inline_indirect_intraprocedural_analysis(), symtab_node_base::order, pop_cfun(), push_cfun(), cgraph_node::symbol, cgraph_node::thunk, and cgraph_thunk_info::thunk_p.
Referenced by add_new_function(), and inline_generate_summary().
|
static |
Hook that is called by cgraph.c when a node is duplicated.
References edge_set_predicate(), inline_edge_summary(), inline_summary_alloc(), memcpy(), inline_edge_summary::param, and inline_edge_summary::predicate.
Referenced by inline_summary_alloc().
|
static |
Keep edge cache consistent across edge removal.
References reset_edge_growth_cache(), and reset_inline_edge_summary().
Referenced by inline_summary_alloc().
void inline_free_summary | ( | void | ) |
Release inline summary.
References cgraph_remove_edge_duplication_hook(), cgraph_remove_edge_removal_hook(), cgraph_remove_function_insertion_hook(), cgraph_remove_node_duplication_hook(), cgraph_remove_node_removal_hook(), free_alloc_pool(), reset_inline_summary(), and vec_free().
Referenced by free_inline_summary(), inline_generate_summary(), and ipa_inline().
void inline_generate_summary | ( | void | ) |
Note function body size.
References add_new_function(), symtab_node_base::alias, cgraph_add_function_insertion_hook(), inline_analyze_function(), inline_free_summary(), ipa_register_cgraph_hooks(), and cgraph_node::symbol.
|
static |
This function performs intraprocedural analysis in NODE that is required to inline indirect calls.
References dump_file, dump_flags, ipa_analyze_node(), ipa_print_node_jump_functions(), and ipa_print_node_params().
Referenced by inline_analyze_function().
void inline_merge_summary | ( | ) |
We inlined EDGE. Update summary of the function we inlined into.
References account_size_time(), apply_probability(), inline_summary::array_index, cgraph_edge::callee, cgraph_edge::caller, inline_summary::conds, count, dump_file, dump_flags, edge_set_predicate(), inline_summary::entry, evaluate_properties_for_edge(), false_predicate_p(), cgraph_edge::frequency, cgraph_node::global, HOST_WIDE_INT, inline_edge_summary(), inline_summary(), inline_update_callee_summaries(), cgraph_global_info::inlined_to, 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_get_param_count(), IPA_JF_ANCESTOR, IPA_JF_PASS_THROUGH, ipa_node_params_vector, loop_depth(), inline_summary::loop_iterations, inline_summary::loop_stride, map, offset, inline_edge_summary::param, size_time_entry::predicate, inline_edge_summary::predicate, predicate_probability(), prob, remap_edge_summaries(), remap_hint_predicate(), remap_predicate(), size_time_entry::size, size_time_entry::time, true_predicate(), ipa_jump_func::type, vec_safe_iterate(), and vNULL.
Referenced by inline_call().
|
static |
Hook that is called by cgraph.c when a node is duplicated.
References account_size_time(), inline_summary::array_index, inline_edge_summary::call_stmt_size, cgraph_node::callees, cgraph_node::clone, inline_summary::conds, count, edge_set_predicate(), inline_summary::entry, evaluate_conditions_for_known_args(), false_predicate_p(), cgraph_edge::frequency, cgraph_node::indirect_calls, inline_edge_summary(), cgraph_edge::inline_failed, inline_summary(), inline_summary_alloc(), inline_update_overall_summary(), ipa_get_param(), ipa_get_param_count(), ipa_node_params_vector, ipa_node_params::known_vals, inline_summary::loop_iterations, inline_summary::loop_stride, memcpy(), ipa_replace_map::new_tree, cgraph_edge::next_callee, ipa_replace_map::old_tree, ipa_replace_map::parm_num, size_time_entry::predicate, inline_edge_summary::predicate, ipa_replace_map::ref_p, remap_hint_predicate_after_duplication(), remap_predicate_after_duplication(), ipa_replace_map::replace_p, set_hint_predicate(), size_time_entry::size, size_time_entry::time, cgraph_clone_info::tree_map, true_predicate(), vec_safe_copy(), vec_safe_iterate(), and vNULL.
Referenced by inline_summary_alloc().
|
static |
Hook that is called by cgraph.c when a node is removed.
References inline_summary(), memset(), reset_inline_summary(), cgraph_node::uid, and vec_safe_length().
Referenced by inline_summary_alloc().
|
static |
Stream in inline summaries from the section.
References condition::agg_contents, inline_summary::array_index, bp_unpack_value(), condition::by_ref, cgraph_node::callees, lto_function_header::cfg_size, cgraph(), inline_summary::conds, inline_summary::entry, inline_summary::estimated_self_stack_size, inline_summary::estimated_stack_size, cgraph_node::indirect_calls, inline_summary::inlinable, inline_summary(), inline_summary::loop_iterations, inline_summary::loop_stride, lto_data_in_create(), lto_data_in_delete(), lto_free_section_data(), LTO_section_inline_summary, lto_symtab_encoder_deref(), lto_function_header::main_size, cgraph_edge::next_callee, condition::offset, condition::operand_num, size_time_entry::predicate, read_inline_edge_summary(), read_predicate(), inline_summary::self_size, inline_summary::self_time, set_hint_predicate(), size_time_entry::size, inline_summary::size, streamer_read_bitpack(), streamer_read_uhwi(), lto_function_header::string_size, lto_file_decl_data::symtab_node_encoder, size_time_entry::time, inline_summary::time, condition::val, vec_safe_push(), and vNULL.
Referenced by inline_read_summary().
void inline_read_summary | ( | void | ) |
Read inline summary. Jump functions are shared among ipa-cp and inliner, so when ipa-cp is active, we don't need to write them twice.
References add_new_function(), cgraph_add_function_insertion_hook(), fatal_error(), inline_read_section(), inline_summary_alloc(), ipa_prop_read_jump_functions(), ipa_register_cgraph_hooks(), len, lto_get_file_decl_data(), lto_get_section_data(), and LTO_section_inline_summary.
|
static |
Allocate the inline summary vector or resize it to cover all cgraph nodes.
References cgraph_add_edge_duplication_hook(), cgraph_add_edge_removal_hook(), cgraph_add_node_duplication_hook(), cgraph_add_node_removal_hook(), cgraph_edge_max_uid, cgraph_max_uid, create_alloc_pool(), inline_edge_duplication_hook(), inline_edge_removal_hook(), inline_node_duplication_hook(), inline_node_removal_hook(), vec_safe_grow_cleared(), and vec_safe_length().
Referenced by compute_inline_parameters(), inline_edge_duplication_hook(), inline_node_duplication_hook(), and inline_read_summary().
|
static |
Update summary information of inline clones after inlining. Compute peak stack usage.
References cgraph_edge::callee, cgraph_node::callees, cgraph_edge::caller, cgraph_node::callers, cgraph_propagate_frequency(), inline_summary::estimated_self_stack_size, inline_summary::estimated_stack_size, cgraph_node::global, HOST_WIDE_INT, cgraph_node::indirect_calls, inline_edge_summary(), cgraph_edge::inline_failed, inline_summary(), cgraph_global_info::inlined_to, inline_edge_summary::loop_depth, cgraph_edge::next_callee, and inline_summary::stack_frame_offset.
Referenced by inline_merge_summary().
void inline_update_overall_summary | ( | ) |
For performance reasons inline_merge_summary is not updating overall size and time. Recompute it.
References inline_summary::entry, estimate_calls_size_and_time(), inline_summary(), predicate_false_condition, size_time_entry::size, inline_summary::size, size_time_entry::time, inline_summary::time, vec_safe_iterate(), and vNULL.
Referenced by compute_inline_parameters(), flatten_function(), inline_always_inline_functions(), inline_call(), inline_node_duplication_hook(), inline_small_functions(), ipa_inline(), ipa_profile(), ipcp_discover_new_direct_edges(), and resolve_noninline_speculation().
void inline_write_summary | ( | void | ) |
Write inline summary for node in SET. Jump functions are shared among ipa-cp and inliner, so when ipa-cp is active, we don't need to write them twice.
References condition::agg_contents, symtab_node_base::alias, inline_summary::array_index, bitpack_create(), bp_pack_value(), condition::by_ref, inline_summary::conds, count, create_output_block(), output_block::decl_state, symtab_node_base::definition, destroy_output_block(), dyn_cast(), inline_summary::entry, inline_summary::estimated_self_stack_size, inline_summary::inlinable, inline_summary(), ipa_prop_write_jump_functions(), inline_summary::loop_iterations, inline_summary::loop_stride, LTO_section_inline_summary, lto_symtab_encoder_deref(), lto_symtab_encoder_encode(), lto_symtab_encoder_size(), output_block::main_stream, cgraph_edge::next_callee, condition::offset, condition::operand_num, size_time_entry::predicate, produce_asm(), inline_summary::self_size, inline_summary::self_time, size_time_entry::size, streamer_write_bitpack(), streamer_write_char_stream(), streamer_write_hwi(), streamer_write_uhwi(), cgraph_node::symbol, lto_out_decl_state::symtab_node_encoder, size_time_entry::time, condition::val, vec_safe_iterate(), vec_safe_length(), write_inline_edge_summary(), and write_predicate().
gimple_opt_pass* make_pass_inline_parameters | ( | ) |
Callback of walk_aliased_vdefs. Flags that it has been invoked to the boolean variable pointed to by DATA.
Referenced by unmodified_parm_1().
|
staticread |
Return predicate that is set true when function is not inlined.
References predicate_not_inlined_condition, and single_cond_predicate().
Referenced by estimate_function_body_sizes().
|
staticread |
Return P | P2.
References add_clause(), predicate::clause, false_predicate_p(), predicates_equal_p(), true_predicate(), and true_predicate_p().
Referenced by array_index_predicate(), compute_bb_predicates(), predicate_for_phi_result(), remap_predicate(), set_switch_stmt_execution_predicate(), will_be_nonconstant_expr_predicate(), and will_be_nonconstant_predicate().
|
static |
Return probability (based on REG_BR_PROB_BASE) that I-th parameter of STMT will change since last invocation of STMT. Value 0 is reserved for compile time invariants. For common parameters it is REG_BR_PROB_BASE. For loop invariants it ought to be REG_BR_PROB_BASE / estimated_iters.
References ao_ref_init(), record_modified_bb_info::bb_set, bitmap_bit_p(), ctor_for_folding(), frequency, basic_block_def::frequency, get_base_address(), gimple_bb(), gimple_call_arg(), gimple_vuse(), basic_block_def::index, is_gimple_min_invariant(), record_modified(), record_modified_bb_info::stmt, and walk_aliased_vdefs().
Referenced by estimate_function_body_sizes().
|
static |
Find whether a basic block BB is the final block of a (half) diamond CFG sub-graph and if the predicate the condition depends on is known. If so, return true and store the pointer the predicate in *P.
References false_predicate(), gimple_cond_lhs(), gimple_cond_rhs(), is_gimple_ip_invariant(), last_stmt(), basic_block_def::preds, single_pred(), single_pred_p(), single_succ_p(), edge_def::src, record_modified_bb_info::stmt, true_predicate_p(), and will_be_nonconstant_expr_predicate().
Referenced by estimate_function_body_sizes().
|
static |
Given a PHI statement in a function described by inline properties SUMMARY and *P being the predicate describing whether the selected PHI argument is known, store a predicate for the result of the PHI statement into NONCONSTANT_NAMES, if possible.
References inline_summary::conds, phi_arg_d::def, dump_file, dump_flags, dump_predicate(), gimple_phi_arg(), gimple_phi_num_args(), gimple_phi_result(), is_gimple_min_invariant(), or_predicates(), and true_predicate_p().
Referenced by estimate_function_body_sizes().
|
static |
Return the probability in range 0...REG_BR_PROB_BASE that the predicated instruction will be recomputed per invocation of the inlined call.
References predicate::clause, false_predicate_p(), i2, condition::operand_num, predicate_false_condition, predicate_first_dynamic_condition, and true_predicate_p().
Referenced by estimate_node_size_and_time(), and inline_merge_summary().
|
inlinestatic |
Return true if predicates are obviously equal.
References predicate::clause.
Referenced by account_size_time(), compute_bb_predicates(), and or_predicates().
|
static |
Write inline summary for edge E to OB.
References inline_edge_summary::call_stmt_size, inline_edge_summary::call_stmt_time, edge_set_predicate(), inline_edge_summary(), inline_edge_summary::loop_depth, inline_edge_summary::param, read_predicate(), and streamer_read_uhwi().
Referenced by inline_read_section().
|
staticread |
Read predicate from IB.
References predicate::clause, and streamer_read_uhwi().
Referenced by inline_read_section(), and read_inline_edge_summary().
|
static |
Callback of walk_aliased_vdefs. Records basic blocks where the value may be set except for info->stmt.
References record_modified_bb_info::bb_set, bitmap_set_bit(), and record_modified_bb_info::stmt.
Referenced by param_change_prob().
|
static |
Update change_prob of EDGE after INLINED_EDGE has been inlined. When functoin A is inlined in B and A calls C with parameter that changes with probability PROB1 and C is known to be passthroug of argument if B that change with probability PROB2, the probability of change is now PROB1*PROB2.
References combine_probabilities(), inline_edge_summary(), ipa_get_cs_argument_count(), ipa_get_ith_jump_func(), ipa_get_jf_pass_through_formal_id(), IPA_JF_PASS_THROUGH, ipa_node_params_vector, inline_edge_summary::param, prob, and ipa_jump_func::type.
Referenced by remap_edge_summaries().
|
static |
Update edge summaries of NODE after INLINED_EDGE has been inlined. Remap predicates of callees of NODE. Rest of arguments match remap_predicate. Also update change probabilities.
References cgraph_edge::callee, cgraph_node::callees, cgraph_edge::count, edge_set_predicate(), false_predicate_p(), cgraph_edge::frequency, cgraph_node::indirect_calls, inline_edge_summary(), cgraph_edge::inline_failed, cgraph_edge::next_callee, inline_edge_summary::predicate, remap_edge_change_prob(), and remap_predicate().
Referenced by inline_merge_summary().
|
static |
Same as remap_predicate, but set result into hint *HINT.
References and_predicates(), inline_summary::conds, false_predicate_p(), remap_predicate(), set_hint_predicate(), and true_predicate_p().
Referenced by inline_merge_summary().
|
static |
Same as remap_predicate_after_duplication but handle hint predicate *P. Additionally care about allocating new memory slot for updated predicate and set it to NULL when it becomes true or false (and thus uninteresting).
References remap_predicate_after_duplication(), and set_hint_predicate().
Referenced by inline_node_duplication_hook().
|
staticread |
Translate all conditions from callee representation into caller representation and symbolically evaluate predicate P into new predicate. INFO is inline_summary of function we are adding predicate into, CALLEE_INFO is summary of function predicate P is from. OPERAND_MAP is array giving callee formal IDs the caller formal IDs. POSSSIBLE_TRUTHS is clausule of all callee conditions that may be true in caller context. TOPLEV_PREDICATE is predicate under which callee is executed. OFFSET_MAP is an array of of offsets that need to be added to conditions, negative offset means that conditions relying on values passed by reference have to be discarded because they might not be preserved (and should be considered offset zero for other purposes).
References add_condition(), condition::agg_contents, agg_position_info::agg_contents, and_predicates(), condition::by_ref, agg_position_info::by_ref, predicate::clause, inline_summary::conds, false_predicate(), HOST_WIDE_INT, condition::offset, agg_position_info::offset, condition::operand_num, or_predicates(), predicate_first_dynamic_condition, true_predicate(), true_predicate_p(), and condition::val.
Referenced by inline_merge_summary(), remap_edge_summaries(), and remap_hint_predicate().
|
staticread |
Remap predicate P of former function to be predicate of duplicated functoin. POSSIBLE_TRUTHS is clause of possible truths in the duplicated node, INFO is inline summary of the duplicated node.
References add_clause(), predicate::clause, false_predicate(), and true_predicate().
Referenced by inline_node_duplication_hook(), and remap_hint_predicate_after_duplication().
|
static |
We are called multiple time for given function; clear data from previous run so they are not cumulated.
References inline_edge_summary::call_stmt_size, inline_edge_summary::call_stmt_time, inline_edge_summary(), inline_edge_summary::param, pool_free(), inline_edge_summary::predicate, and cgraph_edge::uid.
Referenced by inline_edge_removal_hook(), and reset_inline_summary().
|
static |
We are called multiple time for given function; clear data from previous run so they are not cumulated.
References inline_summary::array_index, cgraph_node::callees, inline_summary::conds, inline_summary::entry, inline_summary::estimated_self_stack_size, inline_summary::estimated_stack_size, inline_summary::growth, cgraph_node::indirect_calls, inline_summary(), inline_summary::loop_iterations, inline_summary::loop_stride, cgraph_edge::next_callee, pool_free(), reset_inline_edge_summary(), inline_summary::scc_no, inline_summary::self_size, inline_summary::self_time, inline_summary::size, inline_summary::stack_frame_offset, inline_summary::time, and vec_free().
Referenced by compute_inline_parameters(), inline_free_summary(), and inline_node_removal_hook().
|
static |
If BB ends by a conditional we can turn into predicates, attach corresponding predicates to the CFG edges.
References add_condition(), edge_def::aux, edge_def::flags, gimple_call_arg(), gimple_call_builtin_p(), gimple_call_num_args(), gimple_cond_code(), gimple_cond_lhs(), gimple_cond_rhs(), integer_zerop(), invert_tree_comparison(), is_gimple_ip_invariant(), last, last_stmt(), pool_alloc(), basic_block_def::succs, and unmodified_parm_or_parm_agg_item().
Referenced by compute_bb_predicates().
|
static |
Set predicate for hint *P.
References false_predicate_p(), pool_alloc(), pool_free(), and true_predicate_p().
Referenced by estimate_function_body_sizes(), inline_node_duplication_hook(), inline_read_section(), remap_hint_predicate(), and remap_hint_predicate_after_duplication().
|
static |
If BB ends by a switch we can turn into predicates, attach corresponding predicates to the CFG edges.
References add_condition(), and_predicates(), inline_summary::conds, false_predicate(), find_edge(), gimple_switch_index(), gimple_switch_label(), gimple_switch_num_labels(), last, last_stmt(), or_predicates(), pool_alloc(), basic_block_def::succs, true_predicate(), and unmodified_parm_or_parm_agg_item().
Referenced by compute_bb_predicates().
int simple_edge_hints | ( | ) |
Return hints derrived from EDGE.
References cgraph_edge::callee, cgraph_edge::caller, cgraph_edge_recursive_p(), cgraph_node::global, INLINE_HINT_cross_module, INLINE_HINT_same_scc, inline_summary(), cgraph_global_info::inlined_to, symtab_node_base::lto_file_data, inline_summary::scc_no, and cgraph_node::symbol.
Referenced by do_estimate_edge_hints(), and do_estimate_edge_time().
|
staticread |
Return predicate testing single condition number COND.
References predicate::clause.
Referenced by add_condition(), false_predicate(), and not_inlined_predicate().
|
staticread |
Return true predicate (tautology). We represent it by empty list of clauses.
References predicate::clause.
Referenced by add_condition(), compute_bb_predicates(), compute_inline_parameters(), estimate_function_body_sizes(), inline_merge_summary(), inline_node_duplication_hook(), or_predicates(), remap_predicate(), remap_predicate_after_duplication(), set_switch_stmt_execution_predicate(), and will_be_nonconstant_predicate().
|
inlinestatic |
Return true if P is (false).
References predicate::clause.
Referenced by and_predicates(), compute_bb_predicates(), dump_predicate(), edge_set_predicate(), estimate_function_body_sizes(), evaluate_predicate(), or_predicates(), phi_result_unknown_predicate(), predicate_for_phi_result(), predicate_probability(), remap_hint_predicate(), remap_predicate(), set_hint_predicate(), will_be_nonconstant_expr_predicate(), and will_be_nonconstant_predicate().
|
static |
If OP refers to value of function parameter, return the corresponding parameter. Also traverse chains of SSA register assignments.
References gimple_assign_rhs1(), gimple_assign_single_p(), and unmodified_parm_1().
Referenced by eliminated_by_inlining_prob(), will_be_nonconstant_expr_predicate(), and will_be_nonconstant_predicate().
|
static |
If OP refers to value of function parameter, return the corresponding parameter.
References ao_ref_init(), gimple_vuse(), mark_modified(), and walk_aliased_vdefs().
Referenced by unmodified_parm(), and unmodified_parm_or_parm_agg_item().
|
static |
If OP refers to a value of a function parameter or value loaded from an aggregate passed to a parameter (either by value or reference), return TRUE and store the number of the parameter to *INDEX_P and information whether and how it has been loaded from an aggregate into *AGGPOS. INFO describes the function parameters, STMT is the statement in which OP is used or loaded.
References agg_position_info::agg_contents, agg_position_info::by_ref, gimple_assign_rhs1(), gimple_assign_single_p(), ipa_get_param_decl_index(), ipa_load_from_parm_agg(), agg_position_info::offset, and unmodified_parm_1().
Referenced by set_cond_stmt_execution_predicate(), set_switch_stmt_execution_predicate(), and will_be_nonconstant_predicate().
|
staticread |
Return predicate specifying when the STMT might have result that is not a compile time constant.
References add_condition(), inline_summary::conds, debug_tree(), false_predicate(), ipa_get_param_decl_index(), is_gimple_min_invariant(), or_predicates(), true_predicate_p(), and unmodified_parm().
Referenced by estimate_function_body_sizes(), and phi_result_unknown_predicate().
|
staticread |
Return predicate specifying when the STMT might have result that is not a compile time constant.
References add_condition(), inline_summary::conds, false_predicate(), gimple_assign_lhs(), gimple_assign_load_p(), gimple_assign_rhs1(), gimple_assign_single_p(), gimple_store_p(), ipa_get_param_decl_index(), or_predicates(), true_predicate(), true_predicate_p(), unmodified_parm(), and unmodified_parm_or_parm_agg_item().
Referenced by estimate_function_body_sizes().
|
static |
Write inline summary for edge E to OB.
References inline_edge_summary::call_stmt_size, inline_edge_summary::call_stmt_time, inline_edge_summary(), inline_edge_summary::loop_depth, inline_edge_summary::param, inline_edge_summary::predicate, streamer_write_uhwi(), and write_predicate().
Referenced by inline_write_summary().
|
static |
Write predicate P to OB.
References predicate::clause, and streamer_write_uhwi().
Referenced by inline_write_summary(), and write_inline_edge_summary().
|
static |
Referenced by ipcp_driver().
vec<edge_growth_cache_entry> edge_growth_cache |
Referenced by estimate_edge_hints(), estimate_edge_size(), estimate_edge_time(), and reset_edge_growth_cache().
|
static |
Edge predicates goes here.
|
static |
Referenced by inline_small_functions().
|
static |
Holders of ipa cgraph hooks:
vec<inline_edge_summary_t> inline_edge_summary_vec |
vec<inline_summary_t, va_gc>* inline_summary_vec |
VECtor holding inline summaries. In GGC memory because conditions might point to constant trees.
Referenced by cgraph_process_new_functions().
|
static |
vec<int> node_growth_cache |
Cached node/edge growths.
Referenced by estimate_growth(), and reset_node_growth_cache().
|
static |
Referenced by possible_polymorphic_call_targets().