GCC Middle and Back End API Reference
|
#include "config.h"
#include "system.h"
#include "coretypes.h"
#include "backend.h"
#include "rtl.h"
#include "tree.h"
#include "gimple.h"
#include "cfghooks.h"
#include "ssa.h"
#include "cgraph.h"
#include "coverage.h"
#include "data-streamer.h"
#include "diagnostic.h"
#include "fold-const.h"
#include "tree-nested.h"
#include "calls.h"
#include "expr.h"
#include "value-prof.h"
#include "tree-eh.h"
#include "gimplify.h"
#include "gimple-iterator.h"
#include "tree-cfg.h"
#include "gimple-pretty-print.h"
#include "dumpfile.h"
#include "builtins.h"
Typedefs | |
typedef int_hash< unsigned int, 0, UINT_MAX > | profile_id_hash |
Variables | |
static bool | error_found = false |
static hash_map< profile_id_hash, cgraph_node * > * | cgraph_node_map = 0 |
typedef int_hash<unsigned int, 0, UINT_MAX> profile_id_hash |
|
static |
The overall number of invocations of the counter should match execution count of basic block. Report it as error rather than internal error as it might mean that user has misused the profile somehow.
References count, current_function_decl, dump_enabled_p(), dump_printf_loc(), error_at(), dump_user_location_t::from_function_decl(), dump_user_location_t::get_location_t(), profile_count::ipa(), MSG_MISSED_OPTIMIZATION, NULL, and profile_count::to_gcov_type().
Referenced by get_nth_most_common_value(), gimple_mod_pow2_value_transform(), gimple_mod_subtract_transform(), and gimple_stringops_transform().
bool coverage_node_map_initialized_p | ( | void | ) |
Returns true if node graph is initialized. This is used to test if profile_id has been created for cgraph_nodes.
References cgraph_node_map.
Referenced by coverage_begin_function(), coverage_end_function(), and get_coverage_counts().
void del_node_map | ( | void | ) |
Delete the CGRAPH_NODE_MAP.
References cgraph_node_map.
Referenced by ipa_profile(), and tree_profiling().
|
static |
Dump information about HIST to DUMP_FILE.
References count, histogram_value_t::counters, dump_file, gcc_unreachable, histogram_value_t::hdata, HIST_TYPE_AVERAGE, HIST_TYPE_INDIR_CALL, HIST_TYPE_INTERVAL, HIST_TYPE_IOR, HIST_TYPE_POW2, HIST_TYPE_TIME_PROFILE, HIST_TYPE_TOPN_VALUES, histogram_value_t::hvalue, i, histogram_value_t::int_start, histogram_value_t::intvl, PRId64, histogram_value_t::steps, and histogram_value_t::type.
Referenced by dump_histograms_for_stmt(), gimple_find_values_to_profile(), verify_histograms(), and visit_hist().
Dump all histograms attached to STMT to DUMP_FILE.
References dump_file, dump_histogram_value(), gimple_histogram_value(), histogram_value_t::hvalue, and histogram_value_t::next.
Referenced by gimple_dump_bb_buff(), and gimple_value_profile_transformations().
|
static |
Dump info about indirect call profile.
References cfun, count, symtab_node::decl, dump_printf_loc(), dyn_cast(), find_func_by_profile_id(), GCOV_TOPN_MAXIMUM_TRACKED_VALUES, get_nth_most_common_value(), gimple_call_fn(), gimple_call_fndecl(), gimple_call_internal_p(), gimple_histogram_value_of_type(), gsi_stmt(), HIST_TYPE_INDIR_CALL, histogram, MSG_MISSED_OPTIMIZATION, MSG_NOTE, MSG_OPTIMIZED_LOCATIONS, NULL, NULL_TREE, and PRId64.
Referenced by gimple_value_profile_transformations().
struct cgraph_node * find_func_by_profile_id | ( | int | profile_id | ) |
Return cgraph node for function with pid
References cgraph_node_map, cgraph_node::get(), NULL, and cgraph_node::profile_id.
Referenced by speculative_call_summary::dump(), dump_ic_profile(), and ipa_profile().
|
static |
Helper function for verify_histograms. For each histogram reachable via htab walk verify that it was reached via statement walk.
References histogram_value_t::counters, free(), and histogram_value_t::hvalue.
Referenced by free_histograms().
void free_histograms | ( | struct function * | fn | ) |
References free_hist(), NULL, and VALUE_HISTOGRAMS.
Referenced by release_function_body().
bool get_nth_most_common_value | ( | gimple * | stmt, |
const char * | counter_type, | ||
histogram_value | hist, | ||
gcov_type * | value, | ||
gcov_type * | count, | ||
gcov_type * | all, | ||
unsigned | n ) |
Return the n-th value count of TOPN_VALUE histogram. If there's a value, return true and set VALUE and COUNT arguments. Counters have the following meaning. abs (counters[0]) is the number of executions for i in 0 ... TOPN-1 counters[2 * i + 2] is target counters[2 * i + 3] is corresponding hitrate counter. Value of counters[0] negative when counter became full during merging and some values are lost.
References abs_hwi(), check_counter(), count, histogram_value_t::counters, dump_file, gimple_bb(), histogram_value_t::hvalue, i, PROFILE_REPRODUCIBILITY_MULTITHREADED, and PROFILE_REPRODUCIBILITY_PARALLEL_RUNS.
Referenced by dump_ic_profile(), gimple_divmod_fixed_value_transform(), gimple_stringops_transform(), and ipa_profile_generate_summary().
void gimple_add_histogram_value | ( | struct function * | fun, |
gimple * | stmt, | ||
histogram_value | hist ) |
Add histogram for STMT.
References histogram_value_t::fun, gimple_histogram_value(), histogram_value_t::hvalue, histogram_value_t::next, and set_histogram_value().
Referenced by autofdo::afdo_indirect_call(), compute_value_histograms(), gimple_duplicate_stmt_histograms(), and stream_in_histogram_value().
histogram_value gimple_alloc_histogram_value | ( | struct function * | fun, |
enum hist_type | type, | ||
gimple * | stmt, | ||
tree | value ) |
Allocate histogram value.
References histogram_value_t::hvalue, histogram_value_t::stmt, histogram_value_t::type, type(), and histogram_value_t::value.
Referenced by autofdo::afdo_indirect_call(), gimple_divmod_values_to_profile(), gimple_duplicate_stmt_histograms(), gimple_find_values_to_profile(), gimple_indirect_call_to_profile(), gimple_stringops_values_to_profile(), and stream_in_histogram_value().
|
static |
Generate code for transformation 1 (with parent gimple assignment STMT and probability of taking the optimal path PROB, which is equivalent to COUNT/ALL within roundoff error). This generates the result into a temp and returns the temp; it does not replace or alter the original STMT.
References profile_probability::always(), basic_block_def::count, count, create_tmp_reg(), fold_convert, profile_count::from_gcov_type(), gcc_assert, gimple_assign_lhs(), gimple_assign_rhs1(), gimple_assign_rhs2(), gimple_assign_rhs_code(), gimple_bb(), gimple_build_assign(), gimple_build_cond(), gsi_for_stmt(), gsi_insert_before(), GSI_SAME_STMT, profile_probability::invert(), is_gimple_assign(), make_edge(), make_temp_ssa_name(), NULL, NULL_TREE, remove_edge(), split_block(), and TREE_TYPE.
Referenced by gimple_divmod_fixed_value_transform().
|
static |
Transformations based on profile information for values. Copyright (C) 2003-2024 Free Software Foundation, Inc. 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/>.
In this file value profile based optimizations are placed. Currently the following optimizations are implemented (for more detailed descriptions see comments at value_profile_transformations): 1) Division/modulo specialization. Provided that we can determine that the operands of the division have some special properties, we may use it to produce more effective code. 2) Indirect/virtual call specialization. If we can determine most common function callee in indirect/virtual call. We can use this information to improve code effectiveness (especially info for the inliner). 3) Speculative prefetching. If we are able to determine that the difference between addresses accessed by a memory reference is usually constant, we may add the prefetch instructions. FIXME: This transformation was removed together with RTL based value profiling. Value profiling internals ========================== Every value profiling transformation starts with defining what values to profile. There are different histogram types (see HIST_TYPE_* in value-prof.h) and each transformation can request one or more histogram types per GIMPLE statement. The function gimple_find_values_to_profile() collects the values to profile in a vec, and adds the number of counters required for the different histogram types. For a -fprofile-generate run, the statements for which values should be recorded, are instrumented in instrument_values(). The instrumentation is done by helper functions that can be found in tree-profile.cc, where new types of histograms can be added if necessary. After a -fprofile-use, the value profiling data is read back in by compute_value_histograms() that translates the collected data to histograms and attaches them to the profiled statements via gimple_add_histogram_value(). Histograms are stored in a hash table that is attached to every intrumented function, see VALUE_HISTOGRAMS in function.h. The value-profile transformations driver is the function gimple_value_profile_transformations(). It traverses all statements in the to-be-transformed function, and looks for statements with one or more histograms attached to it. If a statement has histograms, the transformation functions are called on the statement. Limitations / FIXME / TODO: * Only one histogram of each type can be associated with a statement. * Some value profile transformations are done in builtins.cc (?!) * Updating of histograms needs some TLC. * The value profiling code could be used to record analysis results from non-profiling (e.g. VRP). * Adding new profilers should be simplified, starting with a cleanup of what-happens-where and with making gimple_find_values_to_profile and gimple_value_profile_transformations table-driven, perhaps...
Do transform 1) on INSN if applicable.
References a, build_int_cst(), cfun, count, dump_enabled_p(), dump_printf_loc(), dyn_cast(), wide_int_storage::from_array(), get_gcov_type(), get_nth_most_common_value(), gimple_assign_lhs(), gimple_assign_rhs2(), gimple_assign_rhs_code(), gimple_assign_set_rhs_from_tree(), gimple_bb(), gimple_divmod_fixed_value(), gimple_histogram_value_of_type(), gimple_remove_histogram_value(), gsi_stmt(), HIST_TYPE_TOPN_VALUES, histogram, HOST_BITS_PER_WIDE_INT, INTEGRAL_TYPE_P, MSG_OPTIMIZED_LOCATIONS, profile_probability::never(), optimize_bb_for_size_p(), profile_probability::probability_in_gcov_type(), si, simple_cst_equal(), TREE_TYPE, TYPE_PRECISION, update_stmt(), and wide_int_to_tree().
Referenced by gimple_value_profile_transformations().
|
static |
Find values inside STMT for that we want to measure histograms for division/modulo optimization.
References build2(), cfun, gimple_alloc_histogram_value(), gimple_assign_lhs(), gimple_assign_rhs1(), gimple_assign_rhs2(), gimple_assign_rhs_code(), histogram_value_t::hdata, HIST_TYPE_INTERVAL, HIST_TYPE_POW2, HIST_TYPE_TOPN_VALUES, histogram_value_t::int_start, INTEGRAL_TYPE_P, histogram_value_t::intvl, histogram_value_t::steps, TREE_CODE, TREE_TYPE, type(), and TYPE_UNSIGNED.
Referenced by gimple_values_to_profile().
void gimple_duplicate_stmt_histograms | ( | struct function * | fun, |
gimple * | stmt, | ||
struct function * | ofun, | ||
gimple * | ostmt ) |
Duplicate all histograms associates with OSTMT to STMT.
References histogram_value_t::counters, gimple_add_histogram_value(), gimple_alloc_histogram_value(), gimple_histogram_value(), histogram_value_t::hvalue, histogram_value_t::n_counters, histogram_value_t::next, NULL, histogram_value_t::stmt, and histogram_value_t::type.
Referenced by copy_bb(), gimple_duplicate_bb(), gsi_replace(), and move_block_to_fn().
void gimple_find_values_to_profile | ( | histogram_values * | values | ) |
References cfun, dump_file, dump_histogram_value(), FOR_EACH_BB_FN, FOR_EACH_VEC_ELT, gcc_unreachable, GCOV_TOPN_MEM_COUNTERS, gimple_alloc_histogram_value(), gimple_values_to_profile(), gsi_end_p(), gsi_next(), gsi_start_bb(), gsi_stmt(), histogram_value_t::hdata, HIST_TYPE_AVERAGE, HIST_TYPE_INDIR_CALL, HIST_TYPE_INTERVAL, HIST_TYPE_IOR, HIST_TYPE_POW2, HIST_TYPE_TIME_PROFILE, HIST_TYPE_TOPN_VALUES, histogram_value_t::hvalue, i, histogram_value_t::intvl, histogram_value_t::n_counters, NULL, print_gimple_stmt(), histogram_value_t::steps, histogram_value_t::stmt, TDF_SLIM, and histogram_value_t::type.
Referenced by branch_prob().
histogram_value gimple_histogram_value | ( | struct function * | fun, |
gimple * | stmt ) |
Get histogram list for STMT.
References NULL, and VALUE_HISTOGRAMS.
Referenced by dump_histograms_for_stmt(), gimple_add_histogram_value(), gimple_duplicate_stmt_histograms(), gimple_histogram_value_of_type(), gimple_move_stmt_histograms(), gimple_remove_histogram_value(), gimple_remove_stmt_histograms(), gimple_value_profile_transformations(), output_gimple_stmt(), and verify_histograms().
histogram_value gimple_histogram_value_of_type | ( | struct function * | fun, |
gimple * | stmt, | ||
enum hist_type | type ) |
Lookup histogram of type TYPE in the STMT.
References gimple_histogram_value(), histogram_value_t::hvalue, histogram_value_t::next, NULL, and histogram_value_t::type.
Referenced by dump_ic_profile(), gimple_divmod_fixed_value_transform(), gimple_mod_pow2_value_transform(), gimple_mod_subtract_transform(), gimple_stringops_transform(), ipa_profile_generate_summary(), and stringop_block_profile().
gcall * gimple_ic | ( | gcall * | icall_stmt, |
struct cgraph_node * | direct_call, | ||
profile_probability | prob ) |
Do transformation if (actual_callee_address == address_of_most_common_function/method) do direct call else old call
References add_phi_arg(), add_stmt_to_eh_lp(), profile_probability::always(), profile_count::apply_probability(), as_a(), build_addr(), cfun, basic_block_def::count, create_phi_node(), symtab_node::decl, duplicate_ssa_name(), ECF_NORETURN, find_fallthru_edge(), basic_block_def::flags, flags_from_decl_or_type(), fold_convert, FOR_EACH_EDGE, gimple_bb(), gimple_build_assign(), gimple_build_cond(), gimple_call_fn(), gimple_call_lhs(), gimple_call_set_fndecl(), gimple_call_set_lhs(), gimple_copy(), gimple_purge_dead_eh_edges(), gimple_set_vdef(), gimple_set_vuse(), gimple_vdef(), gsi_end_p(), gsi_for_stmt(), gsi_insert_before(), gsi_next(), GSI_SAME_STMT, gsi_start_phis(), profile_probability::invert(), lookup_stmt_eh_lp(), make_edge(), make_temp_ssa_name(), NULL, NULL_TREE, PHI_ARG_DEF_FROM_EDGE, PHI_ARG_DEF_PTR_FROM_EDGE, ptr_type_node, release_ssa_name(), remove_edge(), SET_USE, should_remove_lhs_p(), single_pred_edge(), split_block(), split_edge(), stmt_could_throw_p(), stmt_ends_bb_p(), basic_block_def::succs, TREE_CODE, UNKNOWN_LOCATION, unlink_stmt_vdef(), unshare_expr(), and update_stmt().
Referenced by cgraph_edge::redirect_call_stmt_to_callee().
|
static |
Find calls inside STMT for that we want to measure histograms for indirect/virtual call optimization.
References cfun, gimple_alloc_histogram_value(), gimple_call_fn(), gimple_call_fndecl(), gimple_call_internal_p(), HIST_TYPE_INDIR_CALL, and NULL_TREE.
Referenced by gimple_values_to_profile().
|
static |
Generate code for transformation 2 (with parent gimple assign STMT and probability of taking the optimal path PROB, which is equivalent to COUNT/ALL within roundoff error). This generates the result into a temp and returns the temp; it does not replace or alter the original STMT.
References profile_probability::always(), build_int_cst(), basic_block_def::count, count, create_tmp_reg(), profile_count::from_gcov_type(), gcc_assert, gimple_assign_lhs(), gimple_assign_rhs1(), gimple_assign_rhs2(), gimple_assign_rhs_code(), gimple_bb(), gimple_build_assign(), gimple_build_cond(), gsi_for_stmt(), gsi_insert_before(), GSI_SAME_STMT, profile_probability::invert(), is_gimple_assign(), make_edge(), make_temp_ssa_name(), NULL, NULL_TREE, remove_edge(), split_block(), and TREE_TYPE.
Referenced by gimple_mod_pow2_value_transform().
|
static |
Do transform 2) on INSN if applicable.
References cfun, check_counter(), count, dump_enabled_p(), dump_printf_loc(), dyn_cast(), gimple_assign_lhs(), gimple_assign_rhs2(), gimple_assign_rhs_code(), gimple_assign_set_rhs_from_tree(), gimple_bb(), gimple_histogram_value_of_type(), gimple_mod_pow2(), gimple_remove_histogram_value(), gsi_stmt(), HIST_TYPE_POW2, histogram, INTEGRAL_TYPE_P, MSG_OPTIMIZED_LOCATIONS, profile_probability::never(), optimize_bb_for_size_p(), profile_probability::probability_in_gcov_type(), si, simple_cst_equal(), TREE_TYPE, TYPE_UNSIGNED, and update_stmt().
Referenced by gimple_value_profile_transformations().
|
static |
Generate code for transformations 3 and 4 (with parent gimple assign STMT, and NCOUNTS the number of cases to support. Currently only NCOUNTS==0 or 1 is supported and this is built into this interface. The probabilities of taking the optimal paths are PROB1 and PROB2, which are equivalent to COUNT1/ALL and COUNT2/ALL respectively within roundoff error). This generates the result into a temp and returns the temp; it does not replace or alter the original STMT.
FIXME: Generalize the interface to handle NCOUNTS > 1.
References profile_probability::always(), basic_block_def::count, create_tmp_reg(), profile_count::from_gcov_type(), gcc_assert, gimple_assign_lhs(), gimple_assign_rhs1(), gimple_assign_rhs2(), gimple_assign_rhs_code(), gimple_bb(), gimple_build_assign(), gimple_build_cond(), gsi_for_stmt(), gsi_insert_before(), GSI_SAME_STMT, profile_probability::invert(), is_gimple_assign(), make_edge(), make_temp_ssa_name(), NULL, NULL_TREE, split_block(), and TREE_TYPE.
Referenced by gimple_mod_subtract_transform().
|
static |
Do transforms 3) and 4) on the statement pointed-to by SI if applicable.
References cfun, check_counter(), count, dump_enabled_p(), dump_printf_loc(), dyn_cast(), profile_probability::even(), gcc_assert, gimple_assign_lhs(), gimple_assign_rhs_code(), gimple_assign_set_rhs_from_tree(), gimple_bb(), gimple_histogram_value_of_type(), gimple_mod_subtract(), gimple_remove_histogram_value(), gsi_stmt(), HIST_TYPE_INTERVAL, histogram, i, INTEGRAL_TYPE_P, MSG_OPTIMIZED_LOCATIONS, profile_probability::never(), optimize_bb_for_size_p(), profile_probability::probability_in_gcov_type(), si, TREE_TYPE, TYPE_UNSIGNED, and update_stmt().
Referenced by gimple_value_profile_transformations().
Move all histograms associated with OSTMT to STMT.
References gimple_histogram_value(), histogram_value_t::hvalue, histogram_value_t::next, NULL, set_histogram_value(), and histogram_value_t::stmt.
void gimple_remove_histogram_value | ( | struct function * | fun, |
gimple * | stmt, | ||
histogram_value | hist ) |
Remove histogram HIST from STMT's histogram list.
References histogram_value_t::counters, free(), gimple_histogram_value(), histogram_value_t::hvalue, histogram_value_t::next, and set_histogram_value().
Referenced by autofdo::afdo_indirect_call(), gimple_divmod_fixed_value_transform(), gimple_mod_pow2_value_transform(), gimple_mod_subtract_transform(), gimple_remove_stmt_histograms(), gimple_stringops_transform(), ipa_profile_generate_summary(), and stringop_block_profile().
Remove all histograms associated with STMT.
References gimple_histogram_value(), gimple_remove_histogram_value(), and NULL.
Referenced by gsi_remove(), gsi_replace(), and move_block_to_fn().
|
static |
Convert stringop (..., vcall_size) into if (vcall_size == icall_size) stringop (..., icall_size); else stringop (..., vcall_size); assuming we'll propagate a true constant into ICALL_SIZE later.
References add_phi_arg(), profile_probability::always(), as_a(), cfun, basic_block_def::count, count, create_phi_node(), duplicate_ssa_name(), fold_convert, profile_count::from_gcov_type(), gcc_assert, gcc_unreachable, gimple_bb(), gimple_build_assign(), gimple_build_cond(), gimple_call_arg(), gimple_call_lhs(), gimple_call_set_arg(), gimple_call_set_lhs(), gimple_copy(), gimple_set_vdef(), gimple_set_vuse(), gimple_vdef(), gsi_for_stmt(), gsi_insert_before(), GSI_SAME_STMT, interesting_stringop_to_profile_p(), profile_probability::invert(), make_edge(), make_temp_ssa_name(), NULL, NULL_TREE, release_ssa_name(), remove_edge(), split_block(), stmt_could_throw_p(), TREE_CODE, TREE_TYPE, UNKNOWN_LOCATION, unlink_stmt_vdef(), and update_stmt().
Referenced by gimple_stringops_transform().
|
static |
Find values inside STMT for that we want to measure histograms for division/modulo optimization.
References a, build_int_cst(), built_in_names, BUILT_IN_NORMAL, builtin_memset_read_str(), can_move_by_pieces(), can_store_by_pieces(), cfun, check_counter(), count, DECL_FUNCTION_CODE(), dump_enabled_p(), dump_printf_loc(), dyn_cast(), wide_int_storage::from_array(), gcc_unreachable, get_gcov_type(), get_nth_most_common_value(), get_pointer_alignment(), gimple_bb(), gimple_call_arg(), gimple_call_builtin_p(), gimple_call_fndecl(), gimple_histogram_value_of_type(), gimple_remove_histogram_value(), gimple_stringop_fixed_value(), gsi_stmt(), HIST_TYPE_TOPN_VALUES, histogram, HOST_BITS_PER_WIDE_INT, integer_zero_node, interesting_stringop_to_profile_p(), MIN, MSG_OPTIMIZED_LOCATIONS, profile_probability::never(), optimize_bb_for_size_p(), profile_probability::probability_in_gcov_type(), TREE_CODE, TYPE_PRECISION, and wide_int_to_tree().
Referenced by gimple_value_profile_transformations().
|
static |
Find values inside STMT for that we want to measure histograms for string operations.
References BUILT_IN_NORMAL, cfun, dyn_cast(), gimple_alloc_histogram_value(), gimple_call_arg(), gimple_call_builtin_p(), HIST_TYPE_AVERAGE, HIST_TYPE_IOR, HIST_TYPE_TOPN_VALUES, interesting_stringop_to_profile_p(), and TREE_CODE.
Referenced by gimple_values_to_profile().
bool gimple_value_profile_transformations | ( | void | ) |
GIMPLE based transformations.
References cfun, changed, dump_enabled_p(), dump_file, dump_histograms_for_stmt(), dump_ic_profile(), FOR_EACH_BB_FN, gimple_bb(), gimple_divmod_fixed_value_transform(), gimple_histogram_value(), gimple_mod_pow2_value_transform(), gimple_mod_subtract_transform(), gimple_stringops_transform(), gsi_end_p(), gsi_for_stmt(), gsi_next(), gsi_start_bb(), gsi_stmt(), print_gimple_stmt(), and TDF_SLIM.
Referenced by autofdo::afdo_annotate_cfg(), and tree_profiling().
|
static |
Find values inside STMT for that we want to measure histograms and adds them to list VALUES.
References gimple_divmod_values_to_profile(), gimple_indirect_call_to_profile(), and gimple_stringops_values_to_profile().
Referenced by gimple_find_values_to_profile().
|
static |
Return nonzero if statement for histogram_value X is Y.
References y.
Referenced by set_histogram_value().
|
static |
Hash value for histogram.
void init_node_map | ( | bool | local | ) |
Initialize map from PROFILE_ID to CGRAPH_NODE. When LOCAL is true, the PROFILE_IDs are computed. when it is false we assume that the PROFILE_IDs was already assigned.
References cgraph_node_map, coverage_compute_profile_id(), symtab_node::decl, dump_enabled_p(), symtab_node::dump_name(), dump_printf_loc(), FOR_EACH_DEFINED_FUNCTION, dump_user_location_t::from_function_decl(), cgraph_node::get(), cgraph_node::has_gimple_body_p(), cgraph_node::local, MSG_MISSED_OPTIMIZATION, NULL, cgraph_node::profile_id, and cgraph_node::thunk.
Referenced by autofdo::auto_profile(), ipa_profile(), and tree_profiling().
Return true if the stringop CALL shall be profiled. SIZE_ARG be set to the argument index for the size of the string operation.
References DECL_FUNCTION_CODE(), gimple_call_fndecl(), and validate_gimple_arglist().
Referenced by gimple_stringop_fixed_value(), gimple_stringops_transform(), and gimple_stringops_values_to_profile().
|
static |
Set histogram for STMT.
References histogram_eq(), NULL, and VALUE_HISTOGRAMS.
Referenced by gimple_add_histogram_value(), gimple_move_stmt_histograms(), and gimple_remove_histogram_value().
void stream_in_histogram_value | ( | class lto_input_block * | ib, |
gimple * | stmt ) |
Dump information about HIST to DUMP_FILE.
References bp_unpack_enum, bp_unpack_value(), cfun, histogram_value_t::counters, gcc_unreachable, gimple_add_histogram_value(), gimple_alloc_histogram_value(), histogram_value_t::hdata, HIST_TYPE_AVERAGE, HIST_TYPE_INDIR_CALL, HIST_TYPE_INTERVAL, HIST_TYPE_IOR, HIST_TYPE_MAX, HIST_TYPE_POW2, HIST_TYPE_TIME_PROFILE, HIST_TYPE_TOPN_VALUES, histogram_value_t::hvalue, i, histogram_value_t::int_start, histogram_value_t::intvl, histogram_value_t::n_counters, histogram_value_t::next, NULL, histogram_value_t::steps, streamer_read_bitpack(), streamer_read_gcov_count(), streamer_read_hwi(), streamer_read_uhwi(), and type().
Referenced by input_gimple_stmt().
void stream_out_histogram_value | ( | struct output_block * | ob, |
histogram_value | hist ) |
Dump information about HIST to DUMP_FILE.
References bitpack_create(), bp_pack_enum, bp_pack_value(), histogram_value_t::counters, histogram_value_t::hdata, HIST_TYPE_INTERVAL, HIST_TYPE_MAX, histogram_value_t::hvalue, i, histogram_value_t::int_start, histogram_value_t::intvl, output_block::main_stream, histogram_value_t::n_counters, histogram_value_t::next, NULL, histogram_value_t::steps, stream_out_histogram_value(), streamer_write_bitpack(), streamer_write_gcov_count(), streamer_write_hwi(), streamer_write_uhwi(), and histogram_value_t::type.
Referenced by output_gimple_stmt(), and stream_out_histogram_value().
void stringop_block_profile | ( | gimple * | stmt, |
unsigned int * | expected_align, | ||
HOST_WIDE_INT * | expected_size ) |
References cfun, count, gimple_histogram_value_of_type(), gimple_remove_histogram_value(), HIST_TYPE_AVERAGE, HIST_TYPE_IOR, histogram, INT_MAX, and UINT_MAX.
Referenced by expand_builtin_memory_copy_args(), and expand_builtin_memset_args().
DEBUG_FUNCTION void verify_histograms | ( | void | ) |
Verify sanity of the histograms.
References hash_set< KeyId, Lazy, Traits >::add(), cfun, debug_gimple_stmt(), dump_histogram_value(), error(), error_found, FOR_EACH_BB_FN, gimple_histogram_value(), gsi_end_p(), gsi_next(), gsi_start_bb(), gsi_stmt(), histogram_value_t::hvalue, internal_error(), histogram_value_t::next, histogram_value_t::stmt, VALUE_HISTOGRAMS, and visit_hist().
Referenced by verify_gimple_in_cfg().
|
static |
Helper function for verify_histograms. For each histogram reachable via htab walk verify that it was reached via statement walk.
References debug_gimple_stmt(), dump_histogram_value(), error(), error_found, HIST_TYPE_TIME_PROFILE, histogram_value_t::hvalue, histogram_value_t::stmt, histogram_value_t::type, and visited.
Referenced by verify_histograms().
|
static |
Referenced by coverage_node_map_initialized_p(), del_node_map(), find_func_by_profile_id(), and init_node_map().