GCC Middle and Back End API Reference
|
#include "config.h"
#include "system.h"
#include "coretypes.h"
#include "backend.h"
#include "target.h"
#include "tree.h"
#include "gimple.h"
#include "alloc-pool.h"
#include "tree-pass.h"
#include "ssa.h"
#include "tree-streamer.h"
#include "cgraph.h"
#include "diagnostic.h"
#include "fold-const.h"
#include "print-tree.h"
#include "tree-inline.h"
#include "gimple-pretty-print.h"
#include "cfganal.h"
#include "gimple-iterator.h"
#include "tree-cfg.h"
#include "tree-ssa-loop-niter.h"
#include "tree-ssa-loop.h"
#include "symbol-summary.h"
#include "sreal.h"
#include "ipa-cp.h"
#include "ipa-prop.h"
#include "ipa-fnsummary.h"
#include "cfgloop.h"
#include "tree-scalar-evolution.h"
#include "ipa-utils.h"
#include "cfgexpand.h"
#include "gimplify.h"
#include "stringpool.h"
#include "attribs.h"
#include "tree-into-ssa.h"
#include "symtab-clones.h"
#include "gimple-range.h"
#include "tree-dfa.h"
Data Structures | |
struct | record_modified_bb_info |
Macros | |
#define | INCLUDE_MEMORY |
#define | INCLUDE_VECTOR |
Variables | |
fast_function_summary< ipa_fn_summary *, va_gc > * | ipa_fn_summaries |
fast_function_summary< ipa_size_summary *, va_heap > * | ipa_size_summaries |
fast_call_summary< ipa_call_summary *, va_heap > * | ipa_call_summaries |
static object_allocator< ipa_predicate > | edge_predicate_pool ("edge predicates") |
#define INCLUDE_MEMORY |
Function summary pass. Copyright (C) 2003-2024 Free Software Foundation, Inc. Contributed by Jan Hubicka This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GCC; see the file COPYING3. If not see <http://www.gnu.org/licenses/>.
Analysis of function bodies used by inter-procedural passes We estimate for each function - function body size and size after specializing into given context - average function execution time in a given context - function frame size For each call - call statement size, time and how often the parameters change ipa_fn_summary data structures store above information locally (i.e. parameters of the function itself) and globally (i.e. parameters of the function created by applying all the inline decisions already present in the callgraph). We provide access to the ipa_fn_summary data structure and basic logic updating the parameters when inlining is performed. The summaries are context sensitive. Context means 1) partial assignment of known constant values of operands 2) whether function is inlined into the call or not. It is easy to add more variants. To represent function size and time that depends on context (i.e. it is known to be optimized away when context is known either by inlining or from IP-CP and cloning), we use predicates. estimate_edge_size_and_time can be used to query function size/time in the given context. ipa_merge_fn_summary_after_inlining merges properties of caller and callee after inlining. Finally pass_inline_parameters is exported. This is used to drive computation of function parameters used by the early inliner. IPA inlined performs analysis via its analyze_function method.
#define INCLUDE_VECTOR |
|
static |
Record to SUMMARY that PARM is used by builtin_constant_p.
References ipa_fn_summary::builtin_constant_p_parms, and i.
Referenced by ipa_merge_fn_summary_after_inlining(), and set_cond_stmt_execution_predicate().
|
static |
Find if NEW_PREDICATE is already in V and if so, increment its freq. Otherwise add a new item to the vector with this predicate and frerq equal to add_freq, unless the number of predicates would exceed MAX_NUM_PREDICATES in which case the function does nothing.
References ipa_freqcounting_predicate::freq, i, NULL, ipa_freqcounting_predicate::predicate, set_hint_predicate(), vec_safe_iterate(), vec_safe_length(), and vec_safe_push().
Referenced by analyze_function_body().
|
static |
Analyze function body for NODE. EARLY indicates run from early optimization pipeline.
References ipa_func_body_info::aa_walk_budget, ipa_fn_summary::account_size_time(), add_condition(), add_freqcounting_predicate(), basic_block_def::aux, BASIC_BLOCK_FOR_FN, ipa_func_body_info::bb_infos, bb_loop_depth(), bb_predicate(), calculate_dominance_info(), ipa_call_summary::call_stmt_size, ipa_call_summary::call_stmt_time, CDI_DOMINATORS, CDI_POST_DOMINATORS, function::cfg, cfun, clobber_only_eh_bb_p(), compute_bb_predicates(), basic_block_def::count, count, count_formal_params(), symtab_node::decl, DECL_STRUCT_FUNCTION, dump_file, dump_flags, symtab_node::dump_name(), edge_predicate_pool, edge_set_predicate(), eliminated_by_inlining_prob(), eni_size_weights, eni_time_weights, ENTRY_BLOCK_PTR_FOR_FN, estimate_num_insns(), find_foldable_builtin_expect(), flow_loops_dump(), FOR_ALL_BB_FN, FOR_EACH_EDGE, FOR_EACH_VEC_ELT, fp_expression_p(), ipa_fn_summary::fp_expressions, free(), free_dominance_info(), gcc_assert, cgraph_node::get_edge(), get_loop_body(), get_loop_exit_edges(), gimple_assign_lhs(), gimple_call_arg(), gimple_call_builtin_p(), gimple_call_internal_p(), gimple_call_lhs(), gimple_call_num_args(), gimple_num_ops(), gimple_op(), gsi_end_p(), gsi_next(), gsi_next_nondebug(), gsi_start_bb(), gsi_start_nondebug_bb(), gsi_start_phis(), gsi_stmt(), handled_component_p(), loop::header, i, basic_block_def::index, ipa_func_body_info::info, ipa_call_summaries, ipa_check_create_node_params(), ipa_dump_fn_summary(), ipa_edge_args_sum, ipa_fn_summaries, ipa_free_all_node_params(), ipa_initialize_node_params(), ipa_node_params_sum, ipa_release_body_info(), ipa_size_summaries, is_gimple_assign(), is_gimple_call(), is_gimple_min_invariant(), last_basic_block_for_fn, load_or_store_of_ptr_parameter(), loop_containing_stmt(), ipa_call_summary::loop_depth, ipa_fn_summary::loop_iterations, loop_optimizer_finalize(), loop_optimizer_init(), loop_preheader_edge(), ipa_fn_summary::loop_strides, loops_for_fn(), LOOPS_HAVE_RECORDED_EXITS, LOOPS_NORMAL, n_basic_blocks_for_fn, loop::next, cgraph_edge::next_speculative_call_target(), niter_desc::niter, ipa_func_body_info::node, ipa_predicate::not_inlined(), ipa_predicate::not_sra_candidate, NULL, loop::num_nodes, number_of_iterations_exit(), opt_for_fn, ipa_call_summary::param, param_change_prob(), ipa_func_body_info::param_count, phi_result_unknown_predicate(), points_to_local_or_readonly_memory_p(), points_to_possible_sra_candidate_p(), pre_and_rev_post_order_compute(), predicate_for_phi_result(), print_gimple_stmt(), ptr_type_node, REG_BR_PROB_BASE, scev_finalize(), scev_initialize(), simple_iv(), ipa_fn_summary::size_scale, cgraph_edge::speculative_call_indirect_edge(), ss, SSA_NAME_VERSION, SSANAMES, iv::step, basic_block_def::succs, ipa_fn_summary::target_info, targetm, TDF_DETAILS, ipa_fn_summary::time, sreal::to_double(), profile_count::to_sreal_scale(), TREE_CODE, TREE_OPERAND, vec_free(), vNULL, will_be_nonconstant_expr_predicate(), and will_be_nonconstant_predicate().
Referenced by compute_fn_summary().
|
static |
Return true when the basic blocks contains only clobbers followed by RESX. Such BBs are kept around to make removal of dead stores possible with presence of EH and will be optimized out by optimize_clobbers later in the game. NEED_EH is used to recurse in case the clobber has non-EH predecessors that can be clobber only, too.. When it is false, the RESX is not necessary on the end of basic block.
References clobber_only_eh_bb_p(), FOR_EACH_EDGE, gimple_clobber_p(), gsi_end_p(), gsi_last_bb(), gsi_prev(), gsi_stmt(), is_gimple_debug(), basic_block_def::preds, single_succ_p(), and record_modified_bb_info::stmt.
Referenced by analyze_function_body(), and clobber_only_eh_bb_p().
|
static |
For each BB in NODE attach to its AUX pointer predicate under which it is executable.
References basic_block_def::aux, CDI_POST_DOMINATORS, ipa_fn_summary::conds, symtab_node::decl, DECL_STRUCT_FUNCTION, edge_predicate_pool, ENTRY_BLOCK_PTR_FOR_FN, EXIT_BLOCK_PTR_FOR_FN, FOR_EACH_BB_FN, FOR_EACH_EDGE, get_immediate_dominator(), ipa_predicate::or_with(), basic_block_def::preds, set_cond_stmt_execution_predicate(), and set_switch_stmt_execution_predicate().
Referenced by analyze_function_body().
void compute_fn_summary | ( | struct cgraph_node * | node, |
bool | early ) |
Compute function summary. EARLY is true when we compute parameters during early opts.
References ipa_fn_summary::account_size_time(), analyze_function_body(), eni_weights::call_cost, ipa_call_summary::call_stmt_size, ipa_call_summary::call_stmt_time, cgraph_edge::callee, cgraph_node::callees, cgraph_node::can_change_signature, symtab_node::decl, DECL_ARGUMENTS, DECL_ATTRIBUTES, DECL_CHAIN, DECL_STRUCT_FUNCTION, dump_file, eni_size_weights, eni_time_weights, ipa_size_summary::estimated_self_stack_size, estimated_stack_frame_size(), ipa_fn_summary::estimated_stack_size, fndecl_built_in_p(), gcc_assert, get_attribute_name(), IDENTIFIER_POINTER, cgraph_node::indirect_calls, ipa_fn_summary::inlinable, cgraph_edge::inline_failed, cgraph_node::inlined_to, ipa_call_summaries, ipa_fn_summaries, ipa_fn_summary_alloc(), ipa_size_summaries, ipa_update_overall_fn_summary(), lookup_attribute(), cgraph_edge::next_callee, ipa_predicate::not_inlined(), opt_for_fn, pop_cfun(), push_cfun(), ipa_size_summary::self_size, ipa_size_summary::size, ipa_fn_summary::size_scale, cgraph_edge::speculative, stdarg_p(), cgraph_node::thunk, TODO_update_ssa_only_virtuals, TREE_CHAIN, tree_inlinable_function_p(), TREE_TYPE, ipa_param_adjustments::type_attribute_allowed_p(), TYPE_ATTRIBUTES, update_ssa(), and variably_modified_type_p().
Referenced by autofdo::afdo_vpt_for_early_inline(), autofdo::auto_profile(), compute_fn_summary_for_current(), autofdo::early_inline(), inline_always_inline_functions(), inline_analyze_function(), ipa_merge_profiles(), symbol_table::process_new_functions(), and split_function().
|
static |
Compute parameters of functions used by inliner using current_function_decl.
References compute_fn_summary(), current_function_decl, and cgraph_node::get().
|
static |
Analyze EXPR if it represents a series of simple operations performed on a function parameter and return true if so. FBI, STMT, EXPR, INDEX_P and AGGPOS have the same meaning like in unmodified_parm_or_parm_agg_item. Type of the parameter or load from an aggregate via the parameter is stored in *TYPE_P. Operations on the parameter are recorded to PARAM_OPS_P if it is not NULL.
References agg_position_info::agg_contents, expr_eval_op::code, contains_bitfld_component_ref_p(), symtab_node::decl, dyn_cast(), ERF_RETURN_ARG_MASK, ERF_RETURNS_ARG, gcc_assert, gimple_assign_lhs(), gimple_assign_rhs1(), gimple_assign_rhs_class(), gimple_assign_rhs_code(), GIMPLE_BINARY_RHS, gimple_call_arg(), gimple_call_num_args(), gimple_call_return_flags(), gimple_op(), GIMPLE_SINGLE_RHS, GIMPLE_TERNARY_RHS, GIMPLE_UNARY_RHS, i, expr_eval_op::index, is_gimple_assign(), is_gimple_ip_invariant(), ipa_func_body_info::node, NULL, NULL_TREE, opt_for_fn, SSA_NAME_DEF_STMT, SSA_NAME_IS_DEFAULT_DEF, TREE_CODE, TREE_TYPE, expr_eval_op::type, type(), TYPE_P, unmodified_parm_or_parm_agg_item(), expr_eval_op::val, vec_free(), and vec_safe_insert().
Referenced by set_cond_stmt_execution_predicate(), set_switch_stmt_execution_predicate(), and will_be_nonconstant_predicate().
|
static |
Dump edge summaries associated to NODE and recursively to all clones. Indent by INDENT.
References ipa_call_summary::call_stmt_size, ipa_call_summary::call_stmt_time, cgraph_node::callees, cgraph_inline_failed_string(), ipa_fn_summary::conds, cross_module_call_p(), ipa_predicate::dump(), dump_ipa_call_summary(), symtab_node::dump_name(), ipa_fn_summary::estimated_stack_size, i, cgraph_node::indirect_calls, ipa_call_summaries, ipa_fn_summaries, ipa_get_stack_frame_offset(), ipa_size_summaries, ipa_call_summary::loop_depth, cgraph_edge::next_callee, NULL, ipa_call_summary::param, ipa_call_summary::predicate, REG_BR_PROB_BASE, ipa_fn_summary::size_scale, ss, and cgraph_node::ultimate_alias_target().
Referenced by dump_ipa_call_summary(), and ipa_dump_fn_summary().
|
static |
Set predicate for edge E.
References cgraph_edge::callee, edge_predicate_pool, ipa_call_summaries, NULL, ipa_call_summary::predicate, redirect_to_unreachable(), and cgraph_edge::speculative.
Referenced by analyze_function_body(), ipa_call_summary_t::duplicate(), ipa_fn_summary_t::duplicate(), read_ipa_call_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 CONVERT_EXPR_CODE_P, 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(), NULL, SSA_NAME_VAR, TREE_CODE, TREE_OPERAND, and unmodified_parm().
Referenced by analyze_function_body().
|
static |
Increase SIZE, MIN_SIZE and TIME for size and time needed to handle all calls in NODE. POSSIBLE_TRUTHS and AVALS (the latter if non-NULL) describe context of the call site.
References ipa_fn_summary::account_size_time(), ipa_fn_summary::call_size_time_table, cgraph_node::callees, dump_file, estimate_calls_size_and_time_1(), ipa_predicate::evaluate(), size_time_entry::exec_predicate, gcc_assert, i, cgraph_node::indirect_calls, cgraph_edge::inline_failed, ipa_fn_summaries, ipa_get_param_count(), ipa_is_param_used_by_indirect_call(), ipa_is_param_used_by_polymorphic_call(), ipa_node_params_sum, ipa_call_arg_values::m_known_aggs, ipa_call_arg_values::m_known_contexts, ipa_call_arg_values::m_known_vals, ipa_fn_summary::max_size_time_table_size, ipa_fn_summary::min_size, cgraph_edge::next_callee, NULL, ipa_call_arg_values::safe_sval_at(), size_time_entry::size, summarize_calls_size_and_time(), ipa_fn_summary::time, size_time_entry::time, and sreal::to_double().
Referenced by ipa_call_context::estimate_size_and_time(), and ipa_update_overall_fn_summary().
|
static |
Increase SIZE, MIN_SIZE and TIME for size and time needed to handle all calls in NODE. POSSIBLE_TRUTHS and AVALS describe the context of the call site. Helper for estimate_calls_size_and_time which does the same but (in most cases) faster.
References ipa_call_summary::call_stmt_size, ipa_call_summary::call_stmt_time, cgraph_edge::callee, cgraph_node::callees, estimate_calls_size_and_time_1(), estimate_edge_size_and_time(), ipa_predicate::evaluate(), gcc_checking_assert, cgraph_node::indirect_calls, cgraph_edge::inline_failed, ipa_call_summaries, cgraph_edge::next_callee, NULL, and ipa_call_summary::predicate.
Referenced by estimate_calls_size_and_time(), and estimate_calls_size_and_time_1().
|
static |
Estimate benefit devirtualizing indirect edge IE and return true if it can be devirtualized and inlined, provided m_known_vals, m_known_contexts and m_known_aggs in AVALS. Return false straight away if AVALS is NULL.
References AVAIL_AVAILABLE, eni_weights::call_cost, cgraph_edge::caller, symtab_node::decl, symtab_node::definition, eni_size_weights, eni_time_weights, cgraph_node::function_symbol(), gcc_checking_assert, cgraph_node::get(), eni_weights::indirect_call_cost, ipa_fn_summary::inlinable, ipa_fn_summaries, ipa_get_indirect_edge_target(), ipa_call_arg_values::m_known_contexts, ipa_call_arg_values::m_known_vals, NULL, opt_for_fn, and ipa_fn_summary::time.
Referenced by estimate_edge_size_and_time().
|
inlinestatic |
Increase SIZE, MIN_SIZE (if non-NULL) and TIME for size and time needed to handle edge E with probability PROB. Set HINTS accordingly if edge may be devirtualized. AVALS, if non-NULL, describes the context of the call site as far as values of parameters are concerened.
References ipa_call_summary::call_stmt_size, ipa_call_summary::call_stmt_time, cgraph_edge::callee, estimate_edge_devirt_benefit(), INLINE_HINT_indirect_call, ipa_call_summaries, cgraph_edge::maybe_hot_p(), ipa_fn_summary::size_scale, and cgraph_edge::sreal_frequency().
Referenced by estimate_calls_size_and_time_1(), ipa_merge_fn_summary_after_inlining(), and summarize_calls_size_and_time().
void estimate_ipcp_clone_size_and_time | ( | struct cgraph_node * | node, |
ipa_auto_call_arg_values * | avals, | ||
ipa_call_estimates * | estimates ) |
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_CONTEXTS are vectors of assumed known constant values and types for parameters.
References ipa_call_context::estimate_size_and_time(), evaluate_conditions_for_known_args(), NULL, and vNULL.
Referenced by estimate_local_effects(), and perform_estimation_of_a_value().
|
static |
Compute what conditions may or may not hold given information about parameters. RET_CLAUSE returns truths that may hold in a specialized copy, while RET_NONSPEC_CLAUSE returns truths that may hold in an nonspecialized copy when called in a given context. It is a bitmask of conditions. Bit 0 means that condition is known to be false, while bit 1 means that condition may or may not be true. These differs - for example NOT_INLINED condition is always false in the second and also builtin_constant_p tests cannot use the fact that parameter is indeed a constant. When INLINE_P is true, assume that we are inlining. AVAL contains known information about argument values. The function does not modify its content and so AVALs could also be of type ipa_call_arg_values but so far all callers work with the auto version and so we avoid the conversion for convenience. ERROR_MARK value of an argument means compile time invariant.
References condition::agg_contents, boolean_type_node, condition::by_ref, ipa_predicate::changed, condition::code, expr_eval_op::code, ipa_fn_summary::conds, error_mark_node, ipa_predicate::first_dynamic_condition, fold_binary, fold_binary_to_constant(), range_op_handler::fold_range(), fold_ternary, fold_unary, ipa_argagg_value_list::get_value(), i, expr_eval_op::index, integer_onep(), integer_zerop(), ipa_find_agg_cst_from_init(), ipa_fn_summaries, ipa_range_set_and_normalize(), ipa_predicate::is_not_constant, ipa_auto_call_arg_values::m_known_value_ranges, ipa_predicate::not_inlined_condition, ipa_predicate::not_sra_candidate, NULL, NULL_TREE, condition::offset, condition::operand_num, ipa_call_summary::param, condition::param_ops, range_cast(), ipa_auto_call_arg_values::safe_sval_at(), irange::set_varying(), value_range::set_varying(), value_range::supports_type_p(), TREE_CODE, TREE_TYPE, condition::type, expr_eval_op::type, value_range::type(), TYPE_SIZE, value_range::undefined_p(), useless_type_conversion_p(), condition::val, expr_eval_op::val, value_range::varying_p(), vec_safe_iterate(), and irange::zero_p().
Referenced by ipa_fn_summary_t::duplicate(), estimate_ipcp_clone_size_and_time(), and evaluate_properties_for_edge().
void evaluate_properties_for_edge | ( | struct cgraph_edge * | e, |
bool | inline_p, | ||
clause_t * | clause_ptr, | ||
clause_t * | nonspec_clause_ptr, | ||
ipa_auto_call_arg_values * | avals, | ||
bool | compute_contexts ) |
Work out what conditions might be true at invocation of E. Compute costs for inlined edge if INLINE_P is true. Return in CLAUSE_PTR the evaluated conditions and in NONSPEC_CLAUSE_PTR (if non-NULL) conditions evaluated for nonspecialized clone called in a given context. Vectors in AVALS will be populated with useful known information about argument values - information not known to have any uses will be omitted - except for m_known_contexts which will only be calculated if COMPUTE_CONTEXTS is true.
References ipa_jump_func::agg, cgraph_edge::call_stmt, cgraph_edge::call_stmt_cannot_inline_p, cgraph_edge::callee, cgraph_edge::caller, ipa_fn_summary::conds, count, error_mark_node, evaluate_conditions_for_known_args(), fre_will_run_p(), gcc_assert, gcc_checking_assert, gimple_call_arg(), gimple_call_num_args(), i, cgraph_node::inlined_to, ipa_call_summaries, ipa_context_from_jfunc(), ipa_edge_args_sum, ipa_fn_summaries, ipa_get_cs_argument_count(), ipa_get_ith_jump_func(), ipa_get_param_count(), ipa_get_type(), ipa_is_param_used_by_indirect_call(), ipa_is_param_used_by_ipa_predicates(), ipa_is_param_used_by_polymorphic_call(), ipa_node_params_sum, ipa_push_agg_values_from_jfunc(), ipa_value_from_jfunc(), ipa_value_range_from_jfunc(), is_gimple_min_invariant(), ipa_auto_call_arg_values::m_known_aggs, ipa_auto_call_arg_values::m_known_contexts, ipa_auto_call_arg_values::m_known_vals, ipa_auto_call_arg_values::m_known_value_ranges, MIN, ipa_predicate::not_inlined_condition, NULL, ipa_call_summary::param, cgraph_node::thunk, TREE_CODE, cgraph_node::ultimate_alias_target(), value_range::undefined_p(), ipa_polymorphic_call_context::useless_p(), value_range::varying_p(), void_type_node, and vrp_will_run_p().
Referenced by do_estimate_edge_hints(), do_estimate_edge_size(), do_estimate_edge_time(), and ipa_merge_fn_summary_after_inlining().
|
static |
For a typical usage of __builtin_expect (a<b, 1), we may introduce an extra relation stmt: With the builtin, we have t1 = a <= b; t2 = (long int) t1; t3 = __builtin_expect (t2, 1); if (t3 != 0) goto ... Without the builtin, we have if (a<=b) goto... This affects the size/time estimation and may have an impact on the earlier inlining. Here find this pattern and fix it up later.
References CASE_CONVERT, gcc_assert, gimple_assign_rhs1(), gimple_assign_rhs_code(), gimple_call_arg(), gimple_call_builtin_p(), gimple_call_internal_p(), gimple_call_lhs(), gsi_end_p(), gsi_next(), gsi_start_bb(), gsi_stmt(), is_gimple_assign(), NULL, single_imm_use(), SSA_NAME_DEF_STMT, record_modified_bb_info::stmt, and TREE_CODE.
Referenced by analyze_function_body().
Return true if STMT compute a floating point expression that may be affected by -ffast-math and similar flags.
References FLOAT_TYPE_P, FOR_EACH_SSA_TREE_OPERAND, i, record_modified_bb_info::op, SSA_OP_DEF, SSA_OP_USE, record_modified_bb_info::stmt, and TREE_TYPE.
Referenced by analyze_function_body().
|
static |
Similarly about FRE.
References symtab_node::decl, and opt_for_fn.
Referenced by evaluate_properties_for_edge().
|
static |
Value is initialized in INIT_BB and used in USE_BB. We want to compute probability how often it changes between USE_BB. INIT_BB->count/USE_BB->count is an estimate, but if INIT_BB is in different loop nest, we can do better. This is all just estimate. In theory we look for minimal cut separating INIT_BB and USE_BB, but we only want to anticipate loop invariant motion anyway.
References basic_block_def::count, find_common_loop(), loop::header, and basic_block_def::loop_father.
Referenced by param_change_prob(), and record_modified().
void inline_analyze_function | ( | struct cgraph_node * | node | ) |
Note function body size.
References cgraph_node::callees, compute_fn_summary(), symtab_node::decl, DECL_STRUCT_FUNCTION, dump_file, symtab_node::dump_name(), cgraph_node::indirect_calls, cgraph_edge::inline_failed, inline_indirect_intraprocedural_analysis(), cgraph_edge::next_callee, opt_for_fn, pop_cfun(), push_cfun(), and cgraph_node::thunk.
Referenced by cgraph_node::create_wrapper(), cgraph_node::expand_all_artificial_thunks(), ipa_fn_summary_t::insert(), and ipa_fn_summary_generate().
|
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(), ipa_print_node_params(), and TDF_DETAILS.
Referenced by inline_analyze_function().
|
static |
Stream in inline summaries from the section.
References condition::agg_contents, bp_unpack_value(), ipa_fn_summary::builtin_constant_p_parms, condition::by_ref, cgraph_node::callees, lto_function_header::cfg_size, condition::code, expr_eval_op::code, ipa_fn_summary::conds, dyn_cast(), ipa_size_summary::estimated_self_stack_size, ipa_fn_summary::estimated_stack_size, size_time_entry::exec_predicate, fatal_error(), data_in::file_data, ipa_fn_summary::fp_expressions, ipa_freqcounting_predicate::freq, gcc_assert, get_gimple_rhs_class(), GIMPLE_BINARY_RHS, GIMPLE_TERNARY_RHS, GIMPLE_UNARY_RHS, i, expr_eval_op::index, cgraph_node::indirect_calls, ipa_fn_summary::inlinable, ipa_fn_summaries, ipa_node_params_sum, ipa_set_param_used_by_ipa_predicates(), ipa_size_summaries, ipa_fn_summary::loop_iterations, ipa_fn_summary::loop_strides, lto_data_in_create(), lto_data_in_delete(), lto_free_section_data(), LTO_section_ipa_fn_summary, lto_stream_offload_p, lto_symtab_encoder_deref(), lto_simple_header::main_size, cgraph_edge::next_callee, size_time_entry::nonconst_predicate, NULL, NULL_TREE, condition::offset, condition::operand_num, condition::param_ops, ipa_freqcounting_predicate::predicate, symtab_node::prevailing_p(), read_ipa_call_summary(), ipa_size_summary::self_size, set_hint_predicate(), ipa_size_summary::size, size_time_entry::size, ipa_fn_summary::size_time_table, ipa_predicate::stream_in(), sreal::stream_in(), stream_read_tree, streamer_read_bitpack(), streamer_read_uhwi(), lto_simple_header_with_strings::string_size, lto_file_decl_data::symtab_node_encoder, ipa_fn_summary::target_info, ipa_fn_summary::time, size_time_entry::time, condition::type, expr_eval_op::type, UNKNOWN_LOCATION, condition::val, expr_eval_op::val, vec_safe_push(), vec_safe_reserve_exact(), and vNULL.
Referenced by ipa_fn_summary_read().
|
static |
Update summary information of inline clones after inlining. Compute peak stack usage.
References cgraph_edge::callee, cgraph_node::callees, cgraph_node::indirect_calls, cgraph_edge::inline_failed, inline_update_callee_summaries(), ipa_call_summaries, ipa_propagate_frequency(), and cgraph_edge::next_callee.
Referenced by inline_update_callee_summaries(), and ipa_merge_fn_summary_after_inlining().
DEBUG_FUNCTION void ipa_debug_fn_summary | ( | struct cgraph_node * | node | ) |
In ipa-fnsummary.cc
References ipa_dump_fn_summary().
void ipa_dump_fn_summaries | ( | FILE * | f | ) |
References FOR_EACH_DEFINED_FUNCTION, cgraph_node::inlined_to, and ipa_dump_fn_summary().
Referenced by ipa_inline().
void ipa_dump_fn_summary | ( | FILE * | f, |
struct cgraph_node * | node ) |
References ipa_fn_summary::builtin_constant_p_parms, ipa_fn_summary::conds, symtab_node::decl, DECL_DISREGARD_INLINE_LIMITS, symtab_node::definition, ipa_predicate::dump(), dump_ipa_call_summary(), symtab_node::dump_name(), ipa_fn_summary::estimated_stack_size, size_time_entry::exec_predicate, ipa_fn_summary::fp_expressions, ipa_freqcounting_predicate::freq, ipa_fn_summary::growth, i, ipa_fn_summary::inlinable, ipa_fn_summaries, ipa_size_summaries, ipa_fn_summary::loop_iterations, ipa_fn_summary::loop_strides, ipa_fn_summary::min_size, size_time_entry::nonconst_predicate, NULL, ipa_freqcounting_predicate::predicate, ipa_fn_summary::scc_no, size_time_entry::size, ipa_fn_summary::size_scale, ipa_fn_summary::size_time_table, ss, ipa_fn_summary::target_info, ipa_fn_summary::time, size_time_entry::time, sreal::to_double(), and vec_safe_iterate().
Referenced by analyze_function_body(), ipa_debug_fn_summary(), and ipa_dump_fn_summaries().
void ipa_dump_hints | ( | FILE * | f, |
ipa_hints | hints ) |
Dump IPA hints.
References gcc_assert, INLINE_HINT_builtin_constant_p, INLINE_HINT_cross_module, INLINE_HINT_declared_inline, INLINE_HINT_in_scc, INLINE_HINT_indirect_call, INLINE_HINT_known_hot, INLINE_HINT_loop_iterations, INLINE_HINT_loop_stride, and INLINE_HINT_same_scc.
Referenced by edge_badness().
|
static |
Allocate the function summary.
References ipa_fn_summary_t::create_ggc(), gcc_checking_assert, ipa_call_summaries, ipa_fn_summaries, ipa_size_summaries, and symtab.
Referenced by compute_fn_summary(), ipa_fn_summary_generate(), and ipa_fn_summary_read().
|
static |
Note function body size.
References symtab_node::alias, symtab_node::decl, DECL_STRUCT_FUNCTION, FOR_EACH_DEFINED_FUNCTION, inline_analyze_function(), ipa_fn_summaries, ipa_fn_summary_alloc(), ipa_register_cgraph_hooks(), opt_for_fn, tree_versionable_function_p(), and cgraph_node::versionable.
|
static |
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 fatal_error(), gcc_assert, inline_read_section(), input_location, ipa_fn_summaries, ipa_fn_summary_alloc(), ipa_prop_read_jump_functions(), ipa_register_cgraph_hooks(), lto_get_file_decl_data(), lto_get_summary_section_data(), and LTO_section_ipa_fn_summary.
|
static |
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::alias, bitpack_create(), bp_pack_value(), ipa_fn_summary::builtin_constant_p_parms, condition::by_ref, cgraph_node::callees, condition::code, expr_eval_op::code, ipa_fn_summary::conds, count, create_output_block(), output_block::decl_state, symtab_node::definition, destroy_output_block(), ipa_size_summary::estimated_self_stack_size, size_time_entry::exec_predicate, ipa_fn_summary::fp_expressions, ipa_freqcounting_predicate::freq, i, expr_eval_op::index, cgraph_node::indirect_calls, ipa_fn_summary::inlinable, ipa_fn_summaries, ipa_prop_write_jump_functions(), ipa_size_summaries, ipa_fn_summary::loop_iterations, ipa_fn_summary::loop_strides, lsei_cgraph_node(), lsei_end_p(), lsei_next_function_in_partition(), lsei_start_function_in_partition(), LTO_section_ipa_fn_summary, lto_stream_offload_p, lto_symtab_encoder_encode(), output_block::main_stream, cgraph_edge::next_callee, size_time_entry::nonconst_predicate, NULL, condition::offset, condition::operand_num, condition::param_ops, ipa_freqcounting_predicate::predicate, produce_asm(), ipa_size_summary::self_size, size_time_entry::size, ipa_fn_summary::size_time_table, ipa_predicate::stream_out(), sreal::stream_out(), stream_write_tree, streamer_write_bitpack(), streamer_write_char_stream(), streamer_write_hwi(), streamer_write_uhwi(), lto_out_decl_state::symtab_node_encoder, ipa_fn_summary::target_info, ipa_fn_summary::time, size_time_entry::time, condition::type, expr_eval_op::type, condition::val, expr_eval_op::val, vec_safe_iterate(), vec_safe_length(), and write_ipa_call_summary().
void ipa_fnsummary_cc_finalize | ( | void | ) |
Reset all state within ipa-fnsummary.cc so that we can rerun the compiler within the same process. For use by toplev::finalize.
References ipa_free_fn_summary(), and ipa_free_size_summary().
Referenced by toplev::finalize().
void ipa_free_fn_summary | ( | void | ) |
Release function summary.
References edge_predicate_pool, ggc_delete(), ggc_trim(), ipa_call_summaries, ipa_fn_summaries, and NULL.
Referenced by ipa_fnsummary_cc_finalize(), and symbol_table::process_new_functions().
void ipa_free_size_summary | ( | void | ) |
Release function summary.
References ipa_size_summaries, and NULL.
Referenced by ipa_fnsummary_cc_finalize(), and symbol_table::process_new_functions().
HOST_WIDE_INT ipa_get_stack_frame_offset | ( | struct cgraph_node * | node | ) |
Return stack frame offset where frame of NODE is supposed to start inside of the function it is inlined to. Return 0 for functions that are not inlined.
References cgraph_edge::caller, cgraph_node::callers, cgraph_node::inlined_to, ipa_size_summaries, and offset.
Referenced by caller_growth_limits(), dump_ipa_call_summary(), and ipa_merge_fn_summary_after_inlining().
void ipa_merge_fn_summary_after_inlining | ( | struct cgraph_edge * | edge | ) |
We inlined EDGE. Update summary of the function we inlined into.
References ipa_fn_summary::account_size_time(), add_builtin_constant_p_parm(), ipa_fn_summary::builtin_constant_p_parms, ipa_fn_summary::call_size_time_table, ipa_fn_summary::conds, count, dump_file, dump_flags, estimate_edge_size_and_time(), ipa_fn_summary::estimated_stack_size, evaluate_properties_for_edge(), size_time_entry::exec_predicate, ipa_fn_summary::fp_expressions, gcc_assert, i, inline_update_callee_summaries(), INT_MAX, ipa_call_summaries, ipa_edge_args_sum, ipa_fn_summaries, 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_get_stack_frame_offset(), IPA_JF_ANCESTOR, IPA_JF_PASS_THROUGH, ipa_node_params_sum, ipa_remove_from_growth_caches(), ipa_call_summary::loop_depth, ipa_fn_summary::loop_iterations, ipa_fn_summary::loop_strides, map, size_time_entry::nonconst_predicate, NULL, offset, ipa_call_summary::param, ipa_call_summary::predicate, ipa_predicate::probability(), REG_BR_PROB_BASE, ipa_predicate::remap_after_inlining(), remap_edge_summaries(), remap_freqcounting_predicate(), size_time_entry::size, ipa_fn_summary::size_time_table, summarize_calls_size_and_time(), ipa_fn_summary::target_info, TDF_DETAILS, size_time_entry::time, and ipa_jump_func::type.
Referenced by inline_call().
void ipa_update_overall_fn_summary | ( | struct cgraph_node * | node, |
bool | reset ) |
For performance reasons ipa_merge_fn_summary_after_inlining is not updating overall size and time. Recompute it. If RESET is true also recompute call_time_size_table.
References ipa_fn_summary::call_size_time_table, cgraph_node::callees, estimate_calls_size_and_time(), ipa_predicate::false_condition, i, cgraph_node::indirect_calls, ipa_fn_summaries, ipa_size_summaries, ipa_fn_summary::min_size, NULL, RDIV, ipa_size_summary::size, size_time_entry::size, ipa_fn_summary::size_scale, ipa_fn_summary::size_time_table, ipa_fn_summary::time, and size_time_entry::time.
Referenced by compute_fn_summary(), ipa_fn_summary_t::duplicate(), early_inline_small_functions(), early_inliner(), flatten_function(), inline_call(), inline_small_functions(), inline_to_all_callers(), ipa_devirt(), ipa_inline(), ipa_profile(), ipcp_discover_new_direct_edges(), resolve_noninline_speculation(), and walk_polymorphic_call_targets().
|
static |
If stmt is simple load or store of value pointed to by a function parmaeter, return its index.
References dyn_cast(), get_base_address(), gimple_assign_lhs(), gimple_assign_load_p(), gimple_assign_rhs1(), gimple_store_p(), ipa_func_body_info::info, ipa_get_param_decl_index(), SSA_NAME_IS_DEFAULT_DEF, SSA_NAME_VAR, TREE_CODE, and TREE_OPERAND.
Referenced by analyze_function_body().
ipa_opt_pass_d * make_pass_ipa_fn_summary | ( | gcc::context * | ctxt | ) |
simple_ipa_opt_pass * make_pass_ipa_free_fn_summary | ( | gcc::context * | ctxt | ) |
gimple_opt_pass * make_pass_local_fn_summary | ( | gcc::context * | ctxt | ) |
Callback of walk_aliased_vdefs. Flags that it has been invoked to the boolean variable pointed to by DATA.
References b.
Referenced by unmodified_parm_1().
|
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 ipa_func_body_info::aa_walk_budget, ao_ref_init(), BASIC_BLOCK_FOR_FN, record_modified_bb_info::bb_set, BITMAP_ALLOC, bitmap_bit_p, BITMAP_FREE, cfun, basic_block_def::count, count, ctor_for_folding(), profile_count::dump(), dump_file, ENTRY_BLOCK_PTR_FOR_FN, error_mark_node, EXECUTE_IF_SET_IN_BITMAP, get_base_address(), get_minimal_bb(), gimple_bb(), gimple_call_arg(), gimple_vuse(), i, basic_block_def::index, is_gimple_min_invariant(), MAX, profile_count::nonzero_p(), NULL, record_modified_bb_info::op, print_generic_expr(), record_modified(), REG_BR_PROB_BASE, SSA_NAME_DEF_STMT, SSA_NAME_IS_DEFAULT_DEF, record_modified_bb_info::stmt, TDF_SLIM, profile_count::to_sreal_scale(), TREE_CODE, TREE_OPERAND, and walk_aliased_vdefs().
Referenced by analyze_function_body().
|
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 FOR_EACH_EDGE, gimple_cond_lhs(), gimple_cond_rhs(), gsi_last_bb(), is_gimple_ip_invariant(), NULL, basic_block_def::preds, safe_dyn_cast(), single_pred(), single_pred_p(), single_succ_p(), record_modified_bb_info::stmt, and will_be_nonconstant_expr_predicate().
Referenced by analyze_function_body().
Return true if T is a pointer pointing to memory location that is local for the function (that means, dead after return) or read-only.
References cfun, current_function_decl, DECL_BY_REFERENCE, DECL_RESULT, integer_zerop(), ptr_deref_may_alias_global_p(), refs_local_or_readonly_memory_p(), ssa_default_def(), TREE_CODE, and TREE_OPERAND.
Referenced by analyze_function_body(), refs_local_or_readonly_memory_p(), and remap_edge_params().
Return true if T is a pointer pointing to memory location that is possible sra candidate if all functions it is passed to are inlined.
References auto_var_in_fn_p(), current_function_decl, DECL_P, get_base_address(), TREE_CODE, and TREE_OPERAND.
Referenced by analyze_function_body().
|
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 ipa_fn_summary::conds, ipa_predicate::dump(), dump_file, dump_flags, gcc_assert, gimple_phi_arg(), gimple_phi_num_args(), gimple_phi_result(), i, is_gimple_min_invariant(), ipa_predicate::or_with(), SSA_NAME_VERSION, TDF_DETAILS, and TREE_CODE.
Referenced by analyze_function_body().
|
static |
Write inline summary for edge E to OB.
References bp_unpack_value(), BUILT_IN_NORMAL, ipa_call_summary::call_stmt_size, ipa_call_summary::call_stmt_time, cgraph_edge::callee, symtab_node::decl, edge_set_predicate(), fndecl_built_in_p(), i, ipa_call_summaries, ipa_call_summary::is_return_callee_uncaptured, ipa_call_summary::loop_depth, NULL, ipa_call_summary::param, cgraph_edge::possibly_call_in_translation_unit_p(), ipa_predicate::stream_in(), streamer_read_bitpack(), and streamer_read_uhwi().
Referenced by inline_read_section().
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, cfun, dump_file, ENTRY_BLOCK_PTR_FOR_FN, get_minimal_bb(), gimple_bb(), gimple_clobber_p(), basic_block_def::index, record_modified_bb_info::op, print_generic_expr(), print_gimple_stmt(), SSA_NAME_DEF_STMT, SSA_NAME_IS_DEFAULT_DEF, record_modified_bb_info::stmt, and TDF_SLIM.
Referenced by param_change_prob().
|
static |
We proved E to be unreachable, redirect it to __builtin_unreachable.
References builtin_decl_unreachable(), ipa_call_summary::call_stmt_size, ipa_call_summary::call_stmt_time, cgraph_edge::callee, cgraph_edge::count, symtab_node::decl, cgraph_node::get_create(), cgraph_edge::inline_failed, ipa_call_summaries, cgraph_edge::make_direct(), NULL, cgraph_edge::redirect_callee(), cgraph_node::remove_symbol_and_inline_clones(), cgraph_edge::resolve_speculation(), cgraph_edge::speculative, and profile_count::zero().
Referenced by edge_set_predicate().
Return true if T references memory location that is local for the function (that means, dead after return) or read-only.
References auto_var_in_fn_p(), current_function_decl, DECL_P, get_base_address(), points_to_local_or_readonly_memory_p(), TREE_CODE, TREE_OPERAND, and TREE_READONLY.
Referenced by check_op(), and points_to_local_or_readonly_memory_p().
|
static |
Update change_prob and points_to_local_or_readonly_memory of EDGE after INLINED_EDGE has been inlined. When function A is inlined in B and A calls C with parameter that changes with probability PROB1 and C is known to be passthrough of argument if B that change with probability PROB2, the probability of change is now PROB1*PROB2.
References combine_probabilities(), i, ipa_call_summaries, ipa_edge_args_sum, ipa_get_cs_argument_count(), ipa_get_ith_jump_func(), ipa_get_jf_ancestor_formal_id(), ipa_get_jf_constant(), ipa_get_jf_pass_through_formal_id(), IPA_JF_ANCESTOR, IPA_JF_CONST, IPA_JF_PASS_THROUGH, ipa_node_params_sum, ipa_call_summary::param, points_to_local_or_readonly_memory_p(), 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, edge_set_predicate(), cgraph_node::indirect_calls, cgraph_edge::inline_failed, ipa_call_summaries, cgraph_edge::next_callee, ipa_call_summary::predicate, ipa_predicate::remap_after_inlining(), remap_edge_params(), and remap_edge_summaries().
Referenced by ipa_merge_fn_summary_after_inlining(), and remap_edge_summaries().
|
static |
Run remap_after_inlining on each predicate in V.
References i, ipa_freqcounting_predicate::predicate, ipa_predicate::remap_after_inlining(), and vec_safe_iterate().
Referenced by ipa_merge_fn_summary_after_inlining().
|
static |
Duplicate predicates in loop hint vector, allocating memory for them and remove and deallocate any uninteresting (true or false) ones. Return the result.
References i, NULL, ipa_predicate::remap_after_duplication(), set_hint_predicate(), and vec_safe_length().
Referenced by ipa_fn_summary_t::duplicate().
|
static |
If BB ends by a conditional we can turn into predicates, attach corresponding predicates to the CFG edges.
References add_builtin_constant_p_parm(), add_condition(), agg_position_info::by_ref, CDI_POST_DOMINATORS, decompose_param_expr(), dominated_by_p(), edge_predicate_pool, FOR_EACH_EDGE, gimple_call_arg(), gimple_call_builtin_p(), gimple_call_num_args(), gimple_cond_code(), gimple_cond_lhs(), gimple_cond_rhs(), gsi_last_bb(), HONOR_NANS(), integer_zerop(), invert_tree_comparison(), is_gimple_ip_invariant(), ipa_predicate::is_not_constant, last, NULL_TREE, safe_dyn_cast(), SSA_NAME_DEF_STMT, basic_block_def::succs, TREE_CODE, and vec_free().
Referenced by compute_bb_predicates().
|
static |
Set predicate for hint *P.
References edge_predicate_pool, and NULL.
Referenced by add_freqcounting_predicate(), ipa_fn_summary_t::duplicate(), inline_read_section(), and remap_freqcounting_preds_after_dup().
|
static |
If BB ends by a switch we can turn into predicates, attach corresponding predicates to the CFG edges.
References add_condition(), CASE_HIGH, CASE_LOW, CDI_POST_DOMINATORS, cfun, ipa_fn_summary::conds, symtab_node::decl, decompose_param_expr(), dominated_by_p(), edge_predicate_pool, FOR_EACH_EDGE, get_legacy_range(), get_range_query(), gimple_switch_edge(), gimple_switch_index(), gimple_switch_label(), gimple_switch_num_labels(), gsi_last_bb(), i, INT_MAX, last, wi::le_p(), wi::lt_p(), ipa_func_body_info::node, opt_for_fn, ipa_predicate::or_with(), path_range_query::range_of_expr(), safe_dyn_cast(), irange::set_varying(), basic_block_def::succs, wi::to_wide(), TREE_TYPE, TYPE_MAX_VALUE, TYPE_MIN_VALUE, TYPE_SIGN, vrange::undefined_p(), vec_free(), VR_ANTI_RANGE, VR_RANGE, VR_UNDEFINED, and wide_int_to_tree().
Referenced by compute_bb_predicates().
|
static |
Populate sum->call_size_time_table for edges from NODE.
References ipa_fn_summary::account_size_time(), cgraph_edge::callee, cgraph_node::callees, estimate_edge_size_and_time(), gcc_checking_assert, cgraph_node::indirect_calls, cgraph_edge::inline_failed, ipa_call_summaries, cgraph_edge::next_callee, NULL, ipa_call_summary::predicate, and summarize_calls_size_and_time().
Referenced by estimate_calls_size_and_time(), ipa_merge_fn_summary_after_inlining(), and summarize_calls_size_and_time().
|
static |
If OP refers to value of function parameter, return the corresponding parameter. Also traverse chains of SSA register assignments. If non-NULL, the size of the memory load (or the SSA_NAME of the PARM_DECL) will be stored to *SIZE_P in that case too.
References gimple_assign_rhs1(), gimple_assign_single_p(), NULL_TREE, SSA_NAME_DEF_STMT, SSA_NAME_IS_DEFAULT_DEF, TREE_CODE, unmodified_parm(), and unmodified_parm_1().
Referenced by eliminated_by_inlining_prob(), unmodified_parm(), will_be_nonconstant_expr_predicate(), and will_be_nonconstant_predicate().
|
static |
If OP refers to value of function parameter, return the corresponding parameter. If non-NULL, the size of the memory load (or the SSA_NAME of the PARM_DECL) will be stored to *SIZE_P in that case too.
References ipa_func_body_info::aa_walk_budget, ao_ref_init(), gimple_vuse(), mark_modified(), NULL, NULL_TREE, SSA_NAME_IS_DEFAULT_DEF, SSA_NAME_VAR, TREE_CODE, tree_to_poly_int64(), TREE_TYPE, TYPE_SIZE, 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, the access size into *SIZE_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, ipa_node_params::descriptors, gcc_checking_assert, gimple_assign_rhs1(), gimple_assign_single_p(), ipa_func_body_info::info, ipa_get_param_decl_index(), ipa_load_from_parm_agg(), agg_position_info::offset, REFERENCE_CLASS_P, SSA_NAME_DEF_STMT, SSA_NAME_IS_DEFAULT_DEF, TREE_CODE, unmodified_parm_1(), and unmodified_parm_or_parm_agg_item().
Referenced by decompose_param_expr(), and unmodified_parm_or_parm_agg_item().
|
static |
Return true if VRP will be exectued on the function. We do not want to anticipate optimizations that will not happen. FIXME: This can be confused with -fdisable and debug counters and thus it should not be used for correctness (only to make heuristics work). This means that inliner should do its own optimizations of expressions that it predicts to be constant so wrong code can not be triggered by builtin_constant_p.
References symtab_node::decl, and opt_for_fn.
Referenced by evaluate_properties_for_edge().
|
static |
Return predicate specifying when the STMT might have result that is not a compile time constant.
References add_condition(), BINARY_CLASS_P, ipa_predicate::changed, COMPARISON_CLASS_P, ipa_fn_summary::conds, debug_tree(), gcc_unreachable, ipa_func_body_info::info, ipa_get_param_decl_index(), is_gimple_min_invariant(), NULL, NULL_TREE, ipa_predicate::or_with(), SSA_NAME_VERSION, TREE_CODE, TREE_OPERAND, TREE_TYPE, UNARY_CLASS_P, unmodified_parm(), and will_be_nonconstant_expr_predicate().
Referenced by analyze_function_body(), phi_result_unknown_predicate(), and will_be_nonconstant_expr_predicate().
|
static |
Return predicate specifying when the STMT might have result that is not a compile time constant.
References add_condition(), ipa_predicate::changed, ipa_fn_summary::conds, decompose_param_expr(), ECF_CONST, FOR_EACH_SSA_TREE_OPERAND, gimple_assign_load_p(), gimple_assign_rhs1(), gimple_call_flags(), gimple_op(), gimple_store_p(), ipa_func_body_info::info, ipa_get_param_decl_index(), NULL, NULL_TREE, ipa_predicate::or_with(), SSA_NAME_VERSION, SSA_OP_USE, TREE_CODE, TREE_TYPE, and unmodified_parm().
Referenced by analyze_function_body().
|
static |
Write inline summary for edge E to OB.
References bitpack_create(), bp_pack_value(), ipa_call_summary::call_stmt_size, ipa_call_summary::call_stmt_time, i, ipa_call_summaries, ipa_call_summary::is_return_callee_uncaptured, ipa_call_summary::loop_depth, output_block::main_stream, ipa_call_summary::param, ipa_call_summary::predicate, ipa_predicate::stream_out(), streamer_write_bitpack(), and streamer_write_uhwi().
Referenced by ipa_fn_summary_write().
|
static |
Edge predicates goes here.
Referenced by analyze_function_body(), compute_bb_predicates(), edge_set_predicate(), ipa_free_fn_summary(), set_cond_stmt_execution_predicate(), set_hint_predicate(), set_switch_stmt_execution_predicate(), ipa_call_summary::~ipa_call_summary(), and ipa_fn_summary::~ipa_fn_summary().
fast_call_summary<ipa_call_summary *, va_heap>* ipa_call_summaries |
Referenced by analyze_function_body(), can_inline_edge_by_limits_p(), check_callers(), check_callers(), compute_fn_summary(), compute_inlined_call_time(), do_estimate_edge_time(), dump_ipa_call_summary(), ipa_fn_summary_t::duplicate(), early_inliner(), edge_badness(), edge_set_predicate(), estimate_calls_size_and_time_1(), estimate_edge_growth(), estimate_edge_size_and_time(), estimate_min_edge_growth(), estimate_size_after_inlining(), evaluate_properties_for_edge(), growth_positive_p(), inline_update_callee_summaries(), inlining_speedup(), ipa_fn_summary_alloc(), ipa_free_fn_summary(), ipa_make_edge_direct_to_target(), ipa_merge_fn_summary_after_inlining(), ipa_propagate_frequency_1(), malloc_candidate_p_1(), propagate_malloc(), read_ipa_call_summary(), redirect_to_unreachable(), remap_edge_params(), remap_edge_summaries(), ipa_fn_summary_t::remove_callees(), symbol_table::remove_unreachable_nodes(), summarize_calls_size_and_time(), want_inline_small_function_p(), and write_ipa_call_summary().
fast_function_summary<ipa_fn_summary *, va_gc>* ipa_fn_summaries |
Summaries.
Referenced by analyze_function_body(), caller_growth_limits(), can_early_inline_edge_p(), can_inline_edge_by_limits_p(), can_inline_edge_p(), compute_fn_summary(), compute_inlined_call_time(), compute_uninlined_call_time(), devirtualization_time_bonus(), do_estimate_edge_time(), dump_ipa_call_summary(), dump_overall_stats(), early_inline_small_functions(), edge_badness(), estimate_calls_size_and_time(), estimate_edge_devirt_benefit(), estimate_min_edge_growth(), ipa_call_context::estimate_size_and_time(), evaluate_conditions_for_known_args(), evaluate_properties_for_edge(), execute_split_functions(), growth_positive_p(), inline_always_inline_functions(), inline_call(), inline_read_section(), inline_small_functions(), ipa_dump_fn_summary(), ipa_fn_summary_alloc(), ipa_fn_summary_generate(), ipa_fn_summary_read(), ipa_fn_summary_write(), ipa_free_fn_summary(), ipa_merge_fn_summary_after_inlining(), ipa_update_overall_fn_summary(), ipa_icf::sem_function::merge(), symbol_table::process_new_functions(), recursive_inlining(), simple_edge_hints(), update_callee_keys(), update_caller_keys(), walk_polymorphic_call_targets(), and want_inline_small_function_p().
fast_function_summary<ipa_size_summary *, va_heap>* ipa_size_summaries |
Referenced by analyze_function_body(), caller_growth_limits(), clone_inlined_nodes(), compute_fn_summary(), devirtualization_time_bonus(), dump_ipa_call_summary(), edge_badness(), estimate_growth(), estimate_size_after_inlining(), growth_positive_p(), inline_call(), inline_read_section(), inline_small_functions(), inline_to_all_callers_1(), ipa_dump_fn_summary(), ipa_fn_summary_alloc(), ipa_fn_summary_write(), ipa_free_size_summary(), ipa_get_stack_frame_offset(), ipa_update_overall_fn_summary(), ipcp_cloning_candidate_p(), ipcp_propagate_stage(), ipa_icf::sem_function::merge(), and recursive_inlining().