GCC Middle and Back End API Reference
|
#include "config.h"
#include "system.h"
#include "coretypes.h"
#include "backend.h"
#include "tree.h"
#include "gimple.h"
#include "predict.h"
#include "alloc-pool.h"
#include "tree-pass.h"
#include "cgraph.h"
#include "data-streamer.h"
#include "gimple-iterator.h"
#include "ipa-utils.h"
#include "profile.h"
#include "value-prof.h"
#include "tree-inline.h"
#include "symbol-summary.h"
#include "tree-vrp.h"
#include "sreal.h"
#include "ipa-cp.h"
#include "ipa-prop.h"
#include "ipa-fnsummary.h"
Data Structures | |
struct | histogram_entry |
struct | histogram_hash |
struct | speculative_call_target |
class | speculative_call_summary |
class | ipa_profile_call_summaries |
struct | ipa_propagate_frequency_data |
Variables | |
vec< histogram_entry * > | histogram |
static object_allocator< histogram_entry > | histogram_pool ("IPA histogram") |
static ipa_profile_call_summaries * | call_sums = NULL |
|
static |
Account TIME and SIZE executed COUNT times into HISTOGRAM. HASHTABLE is the on-side hash kept to avoid duplicates.
References count, hash_table< Descriptor, Lazy, Allocator >::find_slot(), histogram, and histogram_pool.
Referenced by ipa_profile_generate_summary(), and ipa_profile_read_summary().
|
static |
Check that number of arguments of N agrees with E. Be conservative when summaries are not present.
References symtab_node::decl, cgraph_node::function_symbol(), ipa_edge_args_sum, ipa_get_cs_argument_count(), ipa_get_param_count(), ipa_node_params_sum, stdarg_p(), and TREE_TYPE.
Referenced by ipa_profile().
int cmp_counts | ( | const void * | v1, |
const void * | v2 ) |
References histogram_entry::count.
Referenced by ipa_profile_generate_summary(), and ipa_profile_read_summary().
bool contains_hot_call_p | ( | struct cgraph_node * | node | ) |
Return ture if NODE contains hot calls.
References cgraph_edge::callee, cgraph_node::callees, contains_hot_call_p(), cgraph_node::indirect_calls, cgraph_edge::inline_failed, cgraph_edge::maybe_hot_p(), and cgraph_edge::next_callee.
Referenced by contains_hot_call_p(), and ipa_propagate_frequency().
|
static |
Dump HISTOGRAM to FILE.
References count, dump_file, histogram, i, overall_size, and PRId64.
Referenced by ipa_profile().
|
static |
Simple ipa profile pass propagating frequencies across the callgraph.
References profile_probability::adjusted(), symtab_node::alias, profile_count::apply_probability(), symtab_node::aux, AVAIL_INTERPOSABLE, call_sums, cgraph_edge::callee, cgraph_node::callees, symtab_node::can_be_discarded_p(), symbol_table::cgraph_count, check_argument_count(), cgraph_edge::count, cgraph_node::count, count, symtab_node::decl, del_node_map(), symbol_table::dump(), dump_file, dump_flags, dump_histogram(), symtab_node::dump_name(), dyn_cast(), find_func_by_profile_id(), FOR_EACH_DEFINED_FUNCTION, free(), profile_probability::from_reg_br_prob_base(), gcc_assert, gcc_checking_assert, cgraph_node::get_availability(), histogram, histogram_pool, i, cgraph_node::indirect_calls, cgraph_edge::indirect_info, init_node_map(), profile_count::initialized_p(), ipa_profile_dump_all_summaries(), ipa_propagate_frequency(), ipa_reverse_postorder(), ipa_update_overall_fn_summary(), cgraph_node::local, cgraph_edge::make_speculative(), cgraph_edge::maybe_hot_p(), cgraph_edge::next_callee, symtab_node::noninterposable_alias(), NULL, opt_for_fn, symtab_node::order, overall_size, cgraph_indirect_call_info::polymorphic, possible_polymorphic_call_target_p(), PRId64, REG_BR_PROB_BASE, set_hot_bb_threshold(), speculative_call_summary::speculative_call_targets, symtab, speculative_call_target::target_id, speculative_call_target::target_probability, and TDF_DETAILS.
void ipa_profile_cc_finalize | ( | void | ) |
Reset all state within ipa-profile.cc so that we can rerun the compiler within the same process. For use by toplev::finalize.
References call_sums, and NULL.
Referenced by toplev::finalize().
|
static |
Dump all profile summary data for all cgraph nodes and edges to file F.
References call_sums, speculative_call_summary::dump(), dump_file, symtab_node::dump_name(), FOR_EACH_FUNCTION_WITH_GIMPLE_BODY, cgraph_node::indirect_calls, and cgraph_edge::next_callee.
Referenced by ipa_profile().
|
static |
Collect histogram and speculative target summaries from CFG profiles.
References account_time_size(), call_sums, cmp_counts(), basic_block_def::count, count, symtab_node::decl, DECL_STRUCT_FUNCTION, dump_file, eni_size_weights, eni_time_weights, ENTRY_BLOCK_PTR_FOR_FN, estimate_num_insns(), FOR_EACH_BB_FN, FOR_EACH_FUNCTION_WITH_GIMPLE_BODY, gcc_checking_assert, GCOV_COMPUTE_SCALE, GCOV_TOPN_MAXIMUM_TRACKED_VALUES, cgraph_node::get_edge(), get_nth_most_common_value(), gimple_call_fndecl(), gimple_histogram_value_of_type(), gimple_remove_histogram_value(), gsi_end_p(), gsi_next(), gsi_start_bb(), gsi_stmt(), HIST_TYPE_INDIR_CALL, histogram, cgraph_edge::indirect_unknown_callee, profile_count::initialized_p(), profile_count::ipa(), profile_count::ipa_p(), NULL, speculative_call_summary::speculative_call_targets, symtab, and profile_count::to_gcov_type().
|
static |
Read speculative targets information about edge for LTO WPA.
References call_sums, gcc_assert, GCOV_TOPN_MAXIMUM_TRACKED_VALUES, i, speculative_call_summary::speculative_call_targets, and streamer_read_hwi().
Referenced by ipa_profile_read_summary_section().
|
static |
Deserialize the IPA histogram and speculative targets summary info for LTO.
References account_time_size(), call_sums, cmp_counts(), count, lto_input_block::file_data, gcc_checking_assert, histogram, ipa_profile_read_summary_section(), lto_input_block::len, lto_create_simple_input_block(), lto_destroy_simple_input_block(), lto_get_file_decl_data(), LTO_section_ipa_profile, streamer_read_gcov_count(), streamer_read_uhwi(), and symtab.
|
static |
Read profile speculative targets section information for LTO WPA.
References count, dyn_cast(), i, cgraph_node::indirect_calls, ipa_profile_read_edge_summary(), lto_symtab_encoder_deref(), cgraph_edge::next_callee, streamer_read_uhwi(), and lto_file_decl_data::symtab_node_encoder.
Referenced by ipa_profile_read_summary().
|
static |
Serialize the speculative summary info for LTO.
References gcc_assert, GCOV_TOPN_MAXIMUM_TRACKED_VALUES, i, lto_simple_output_block::main_stream, speculative_call_summary::speculative_call_targets, streamer_write_hwi_stream(), speculative_call_target::target_id, and speculative_call_target::target_probability.
Referenced by ipa_profile_write_summary().
|
static |
Serialize the ipa info for lto.
References call_sums, count, lto_simple_output_block::decl_state, symtab_node::definition, cgraph_node::has_gimple_body_p(), histogram, i, cgraph_node::indirect_calls, ipa_profile_write_edge_summary(), lsei_cgraph_node(), lsei_end_p(), lsei_next_function_in_partition(), lsei_start_function_in_partition(), lto_create_simple_output_block(), lto_destroy_simple_output_block(), LTO_section_ipa_profile, lto_symtab_encoder_encode(), lto_simple_output_block::main_stream, cgraph_edge::next_callee, streamer_write_gcov_count_stream(), streamer_write_uhwi_stream(), and lto_out_decl_state::symtab_node_encoder.
bool ipa_propagate_frequency | ( | struct cgraph_node * | node | ) |
See if the frequency of NODE can be updated based on frequencies of its callers.
References symtab_node::alias, symtab_node::analyzed, cgraph_node::call_for_symbol_and_aliases(), changed, contains_hot_call_p(), cgraph_node::count, symtab_node::decl, DECL_VIRTUAL_P, dump_file, dump_flags, symtab_node::dump_name(), cgraph_node::frequency, gcc_assert, get_hot_bb_threshold(), ipa_propagate_frequency_1(), cgraph_node::local, ipa_propagate_frequency_data::maybe_executed_once, ipa_propagate_frequency_data::maybe_unlikely_executed, NODE_FREQUENCY_EXECUTED_ONCE, NODE_FREQUENCY_HOT, NODE_FREQUENCY_NORMAL, NODE_FREQUENCY_UNLIKELY_EXECUTED, cgraph_node::only_called_at_exit, ipa_propagate_frequency_data::only_called_at_exit, cgraph_node::only_called_at_startup, ipa_propagate_frequency_data::only_called_at_startup, opt_for_fn, TDF_DETAILS, and profile_count::zero().
Referenced by inline_update_callee_summaries(), ipa_profile(), and symbol_table::remove_unreachable_nodes().
|
static |
Worker for ipa_propagate_frequency_1.
References cgraph_node::callers, DECL_NAME, dump_file, dump_flags, ipa_propagate_frequency_data::function_symbol, ipa_call_summaries, ipa_call_summary::loop_depth, MAIN_NAME_P, ipa_propagate_frequency_data::maybe_executed_once, ipa_propagate_frequency_data::maybe_unlikely_executed, cgraph_edge::next_caller, NODE_FREQUENCY_EXECUTED_ONCE, NODE_FREQUENCY_HOT, NODE_FREQUENCY_NORMAL, NODE_FREQUENCY_UNLIKELY_EXECUTED, NULL, ipa_propagate_frequency_data::only_called_at_exit, ipa_propagate_frequency_data::only_called_at_startup, profile_info, TDF_DETAILS, and profile_count::zero().
Referenced by ipa_propagate_frequency().
ipa_opt_pass_d * make_pass_ipa_profile | ( | gcc::context * | ctxt | ) |
|
static |
vec<histogram_entry *> histogram |
Histogram of profile values. The histogram is represented as an ordered vector of entries allocated via histogram_pool. During construction a separate hashtable is kept to lookup duplicate entries.
Referenced by account_time_size(), ipa_icf::sem_item_optimizer::dump_cong_classes(), dump_histogram(), dump_ic_profile(), gimple_divmod_fixed_value_transform(), gimple_mod_pow2_value_transform(), gimple_mod_subtract_transform(), gimple_stringops_transform(), ipa_profile(), ipa_profile_generate_summary(), ipa_profile_read_summary(), ipa_profile_write_summary(), and stringop_block_profile().
|
static |
Referenced by account_time_size(), and ipa_profile().