|
GCC Middle and Back End API Reference
|
#include "config.h"#include "system.h"#include "coretypes.h"#include "backend.h"#include "target.h"#include "rtl.h"#include "tree.h"#include "gimple.h"#include "alloc-pool.h"#include "tree-pass.h"#include "gimple-ssa.h"#include "cgraph.h"#include "lto-streamer.h"#include "trans-mem.h"#include "calls.h"#include "tree-inline.h"#include "profile.h"#include "symbol-summary.h"#include "tree-vrp.h"#include "sreal.h"#include "ipa-cp.h"#include "ipa-prop.h"#include "ipa-fnsummary.h"#include "ipa-inline.h"#include "ipa-utils.h"#include "auto-profile.h"#include "builtins.h"#include "fibonacci_heap.h"#include "stringpool.h"#include "attribs.h"#include "asan.h"#include "ipa-strub.h"#include "ipa-modref-tree.h"#include "ipa-modref.h"
Data Structures | |
| class | inline_badness |
Macros | |
| #define | check_maybe_up(flag) |
| #define | check_maybe_down(flag) |
| #define | check_match(flag) |
Typedefs | |
| typedef fibonacci_heap< inline_badness, cgraph_edge > | edge_heap_t |
| typedef fibonacci_node< inline_badness, cgraph_edge > | edge_heap_node_t |
Enumerations | |
| enum | can_inline_edge_by_limits_flags { CAN_INLINE_EARLY = 1 , CAN_INLINE_DISREGARD_LIMITS = 2 , CAN_INLINE_FORCE_LIMITS = 4 , CAN_INLINE_REPORT = 8 } |
Variables | |
| static int | overall_size |
| static bool | has_nonzero_ipa_profile |
| static profile_count | spec_rem |
| #define check_match | ( | flag | ) |
Used for flags where exact match is needed for correctness.
Referenced by can_inline_edge_by_limits_p().
| #define check_maybe_down | ( | flag | ) |
Used for flags where it is safe to inline when caller's value is smaller than callee's.
Referenced by can_inline_edge_by_limits_p().
| #define check_maybe_up | ( | flag | ) |
Used for flags where it is safe to inline when caller's value is grater than callee's.
Referenced by can_inline_edge_by_limits_p().
| typedef fibonacci_heap<inline_badness, cgraph_edge> edge_heap_t |
|
static |
Compute badness of all edges in NEW_EDGES and add them to the HEAP.
References add_new_edges_to_heap(), edge_def::aux, b, can_inline_edge_by_limits_p(), can_inline_edge_p(), CAN_INLINE_REPORT, edge_badness(), gcc_assert, fibonacci_heap< K, V >::insert(), and want_inline_small_function_p().
Referenced by add_new_edges_to_heap(), and inline_small_functions().
|
static |
Return true if the speedup for inlining E is bigger than param_inline_min_speedup.
References big_speedup_p(), compute_inlined_call_time(), compute_uninlined_call_time(), symtab_node::decl, estimate_edge_time(), and opt_for_fn.
Referenced by big_speedup_p(), edge_badness(), and want_inline_small_function_p().
|
static |
Return expected speedup of the callee function alone (i.e. not estimate of call overhead and also no scalling by call frequency.
References callee_speedup(), and estimate_edge_time().
Referenced by callee_speedup(), and want_inline_small_function_p().
|
static |
Return false when inlining edge E would lead to violating limits on function unit growth or stack usage growth. The relative function body growth limit is present generally to avoid problems with non-linear behavior of the compiler. To allow inlining huge functions into tiny wrapper, the limit is always based on the bigger of the two functions considered. For stack growth limits we always base the growth in stack usage of the callers. We want to prevent applications from segfaulting on stack overflow when functions with huge stack frames gets inlined.
References cgraph_edge::caller, caller_growth_limits(), cgraph_node::callers, symtab_node::decl, estimate_size_after_inlining(), ipa_size_summary::estimated_self_stack_size, ipa_fn_summary::estimated_stack_size, cgraph_node::inlined_to, ipa_fn_summaries, ipa_get_stack_frame_offset(), ipa_size_summaries, opt_for_fn, and ipa_size_summary::self_size.
Referenced by caller_growth_limits(), and can_inline_edge_by_limits_p().
|
static |
Return true if the edge E is inlinable during early inlining.
References cgraph_node::callees, can_early_inline_edge_p(), CAN_INLINE_EARLY, can_inline_edge_by_limits_p(), can_inline_edge_p(), CAN_INLINE_REPORT, cgraph_inline_failed_type(), CIF_FINAL_ERROR, coverage_instrumentation_p(), symtab_node::decl, DECL_ATTRIBUTES, DECL_DISREGARD_INLINE_LIMITS, DECL_STRUCT_FUNCTION, symtab_node::externally_visible, gcc_assert, gimple_has_body_p(), gimple_in_ssa_p(), cgraph_node::indirect_calls, ipa_fn_summaries, lookup_attribute(), cgraph_edge::next_callee, NULL_TREE, ipa_fn_summary::safe_to_inline_to_always_inline, and cgraph_node::ultimate_alias_target().
Referenced by can_early_inline_edge_p(), early_inline_small_functions(), flatten_function(), inline_always_inline_functions(), and inline_functions_by_afdo().
|
static |
Decide if we can inline the edge and possibly update inline_failed reason. We check whether inlining is possible at all and whether caller growth limits allow doing so.
References caller_growth_limits(), CAN_INLINE_DISREGARD_LIMITS, CAN_INLINE_EARLY, can_inline_edge_by_limits_p(), CAN_INLINE_FORCE_LIMITS, CAN_INLINE_REPORT, cgraph_inline_failed_type(), check_match, check_maybe_down, check_maybe_up, CIF_FINAL_ERROR, symtab_node::decl, DECL_ATTRIBUTES, DECL_DECLARED_INLINE_P, DECL_DISREGARD_INLINE_LIMITS, DECL_FUNCTION_PERSONALITY, DECL_FUNCTION_SPECIFIC_OPTIMIZATION, estimate_edge_growth(), estimate_edge_time(), symtab_node::externally_visible, ipa_fn_summary::fp_expressions, gcc_checking_assert, inline_insns_auto(), inline_insns_single(), ipa_call_summaries, ipa_fn_summaries, LIVE_PATCHING_INLINE_ONLY_STATIC, lookup_attribute(), MAX, cgraph_node::merged_comdat, NULL, opt_for_fn, opts_for_fn(), and report_inline_failed_reason().
Referenced by add_new_edges_to_heap(), can_early_inline_edge_p(), can_inline_edge_by_limits_p(), check_callers(), flatten_function(), inline_small_functions(), inline_to_all_callers_1(), recursive_inlining(), speculation_useful_p(), update_callee_keys(), update_caller_keys(), and want_inline_self_recursive_call_p().
|
static |
Decide if we can inline the edge and possibly update inline_failed reason. We check whether inlining is possible at all and whether caller growth limits allow doing so. if REPORT is true, output reason to the dump file.
References AVAIL_INTERPOSABLE, cgraph_node::calls_comdat_local, can_inline_edge_p(), cgraph_inline_failed_type(), CIF_FINAL_ERROR, symtab_node::decl, DECL_FUNCTION_PERSONALITY, symtab_node::definition, gcc_checking_assert, gcc_unreachable, ipa_fn_summaries, is_tm_pure(), toplevel_node::lto_file_data, symtab_node::must_remain_in_tu_body, NULL, opt_for_fn, report_inline_failed_reason(), sanitize_attrs_match_for_inline_p(), strub_inlinable_to_p(), and targetm.
Referenced by add_new_edges_to_heap(), can_early_inline_edge_p(), can_inline_edge_p(), check_callers(), flatten_function(), inline_small_functions(), inline_to_all_callers_1(), recursive_inlining(), speculation_useful_p(), update_callee_keys(), and update_caller_keys().
|
static |
Return true when NODE has uninlinable caller; set HAS_HOT_CALL if it has hot call. Worker for cgraph_for_node_and_aliases.
References can_inline_edge_by_limits_p(), can_inline_edge_p(), CAN_INLINE_REPORT, check_callers(), estimate_size_after_inlining(), ipa_call_summaries, and opt_for_fn.
|
inline |
Same as compute_uinlined_call_time but compute time when inlining does happen.
References compute_inlined_call_time(), gcc_checking_assert, ipa_call_summaries, and ipa_fn_summaries.
Referenced by big_speedup_p(), and compute_inlined_call_time().
|
static |
Given whole compilation unit estimate of INSNS, compute how large we can allow the unit to grow.
References compute_max_insns(), and opt_for_fn.
Referenced by compute_max_insns(), and inline_small_functions().
|
inline |
Compute time of the edge->caller + edge->callee execution when inlining does not happen.
References compute_uninlined_call_time(), and ipa_fn_summaries.
Referenced by big_speedup_p(), and compute_uninlined_call_time().
|
static |
Output some useful stats about inlining.
References cgraph_inline_failed_string(), DECL_VIRTUAL_P, profile_count::dump(), dump_file, dump_inline_stats(), dump_overall_stats(), FOR_EACH_DEFINED_FUNCTION, has_nonzero_ipa_profile, i, is_a(), PRId64, and spec_rem.
Referenced by dump_inline_stats(), and ipa_inline().
|
static |
Output overall time estimate.
References dump_file, dump_overall_stats(), FOR_EACH_DEFINED_FUNCTION, ipa_fn_summaries, NULL, and sreal::to_double().
Referenced by dump_inline_stats(), dump_overall_stats(), and ipa_inline().
|
static |
Decide on the inlining. We do so in the topological order to avoid expenses on updating data structures.
References can_early_inline_edge_p(), symtab_node::decl, DECL_DECLARED_INLINE_P, dump_enabled_p(), dump_printf_loc(), early_inline_small_functions(), inline_call(), ipa_fn_summaries, ipa_update_overall_fn_summary(), MSG_MISSED_OPTIMIZATION, MSG_NOTE, MSG_OPTIMIZED_LOCATIONS, NULL, opt_for_fn, and want_early_inline_function_p().
Referenced by early_inline_small_functions(), and early_inliner().
| unsigned int early_inliner | ( | function * | fun | ) |
In ipa-inline.cc
References function::always_inline_functions_inlined, ipa_call_summary::call_stmt_size, ipa_call_summary::call_stmt_time, current_function_decl, DECL_ATTRIBUTES, dump_enabled_p(), dump_file, dump_printf(), early_inline_small_functions(), early_inliner(), eni_size_weights, eni_time_weights, estimate_num_insns(), flatten_function(), cgraph_node::get(), inline_always_inline_functions(), inline_functions_by_afdo(), ipa_call_summaries, ipa_node_params_sum, ipa_update_overall_fn_summary(), lookup_attribute(), MSG_OPTIMIZED_LOCATIONS, NULL, opt_for_fn, optimize_inline_calls(), cgraph_edge::redirect_call_stmt_to_callee(), seen_error(), timevar_pop(), and timevar_push().
Referenced by early_inliner().
|
static |
A cost model driving the inlining heuristics in a way so the edges with smallest badness are inlined first. After each inlining is performed the costs of all caller edges of nodes affected are recomputed so the metrics may accurately depend on values such as number of inlinable callers of the function or function body size.
References big_speedup_p(), cgraph_node::count, edge_def::count(), symtab_node::decl, DECL_DECLARED_INLINE_P, DECL_DISREGARD_INLINE_LIMITS, DECL_EXTERNAL, dump_file, edge_badness(), estimate_edge_growth(), estimate_edge_hints(), estimate_edge_time(), estimate_growth(), gcc_checking_assert, ipa_fn_summary::growth, profile_count::initialized_p(), ipa_fn_summary::inlinable, INLINE_HINT_builtin_constant_p, INLINE_HINT_cross_module, INLINE_HINT_declared_inline, INLINE_HINT_in_scc, INLINE_HINT_indirect_call, INLINE_HINT_loop_iterations, INLINE_HINT_loop_stride, INLINE_HINT_same_scc, inlining_speedup(), profile_count::ipa(), ipa_call_summaries, ipa_dump_hints(), ipa_fn_summaries, ipa_size_summaries, sreal::max(), MIN, profile_count::nonzero_p(), opt_for_fn, PRId64, sreal::shift(), ipa_fn_summary::single_caller, cgraph_node::split_part, SREAL_MAX_EXP, SREAL_MIN_SIG, ipa_fn_summary::time, sreal::to_double(), profile_count::to_gcov_type(), and wrapper_heuristics_may_apply().
Referenced by add_new_edges_to_heap(), edge_badness(), inline_small_functions(), and update_edge_key().
|
static |
Flatten NODE. Performed both during early inlining and at IPA inlining time.
References symtab_node::aux, can_early_inline_edge_p(), can_inline_edge_by_limits_p(), can_inline_edge_p(), CAN_INLINE_REPORT, cgraph_inline_failed_type(), CIF_FINAL_ERROR, symtab_node::decl, DECL_STRUCT_FUNCTION, dump_enabled_p(), dump_printf_loc(), flatten_function(), gcc_assert, gimple_in_ssa_p(), inline_call(), ipa_update_overall_fn_summary(), MSG_MISSED_OPTIMIZATION, MSG_OPTIMIZED_LOCATIONS, NULL, and opt_for_fn.
Referenced by early_inliner(), flatten_function(), and ipa_inline().
|
static |
Called when node is removed.
References hash_set< KeyId, Lazy, Traits >::add(), DECL_ATTRIBUTES, flatten_remove_node_hook(), lookup_attribute(), and NULL.
Referenced by flatten_remove_node_hook(), and ipa_inline().
|
static |
If NODE has a caller, return true.
References has_caller_p().
Referenced by has_caller_p(), and want_inline_function_to_all_callers_p().
|
static |
Remove EDGE from the fibheap.
References heap_edge_removal_hook(), and NULL.
Referenced by heap_edge_removal_hook(), and inline_small_functions().
|
inline |
We only propagate across edges with non-interposable callee.
References AVAIL_INTERPOSABLE, and ignore_edge_p().
| bool inline_account_function_p | ( | struct cgraph_node * | node | ) |
Return true if NODE should be accounted for overall size estimate. Skip all nodes optimized for size so we can measure the growth of hot part of program no matter of the padding.
References DECL_EXTERNAL, inline_account_function_p(), NODE_FREQUENCY_UNLIKELY_EXECUTED, and opt_for_fn.
Referenced by clone_inlined_nodes(), inline_account_function_p(), inline_call(), and inline_small_functions().
|
static |
Inline always-inline function calls in NODE (which itself is possibly inline).
References symtab_node::aux, can_early_inline_edge_p(), compute_fn_summary(), symtab_node::decl, DECL_ATTRIBUTES, DECL_DISREGARD_INLINE_LIMITS, symtab_node::definition, dump_enabled_p(), dump_printf_loc(), gcc_checking_assert, inline_always_inline_functions(), inline_call(), ipa_fn_summaries, lookup_attribute(), MSG_MISSED_OPTIMIZATION, MSG_OPTIMIZED_LOCATIONS, and NULL.
Referenced by early_inliner(), and inline_always_inline_functions().
|
static |
With auto-fdo inline all functions that was inlined in the train run and inlining seems useful. That is there are enough samples in the callee function. Unlike early inlining, we inline recursively. Profile data is also used to produce speculative calls which we then inline. In the case some speculatin was introduced, set SPECULATIVE_CALLS.
References afdo_callsite_hot_enough_for_early_inline(), afdo_vpt_for_early_inline(), can_early_inline_edge_p(), cgraph_inline_failed_string(), compute_fn_summary(), symtab_node::definition, dump_enabled_p(), dump_printf_loc(), inline_call(), inline_functions_by_afdo(), ipa_fn_summaries, ipa_update_overall_fn_summary(), MSG_MISSED_OPTIMIZATION, MSG_OPTIMIZED_LOCATIONS, NULL, remove_afdo_speculative_target(), and cgraph_edge::resolve_speculation().
Referenced by early_inliner(), and inline_functions_by_afdo().
|
static |
Return inlining_insns_auto limit for function N. If HINT or HINT2 is true scale up the bound.
References inline_insns_auto(), and opt_for_fn.
Referenced by can_inline_edge_by_limits_p(), inline_insns_auto(), want_inline_small_function_p(), and wrapper_heuristics_may_apply().
|
static |
Return inlining_insns_single limit for function N. If HINT or HINT2 is true scale up the bound.
References inline_insns_single(), and opt_for_fn.
Referenced by can_inline_edge_by_limits_p(), inline_insns_single(), want_inline_small_function_p(), and wrapper_heuristics_may_apply().
|
static |
We use greedy algorithm for inlining of small functions: All inline candidates are put into prioritized heap ordered in increasing badness. The inlining of small functions is bounded by unit growth parameters.
References symbol_table::add_edge_removal_hook(), add_new_edges_to_heap(), edge_def::aux, symtab_node::aux, b, inline_badness::badness, bitmap_clear(), BUILTINS_LOCATION, cgraph_edge::caller, cgraph_node::callers, can_inline_edge_by_limits_p(), can_inline_edge_p(), CAN_INLINE_REPORT, symbol_table::cgraph_count, compute_max_insns(), cgraph_node::count, edge_def::count(), cross_module_call_p(), symtab_node::decl, DECL_DISREGARD_INLINE_LIMITS, profile_count::dump(), dump_enabled_p(), dump_file, dump_flags, symtab_node::dump_name(), dump_printf(), dump_printf_loc(), edge_badness(), edge_growth_cache, fibonacci_heap< K, V >::empty(), estimate_edge_growth(), estimate_edge_hints(), estimate_edge_size(), estimate_edge_time(), estimate_growth(), fibonacci_heap< K, V >::extract_min(), FOR_EACH_DEFINED_FUNCTION, free(), free_growth_caches(), gcc_assert, gcc_checking_assert, cgraph_node::get(), gimple_filename(), gimple_lineno(), gimple_location(), ipa_fn_summary::growth, has_nonzero_ipa_profile, heap_edge_removal_hook(), ignore_edge_p(), initialize_growth_caches(), profile_count::initialized_p(), inline_account_function_p(), inline_call(), inline_small_functions(), cgraph_node::inlined_to, fibonacci_heap< K, V >::insert(), profile_count::ipa(), ipa_fn_summaries, ipa_free_postorder_info(), profile_count::ipa_p(), ipa_reduced_postorder(), ipa_size_summaries, ipa_update_overall_fn_summary(), LOCATION_LOCUS, fibonacci_heap< K, V >::min(), fibonacci_heap< K, V >::min_key(), MSG_NOTE, MSG_OPTIMIZED_LOCATIONS, ipa_dfs_info::next_cycle, profile_count::nonzero_p(), NULL, num_calls(), opt_for_fn, toplevel_node::order, overall_size, profile_info, recursive_inlining(), symbol_table::remove_edge_removal_hook(), report_inline_failed_reason(), reset_edge_caches(), reset_node_cache(), resolve_noninline_speculation(), cgraph_edge::resolve_speculation(), ipa_dfs_info::scc_no, ipa_fn_summary::scc_no, ipa_fn_summary::single_caller, speculation_useful_p(), sum_callers(), symtab, TDF_DETAILS, sreal::to_double(), cgraph_node::ultimate_alias_target(), update_callee_keys(), update_caller_keys(), update_edge_key(), want_inline_self_recursive_call_p(), want_inline_small_function_p(), and wrapper_heuristics_may_apply().
Referenced by inline_small_functions(), and ipa_inline().
|
static |
Wrapper around inline_to_all_callers_1 doing delayed overall summary update.
References cgraph_node::callers, i, inline_to_all_callers(), inline_to_all_callers_1(), and ipa_update_overall_fn_summary().
Referenced by inline_to_all_callers(), and ipa_inline().
|
static |
Inline NODE to all callers. Worker for cgraph_for_node_and_aliases. DATA points to number of calls originally found so we avoid infinite recursion.
References cgraph_node::callers, can_inline_edge_by_limits_p(), can_inline_edge_p(), CAN_INLINE_REPORT, dump_file, symtab_node::dump_name(), inline_call(), inline_to_all_callers_1(), ipa_size_summaries, NULL, and num_calls().
Referenced by inline_to_all_callers(), and inline_to_all_callers_1().
|
inline |
Determine time saved by inlining EDGE of frequency FREQ where callee's runtime w/o inlining is UNINLINED_TYPE and with inlined is INLINED_TYPE.
References gcc_checking_assert, inlining_speedup(), and ipa_call_summaries.
Referenced by edge_badness(), and inlining_speedup().
|
static |
Decide on the inlining. We do so in the topological order to avoid expenses on updating data structures.
References symbol_table::add_cgraph_removal_hook(), symbol_table::cgraph_count, hash_set< KeyId, Lazy, Traits >::contains(), edge_def::count(), DECL_ATTRIBUTES, dump_enabled_p(), dump_file, dump_inline_stats(), dump_overall_stats(), dump_printf(), flatten_function(), flatten_remove_node_hook(), FOR_EACH_DEFINED_FUNCTION, FOR_EACH_FUNCTION, free(), gcc_assert, i, initialize_inline_failed(), profile_count::initialized_p(), inline_small_functions(), inline_to_all_callers(), profile_count::ipa(), ipa_dump_fn_summaries(), ipa_inline(), ipa_reverse_postorder(), IPA_SSA, IPA_SSA_AFTER_INLINING, ipa_update_overall_fn_summary(), lookup_attribute(), MSG_NOTE, ncalls_inlined, nfunctions_inlined, NULL, num_calls(), opt_for_fn, toplevel_node::order, symbol_table::remove_cgraph_removal_hook(), symbol_table::remove_unreachable_nodes(), reset_edge_caches(), cgraph_edge::resolve_speculation(), spec_rem, speculation_useful_p(), symbol_table::state, sum_callers(), symtab, TODO_remove_functions, want_inline_function_to_all_callers_p(), and profile_count::zero().
Referenced by ipa_inline().
|
static |
Enqueue all recursive calls from NODE into priority queue depending on how likely we want to recursively inline the call.
References AVAIL_INTERPOSABLE, b, cgraph_node::callees, fibonacci_heap< K, V >::insert(), and lookup_recursive_calls().
Referenced by lookup_recursive_calls(), and recursive_inlining().
| gimple_opt_pass * make_pass_early_inline | ( | gcc::context * | ctxt | ) |
References make_pass_early_inline().
Referenced by make_pass_early_inline(), and make_pass_rtl_seqabstr().
| ipa_opt_pass_d * make_pass_ipa_inline | ( | gcc::context * | ctxt | ) |
References make_pass_ipa_inline().
Referenced by make_pass_ipa_inline(), and make_pass_sprintf_length().
|
static |
Return number of calls in N. Ignore cheap builtins.
References is_inexpensive_builtin().
Referenced by inline_small_functions(), inline_to_all_callers_1(), ipa_inline(), sum_callers(), and want_early_inline_function_p().
|
static |
Decide on recursive inlining: in the case function has recursive calls, inline until body size reaches given argument. If any new indirect edges are discovered in the process, add them to *NEW_EDGES, unless NEW_EDGES is NULL.
References b, cgraph_edge::callee, cgraph_node::callees, cgraph_edge::caller, cgraph_node::callers, can_inline_edge_by_limits_p(), can_inline_edge_p(), CAN_INLINE_FORCE_LIMITS, CAN_INLINE_REPORT, clone_inlined_nodes(), cgraph_edge::count, symtab_node::decl, DECL_DECLARED_INLINE_P, dump_enabled_p(), dump_file, dump_printf_loc(), edge_growth_cache, fibonacci_heap< K, V >::empty(), estimate_size_after_inlining(), fibonacci_heap< K, V >::extract_min(), symbol_table::first_function(), profile_count::initialized_p(), inline_call(), cgraph_node::inlined_to, ipa_fn_summaries, ipa_size_summaries, lookup_recursive_calls(), sreal::min(), MSG_NOTE, toplevel_node::next, symbol_table::next_function(), NULL, opt_for_fn, overall_size, recursive_inlining(), cgraph_edge::redirect_callee(), cgraph_node::remove(), reset_node_cache(), symtab, profile_count::to_gcov_type(), cgraph_node::ultimate_alias_target(), vNULL, and want_inline_self_recursive_call_p().
Referenced by inline_small_functions(), and recursive_inlining().
|
static |
Dump info about why inlining has failed.
References cgraph_inline_failed_string(), dump_enabled_p(), dump_file, dump_printf_loc(), MSG_MISSED_OPTIMIZATION, NULL, opts_for_fn(), report_inline_failed_reason(), and target_opts_for_fn().
Referenced by can_inline_edge_by_limits_p(), can_inline_edge_p(), inline_small_functions(), report_inline_failed_reason(), update_callee_keys(), update_caller_keys(), want_early_inline_function_p(), and want_inline_small_function_p().
|
static |
NODE was inlined. All caller edges needs to be reset because size estimates change. Similarly callees needs reset because better context may be known.
References cgraph_node::callers, dyn_cast(), edge_growth_cache, FOR_EACH_ALIAS, cgraph_node::inlined_to, NULL, ipa_ref::referring, reset_edge_caches(), and reset_node_cache().
Referenced by inline_small_functions(), ipa_inline(), reset_edge_caches(), and resolve_noninline_speculation().
|
static |
We know that EDGE is not going to be inlined. See if we can remove speculation.
References edge_def::count(), profile_count::initialized_p(), profile_count::ipa(), ipa_update_overall_fn_summary(), NULL, reset_edge_caches(), resolve_noninline_speculation(), cgraph_edge::resolve_speculation(), spec_rem, speculation_useful_p(), update_callee_keys(), and update_caller_keys().
Referenced by inline_small_functions(), and resolve_noninline_speculation().
|
static |
References DECL_ATTRIBUTES, i, lookup_attribute(), SANITIZE_ADDRESS, sanitize_attrs_match_for_inline_p(), sanitize_coverage_p(), sanitize_flags_p(), SANITIZE_POINTER_COMPARE, SANITIZE_POINTER_SUBTRACT, SANITIZE_THREAD, SANITIZE_UNDEFINED, and SANITIZE_UNDEFINED_NONDEFAULT.
Referenced by can_inline_edge_p(), and sanitize_attrs_match_for_inline_p().
| bool speculation_useful_p | ( | struct cgraph_edge * | e, |
| bool | anticipate_inlining ) |
Return true if speculation of edge E seems useful. If ANTICIPATE_INLINING is true, be conservative and hope that E may get inlined.
References AVAIL_AVAILABLE, CAN_INLINE_DISREGARD_LIMITS, can_inline_edge_by_limits_p(), can_inline_edge_p(), symtab_node::decl, ECF_CONST, ECF_PURE, flags_from_decl_or_type(), gcc_assert, get_modref_function_summary(), cgraph_node::local, and speculation_useful_p().
Referenced by check_speculations_1(), inline_small_functions(), ipa_inline(), resolve_noninline_speculation(), and speculation_useful_p().
|
static |
Count number of callers of NODE and store it into DATA (that points to int. Worker for cgraph_for_node_and_aliases.
References num_calls(), and sum_callers().
Referenced by inline_small_functions(), ipa_inline(), and sum_callers().
|
static |
Recompute HEAP nodes for each uninlined call in NODE If UPDATE_SINCE is non-NULL check if edges called within that function are inlinable (typically UPDATE_SINCE is the inline clone we introduced where all edges have new context). This is used when we know that edge badnesses are going only to increase (we introduced new call site) and thus all we need is to insert newly created edges into heap.
References AVAIL_AVAILABLE, bitmap_bit_p, can_inline_edge_by_limits_p(), can_inline_edge_p(), fibonacci_heap< K, V >::delete_node(), gcc_checking_assert, cgraph_node::get_summary_id(), ipa_fn_summaries, NULL, report_inline_failed_reason(), update_callee_keys(), update_edge_key(), and want_inline_small_function_p().
Referenced by inline_small_functions(), resolve_noninline_speculation(), and update_callee_keys().
|
static |
Recompute HEAP nodes for each of caller of NODE. UPDATED_NODES track nodes we already visited, to avoid redundant work. When CHECK_INLINABLITY_FOR is set, re-check for specified edge that it is inlinable. Otherwise check all edges.
References symtab_node::alias, edge_def::aux, bitmap_set_bit, can_inline_edge_by_limits_p(), can_inline_edge_p(), fibonacci_heap< K, V >::delete_node(), dyn_cast(), FOR_EACH_ALIAS, ipa_fn_summaries, NULL, ipa_ref::referring, report_inline_failed_reason(), update_caller_keys(), update_edge_key(), and want_inline_small_function_p().
Referenced by inline_small_functions(), resolve_noninline_speculation(), and update_caller_keys().
|
inlinestatic |
Recompute badness of EDGE and update its key in HEAP if needed.
References edge_def::aux, b, fibonacci_heap< K, V >::decrease_key(), dump_file, dump_flags, edge_badness(), gcc_checking_assert, fibonacci_heap< K, V >::insert(), TDF_DETAILS, sreal::to_double(), and update_edge_key().
Referenced by inline_small_functions(), update_callee_keys(), update_caller_keys(), and update_edge_key().
|
static |
Return true if we are interested in inlining small function.
References symtab_node::decl, DECL_DECLARED_INLINE_P, DECL_DISREGARD_INLINE_LIMITS, dump_enabled_p(), dump_printf_loc(), estimate_edge_growth(), estimate_min_edge_growth(), MSG_MISSED_OPTIMIZATION, num_calls(), opt_for_fn, report_inline_failed_reason(), and want_early_inline_function_p().
Referenced by early_inline_small_functions(), and want_early_inline_function_p().
|
static |
Decide if inlining NODE would reduce unit size by eliminating the offline copy of function. When COLD is true the cold calls are considered, too.
References check_callers(), growth_positive_p(), has_caller_p(), INT_MIN, NULL, and want_inline_function_to_all_callers_p().
Referenced by ipa_inline(), and want_inline_function_to_all_callers_p().
|
static |
EDGE is self recursive edge. We handle two cases - when function A is inlining into itself or when function A is being inlined into another inliner copy of function A within function B. In first case OUTER_NODE points to the toplevel copy of A, while in the second case OUTER_NODE points to the outermost copy of A in B. In both cases we want to be extra selective since inlining the call will just introduce new recursive calls to appear.
References cgraph_node::callers, can_inline_edge_by_limits_p(), CAN_INLINE_FORCE_LIMITS, CAN_INLINE_REPORT, symtab_node::decl, DECL_DECLARED_INLINE_P, dump_enabled_p(), dump_printf_loc(), i, cgraph_node::inlined_to, MSG_MISSED_OPTIMIZATION, NULL, opt_for_fn, cgraph_edge::sreal_frequency(), and want_inline_self_recursive_call_p().
Referenced by inline_small_functions(), recursive_inlining(), and want_inline_self_recursive_call_p().
|
static |
Return true if we are interested in inlining small function. When REPORT is true, report reason to dump file.
References big_speedup_p(), callee_speedup(), cgraph_inline_failed_type(), CIF_FINAL_ERROR, symtab_node::decl, DECL_DECLARED_INLINE_P, DECL_DISREGARD_INLINE_LIMITS, estimate_edge_growth(), estimate_edge_hints(), growth_positive_p(), INLINE_HINT_builtin_constant_p, INLINE_HINT_indirect_call, INLINE_HINT_known_hot, INLINE_HINT_loop_iterations, INLINE_HINT_loop_stride, inline_insns_auto(), inline_insns_single(), ipa_call_summaries, ipa_fn_summaries, ipa_fn_summary::min_size, opt_for_fn, report_inline_failed_reason(), ipa_fn_summary::time, and want_inline_small_function_p().
Referenced by add_new_edges_to_heap(), inline_small_functions(), update_callee_keys(), update_caller_keys(), and want_inline_small_function_p().
|
static |
Return true if WHERE of SIZE is a possible candidate for wrapper heuristics in estimate_edge_badness.
References symtab_node::decl, DECL_DECLARED_INLINE_P, inline_insns_auto(), inline_insns_single(), and wrapper_heuristics_may_apply().
Referenced by edge_badness(), inline_small_functions(), and wrapper_heuristics_may_apply().
|
static |
Referenced by dump_inline_stats(), and inline_small_functions().
|
static |
Statistics we collect about inlining algorithm.
|
static |
Referenced by dump_inline_stats(), ipa_inline(), and resolve_noninline_speculation().