GCC Middle and Back End API Reference
autofdo::autofdo_source_profile Class Reference

Public Member Functions

 ~autofdo_source_profile ()
 
function_instanceget_function_instance_by_decl (tree decl) const
 
bool get_count_info (gimple *stmt, count_info *info) const
 
gcov_type get_callsite_total_count (struct cgraph_edge *edge) const
 
bool update_inlined_ind_target (gcall *stmt, count_info *info)
 
void mark_annotated (location_t loc)
 

Static Public Member Functions

static autofdo_source_profilecreate ()
 

Private Types

typedef std::map< unsigned, function_instance * > name_function_instance_map
 

Private Member Functions

 autofdo_source_profile ()
 
bool read ()
 
function_instanceget_function_instance_by_inline_stack (const inline_stack &stack) const
 

Private Attributes

name_function_instance_map map_
 

Detailed Description

Profile for all functions.   

Member Typedef Documentation

◆ name_function_instance_map

Constructor & Destructor Documentation

◆ ~autofdo_source_profile()

autofdo::autofdo_source_profile::~autofdo_source_profile ( )
Member functions for autofdo_source_profile.   

References map_.

◆ autofdo_source_profile()

autofdo::autofdo_source_profile::autofdo_source_profile ( )
inlineprivate

Referenced by create().

Member Function Documentation

◆ create()

static autofdo_source_profile * autofdo::autofdo_source_profile::create ( )
inlinestatic

References autofdo_source_profile(), map, and NULL.

Referenced by autofdo::read_profile().

◆ get_callsite_total_count()

◆ get_count_info()

bool autofdo::autofdo_source_profile::get_count_info ( gimple * stmt,
count_info * info ) const
Find count_info for a given gimple STMT. If found, store the count_info
in INFO and return true; otherwise return false.   

References cfun, autofdo::function_instance::get_count_info(), get_function_instance_by_inline_stack(), autofdo::get_inline_stack(), gimple_location(), LOCATION_LOCUS, and NULL.

Referenced by autofdo::afdo_set_bb_count(), autofdo::afdo_vpt_for_early_inline(), and update_inlined_ind_target().

◆ get_function_instance_by_decl()

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, autofdo::string_table::get_index_by_decl(), map_, and NULL.

Referenced by autofdo::afdo_annotate_cfg(), and autofdo::afdo_vpt_for_early_inline().

◆ get_function_instance_by_inline_stack()

function_instance * autofdo::autofdo_source_profile::get_function_instance_by_inline_stack ( const inline_stack & stack) const
private

◆ mark_annotated()

void autofdo::autofdo_source_profile::mark_annotated ( location_t loc)

◆ read()

bool autofdo::autofdo_source_profile::read ( )
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 gcov_read_counter(), gcov_read_unsigned(), GCOV_TAG_AFDO_FUNCTION, i, inform(), map_, autofdo::function_instance::name(), autofdo::function_instance::read_function_instance(), and UNKNOWN_LOCATION.

◆ update_inlined_ind_target()

bool autofdo::autofdo_source_profile::update_inlined_ind_target ( gcall * stmt,
count_info * info )

Field Documentation

◆ map_


The documentation for this class was generated from the following file: