GCC Middle and Back End API Reference
|
Public Types | |
typedef auto_vec< function_instance * > | function_instance_stack |
Public Member Functions | |
~function_instance () | |
int | name () const |
gcov_type | total_count () const |
gcov_type | head_count () const |
function_instance * | get_function_instance_by_decl (unsigned lineno, tree decl) const |
bool | get_count_info (location_t loc, count_info *info) const |
gcov_type | find_icall_target_map (gcall *stmt, icall_target_map *map) const |
gcov_type | total_annotated_count () const |
void | mark_annotated (location_t loc) |
Static Public Member Functions | |
static function_instance * | read_function_instance (function_instance_stack *stack, gcov_type head_count) |
Private Types | |
typedef std::pair< unsigned, unsigned > | callsite |
typedef std::map< callsite, function_instance * > | callsite_map |
typedef std::map< unsigned, count_info > | position_count_map |
Private Member Functions | |
function_instance (unsigned name, gcov_type head_count) | |
Private Attributes | |
unsigned | name_ |
gcov_type | total_count_ |
gcov_type | head_count_ |
callsite_map | callsites |
position_count_map | pos_counts |
Profile of a function instance: 1. total_count of the function. 2. head_count (entry basic block count) of the function (only valid when function is a top-level function_instance, i.e. it is the original copy instead of the inlined copy). 3. map from source location (decl_lineno) to profile (count_info). 4. map from callsite to callee function_instance.
|
private |
|
private |
|
private |
autofdo::function_instance::~function_instance | ( | ) |
Member functions for function_instance.
References callsites.
|
inlineprivate |
Referenced by read_function_instance().
gcov_type autofdo::function_instance::find_icall_target_map | ( | gcall * | stmt, |
icall_target_map * | map ) const |
Read the inlined indirect call target profile for STMT and store it in MAP, return the total count for all inlined indirect calls.
References autofdo::afdo_string_table, callsites, cgraph_node::get_for_asmname(), get_identifier(), autofdo::string_table::get_name(), autofdo::get_relative_location_for_stmt(), and NULL.
Referenced by autofdo::autofdo_source_profile::update_inlined_ind_target().
bool autofdo::function_instance::get_count_info | ( | location_t | loc, |
count_info * | info ) const |
Store the profile info for LOC in INFO. Return TRUE if profile info is found.
References pos_counts.
Referenced by autofdo::autofdo_source_profile::get_count_info().
function_instance * autofdo::function_instance::get_function_instance_by_decl | ( | unsigned | lineno, |
tree | decl ) const |
Traverse callsites of the current function_instance to find one at the location of LINENO and callee name represented in DECL.
References autofdo::afdo_string_table, callsites, DECL_ABSTRACT_ORIGIN, DECL_FROM_INLINE, lang_hooks::dwarf_name, get_function_instance_by_decl(), autofdo::string_table::get_index(), autofdo::string_table::get_index_by_decl(), and NULL.
Referenced by get_function_instance_by_decl(), and autofdo::autofdo_source_profile::get_function_instance_by_inline_stack().
|
inline |
References head_count_.
Referenced by autofdo::afdo_annotate_cfg(), and read_function_instance().
void autofdo::function_instance::mark_annotated | ( | location_t | loc | ) |
Mark LOC as annotated.
References autofdo::count_info::annotated, and pos_counts.
Referenced by autofdo::autofdo_source_profile::mark_annotated().
|
inline |
References name_.
Referenced by autofdo::autofdo_source_profile::get_callsite_total_count(), autofdo::autofdo_source_profile::read(), and read_function_instance().
|
static |
Read the profile and create a function_instance with head count as HEAD_COUNT. Recursively read callsites to create nested function_instances too. STACK is used to track the recursive creation process.
function instance profile format: ENTRY_COUNT: 8 bytes NAME_INDEX: 4 bytes NUM_POS_COUNTS: 4 bytes NUM_CALLSITES: 4 byte POS_COUNT_1: POS_1_OFFSET: 4 bytes NUM_TARGETS: 4 bytes COUNT: 8 bytes TARGET_1: VALUE_PROFILE_TYPE: 4 bytes TARGET_IDX: 8 bytes COUNT: 8 bytes TARGET_2 ... TARGET_n POS_COUNT_2 ... POS_COUNT_N CALLSITE_1: CALLSITE_1_OFFSET: 4 bytes FUNCTION_INSTANCE_PROFILE (nested) CALLSITE_2 ... CALLSITE_n.
References callsites, count, function_instance(), gcov_read_counter(), gcov_read_unsigned(), head_count(), i, name(), offset, pos_counts, and read_function_instance().
Referenced by autofdo::autofdo_source_profile::read(), and read_function_instance().
gcov_type autofdo::function_instance::total_annotated_count | ( | ) | const |
Sum of counts that is used during annotation.
References callsites, pos_counts, and total_annotated_count().
Referenced by total_annotated_count().
|
inline |
References total_count_.
Referenced by autofdo::autofdo_source_profile::get_callsite_total_count().
|
private |
|
private |
Referenced by head_count().
|
private |
Referenced by name().
|
private |
Referenced by get_count_info(), mark_annotated(), read_function_instance(), and total_annotated_count().
|
private |
Referenced by total_count().