GCC Middle and Back End API Reference
|
Public Member Functions | |
~autofdo_source_profile () | |
function_instance * | get_function_instance_by_decl (tree decl) const |
function_instance * | get_function_instance_by_name_index (int) const |
void | add_function_instance (function_instance *) |
bool | get_count_info (gimple *stmt, count_info *info, cgraph_node *node=NULL) const |
bool | get_count_info (location_t gimple_loc, count_info *info, cgraph_node *node=NULL) const |
gcov_type | get_callsite_total_count (struct cgraph_edge *edge) const |
bool | update_inlined_ind_target (gcall *stmt, count_info *info, cgraph_node *node) |
void | remove_icall_target (cgraph_edge *e) |
void | offline_external_functions () |
void | offline_unrealized_inlines () |
Static Public Member Functions | |
static autofdo_source_profile * | create () |
Private Types | |
typedef std::map< unsigned, function_instance * > | name_function_instance_map |
Private Member Functions | |
autofdo_source_profile () | |
bool | read () |
function_instance * | get_function_instance_by_inline_stack (const inline_stack &stack) const |
Private Attributes | |
name_function_instance_map | map_ |
auto_vec< function_instance * > | duplicate_functions_ |
Profile for all functions.
|
private |
autofdo::autofdo_source_profile::~autofdo_source_profile | ( | ) |
Member functions for autofdo_source_profile.
References map_.
|
inlineprivate |
Referenced by create().
void autofdo::autofdo_source_profile::add_function_instance | ( | function_instance * | fn | ) |
Add function instance FN.
References gcc_checking_assert, map_, and autofdo::function_instance::name().
|
inlinestatic |
References autofdo_source_profile(), map, and NULL.
Referenced by autofdo::read_profile().
gcov_type autofdo::autofdo_source_profile::get_callsite_total_count | ( | struct cgraph_edge * | edge | ) | const |
Find total count of the callee of EDGE.
References autofdo::afdo_count_scale, autofdo::afdo_string_table, dump_file, autofdo::dump_inline_stack(), get_function_instance_by_inline_stack(), autofdo::get_inline_stack_in_node(), gimple_location(), NULL, autofdo::raw_symbol_name(), and UNKNOWN_LOCATION.
bool autofdo::autofdo_source_profile::get_count_info | ( | gimple * | stmt, |
count_info * | info, | ||
cgraph_node * | node = NULL ) const |
Find count_info for a given gimple STMT. If found, store the count_info in INFO and return true; otherwise return false.
References get_count_info(), and gimple_location().
Referenced by get_count_info(), and update_inlined_ind_target().
bool autofdo::autofdo_source_profile::get_count_info | ( | location_t | gimple_loc, |
count_info * | info, | ||
cgraph_node * | node = NULL ) const |
References cfun, get_function_instance_by_inline_stack(), autofdo::get_inline_stack_in_node(), LOCATION_LOCUS, and NULL.
function_instance * autofdo::autofdo_source_profile::get_function_instance_by_decl | ( | tree | decl | ) | const |
For a given DECL, returns the top-level function_instance.
References autofdo::afdo_string_table, map_, and NULL.
|
private |
Return the function_instance in the profile that correspond to the inline STACK.
References autofdo::afdo_string_table, dump_enabled_p(), dump_file, dump_printf_loc(), dump_user_location_t::from_location_t(), i, map_, MSG_NOTE, MSG_PRIORITY_INTERNALS, NULL, autofdo::raw_symbol_name(), and UNKNOWN_LOCATION.
Referenced by get_callsite_total_count(), get_count_info(), remove_icall_target(), and update_inlined_ind_target().
function_instance * autofdo::autofdo_source_profile::get_function_instance_by_name_index | ( | int | name_index | ) | const |
void autofdo::autofdo_source_profile::offline_external_functions | ( | ) |
Offline all functions not defined in the current unit. We will not be able to early inline them. Doint so early will get VPT decisions more realistic.
References hash_set< KeyId, Lazy, Traits >::add(), autofdo::afdo_string_table, autofdo::function_instance::clear_in_worklist(), hash_set< KeyId, Lazy, Traits >::contains(), symtab_node::decl, dump_file, autofdo::function_instance::dump_inline_stack(), symtab_node::dump_name(), duplicate_functions_, lang_hooks::dwarf_name, FOR_EACH_DEFINED_FUNCTION, free(), gcc_checking_assert, hash_map< KeyId, Value, Traits >::get(), autofdo::function_instance::get_cgraph_node(), autofdo::function_instance::get_location(), autofdo::get_original_name(), i, autofdo::function_instance::in_worklist_p(), autofdo::function_instance::inlined_to(), map_, autofdo::function_instance::match(), autofdo::function_instance::name(), autofdo::function_instance::offline_if_in_set(), hash_map< KeyId, Value, Traits >::put(), autofdo::raw_symbol_name(), autofdo::function_instance::remove_external_functions(), autofdo::function_instance::set_name(), and UNKNOWN_LOCATION.
void autofdo::autofdo_source_profile::offline_unrealized_inlines | ( | ) |
Offline all inline functions that are not marked as realized. This will merge their profile into offline versions where available. Also remove all functions we will no longer use.
References autofdo::afdo_string_table, autofdo::function_instance::clear_in_worklist(), DECL_INITIAL, dump_file, autofdo::function_instance::dump_inline_stack(), error_mark_node, gcc_checking_assert, autofdo::function_instance::get_cgraph_node(), autofdo::function_instance::in_worklist_p(), autofdo::function_instance::inlined_to(), map_, autofdo::function_instance::name(), autofdo::function_instance::offline_if_not_realized(), autofdo::function_instance::realized_p(), autofdo::function_instance::set_realized(), and autofdo::walk_block().
|
private |
Read AutoFDO profile and returns TRUE on success.
source profile format: GCOV_TAG_AFDO_FUNCTION: 4 bytes LENGTH: 4 bytes NUM_FUNCTIONS: 4 bytes FUNCTION_INSTANCE_1 FUNCTION_INSTANCE_2 ... FUNCTION_INSTANCE_N.
References autofdo::afdo_count_scale, afdo_hot_bb_threshod, autofdo::afdo_profile_info, autofdo::afdo_source_profile, autofdo::afdo_string_table, dump_file, fatal_error(), gcc_checking_assert, gcov_read_counter(), gcov_read_unsigned(), GCOV_TAG_AFDO_FUNCTION, i, inform(), map_, MAX, profile_count::max_count, profile_count::n_bits, PRIu64, autofdo::function_instance::read_function_instance(), set_hot_bb_threshold(), and UNKNOWN_LOCATION.
void autofdo::autofdo_source_profile::remove_icall_target | ( | cgraph_edge * | e | ) |
bool autofdo::autofdo_source_profile::update_inlined_ind_target | ( | gcall * | stmt, |
count_info * | info, | ||
cgraph_node * | node ) |
Update value profile INFO for STMT from the inlined indirect callsite. Return true if INFO is updated.
References autofdo::afdo_count_scale, cfun, autofdo::count_info::count, current_function_decl, symtab_node::decl, dump_file, autofdo::dump_inline_stack(), get_count_info(), get_function_instance_by_inline_stack(), autofdo::get_inline_stack_in_node(), gimple_location(), LOCATION_LOCUS, map, NULL, print_gimple_stmt(), autofdo::count_info::targets, and TDF_SLIM.
|
private |
Referenced by offline_external_functions().
|
private |