GCC Middle and Back End API Reference
autofdo::autofdo_source_profile Class Reference
Collaboration diagram for autofdo::autofdo_source_profile:

Public Member Functions

 ~autofdo_source_profile ()
function_instanceget_function_instance_by_decl (tree decl) const
function_instanceget_function_instance_by_descriptor (function_instance_descriptor) 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_profilecreate ()

Private Types

typedef std::map< function_instance_descriptor, 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
name_function_instance_map::const_iterator find_iter_for_function_instance (function_instance_descriptor descriptor) const
function_instancefind_function_instance (function_instance_descriptor descriptor) const
bool remove_function_instance (function_instance *inst)

Private Attributes

name_function_instance_map map_
auto_vec< function_instance * > duplicate_functions_

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

◆ add_function_instance()

void autofdo::autofdo_source_profile::add_function_instance ( function_instance * fn)
Add function instance FN.   

References gcc_checking_assert, autofdo::function_instance::get_descriptor(), and map_.

Referenced by offline_external_functions(), and read().

◆ create()

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

References autofdo_source_profile(), map, and NULL.

Referenced by autofdo::read_profile().

◆ find_function_instance()

function_instance * autofdo::autofdo_source_profile::find_function_instance ( function_instance_descriptor descriptor) const
private

◆ find_iter_for_function_instance()

autofdo_source_profile::name_function_instance_map::const_iterator autofdo::autofdo_source_profile::find_iter_for_function_instance ( function_instance_descriptor descriptor) const
private
Find the matching function instance which has DESCRIPTOR as its
descriptor.  If not found, also try checking if an instance exists with the
same name which has no associated filename.   

References map_, autofdo::function_instance_descriptor::symbol_name(), and autofdo::string_table::unknown_filename.

Referenced by find_function_instance(), and remove_function_instance().

◆ get_callsite_total_count()

◆ get_count_info() [1/2]

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 gcc_checking_assert, get_count_info(), gimple_location(), and stmt_loc_used_by_debug_info().

Referenced by get_count_info(), and update_inlined_ind_target().

◆ get_count_info() [2/2]

bool autofdo::autofdo_source_profile::get_count_info ( location_t gimple_loc,
count_info * info,
cgraph_node * node = NULL ) const

◆ 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, DECL_SOURCE_FILE, find_function_instance(), autofdo::get_normalized_path(), and NULL.

◆ get_function_instance_by_descriptor()

function_instance * autofdo::autofdo_source_profile::get_function_instance_by_descriptor ( function_instance_descriptor descriptor) const
For a given DESCRIPTOR, return the matching instance if found.   

References find_function_instance().

◆ get_function_instance_by_inline_stack()

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

◆ offline_external_functions()

◆ offline_unrealized_inlines()

◆ read()

bool autofdo::autofdo_source_profile::read ( )
private

◆ remove_function_instance()

bool autofdo::autofdo_source_profile::remove_function_instance ( function_instance * inst)
private
Remove a function instance from the map.  Returns true if the entry was
actually deleted.   

References find_iter_for_function_instance(), autofdo::function_instance::get_descriptor(), and map_.

Referenced by offline_external_functions(), and offline_unrealized_inlines().

◆ remove_icall_target()

void autofdo::autofdo_source_profile::remove_icall_target ( cgraph_edge * e)

◆ update_inlined_ind_target()

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

Field Documentation

◆ duplicate_functions_

auto_vec<function_instance *> autofdo::autofdo_source_profile::duplicate_functions_
private

◆ map_


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