GCC Middle and Back End API Reference
ipa-profile.cc File Reference
#include "config.h"
#include "system.h"
#include "coretypes.h"
#include "backend.h"
#include "tree.h"
#include "gimple.h"
#include "predict.h"
#include "alloc-pool.h"
#include "tree-pass.h"
#include "cgraph.h"
#include "data-streamer.h"
#include "gimple-iterator.h"
#include "ipa-utils.h"
#include "profile.h"
#include "value-prof.h"
#include "tree-inline.h"
#include "symbol-summary.h"
#include "tree-vrp.h"
#include "sreal.h"
#include "ipa-cp.h"
#include "ipa-prop.h"
#include "ipa-fnsummary.h"
Include dependency graph for ipa-profile.cc:

Data Structures

struct  histogram_entry
 
struct  histogram_hash
 
struct  speculative_call_target
 
class  speculative_call_summary
 
class  ipa_profile_call_summaries
 
struct  ipa_propagate_frequency_data
 

Functions

static void account_time_size (hash_table< histogram_hash > *hashtable, vec< histogram_entry * > &histogram, gcov_type count, int time, int size)
 
int cmp_counts (const void *v1, const void *v2)
 
static void dump_histogram (FILE *file, vec< histogram_entry * > histogram)
 
static void ipa_profile_generate_summary (void)
 
static void ipa_profile_write_edge_summary (lto_simple_output_block *ob, speculative_call_summary *csum)
 
static void ipa_profile_write_summary (void)
 
static void ipa_profile_dump_all_summaries (FILE *f)
 
static void ipa_profile_read_edge_summary (class lto_input_block *ib, cgraph_edge *edge)
 
static void ipa_profile_read_summary_section (struct lto_file_decl_data *file_data, class lto_input_block *ib)
 
static void ipa_profile_read_summary (void)
 
static bool ipa_propagate_frequency_1 (struct cgraph_node *node, void *data)
 
bool contains_hot_call_p (struct cgraph_node *node)
 
bool ipa_propagate_frequency (struct cgraph_node *node)
 
static bool check_argument_count (struct cgraph_node *n, struct cgraph_edge *e)
 
static unsigned int ipa_profile (void)
 
ipa_opt_pass_dmake_pass_ipa_profile (gcc::context *ctxt)
 
void ipa_profile_cc_finalize (void)
 

Variables

vec< histogram_entry * > histogram
 
static object_allocator< histogram_entryhistogram_pool ("IPA histogram")
 
static ipa_profile_call_summariescall_sums = NULL
 

Function Documentation

◆ account_time_size()

static void account_time_size ( hash_table< histogram_hash > * hashtable,
vec< histogram_entry * > & histogram,
gcov_type count,
int time,
int size )
static
Account TIME and SIZE executed COUNT times into HISTOGRAM.
HASHTABLE is the on-side hash kept to avoid duplicates.   

References count, ggc_alloc(), histogram, histogram_pool, and histogram_entry::time.

Referenced by ipa_profile_generate_summary(), and ipa_profile_read_summary().

◆ check_argument_count()

static bool check_argument_count ( struct cgraph_node * n,
struct cgraph_edge * e )
static
Check that number of arguments of N agrees with E.
Be conservative when summaries are not present.   

References symtab_node::decl, cgraph_node::function_symbol(), ggc_alloc(), ipa_edge_args_sum, ipa_get_cs_argument_count(), ipa_get_param_count(), ipa_node_params_sum, stdarg_p(), and TREE_TYPE.

Referenced by ipa_profile().

◆ cmp_counts()

int cmp_counts ( const void * v1,
const void * v2 )

◆ contains_hot_call_p()

◆ dump_histogram()

static void dump_histogram ( FILE * file,
vec< histogram_entry * > histogram )
static
Dump HISTOGRAM to FILE.   

References count, dump_file, ggc_alloc(), histogram, i, overall_size, and PRId64.

Referenced by ipa_profile().

◆ ipa_profile()

◆ ipa_profile_cc_finalize()

void ipa_profile_cc_finalize ( void )
Reset all state within ipa-profile.cc so that we can rerun the compiler
within the same process.  For use by toplev::finalize.   

References call_sums, and NULL.

Referenced by toplev::finalize().

◆ ipa_profile_dump_all_summaries()

static void ipa_profile_dump_all_summaries ( FILE * f)
static
Dump all profile summary data for all cgraph nodes and edges to file F.   

References call_sums, dump_file, symtab_node::dump_name(), FOR_EACH_FUNCTION_WITH_GIMPLE_BODY, ggc_alloc(), and cgraph_node::indirect_calls.

Referenced by ipa_profile().

◆ ipa_profile_generate_summary()

◆ ipa_profile_read_edge_summary()

static void ipa_profile_read_edge_summary ( class lto_input_block * ib,
cgraph_edge * edge )
static
Read speculative targets information about edge for LTO WPA.   

References call_sums, gcc_assert, GCOV_TOPN_MAXIMUM_TRACKED_VALUES, ggc_alloc(), i, and streamer_read_hwi().

Referenced by ipa_profile_read_summary_section().

◆ ipa_profile_read_summary()

◆ ipa_profile_read_summary_section()

static void ipa_profile_read_summary_section ( struct lto_file_decl_data * file_data,
class lto_input_block * ib )
static

◆ ipa_profile_write_edge_summary()

◆ ipa_profile_write_summary()

◆ ipa_propagate_frequency()

◆ ipa_propagate_frequency_1()

◆ make_pass_ipa_profile()

ipa_opt_pass_d * make_pass_ipa_profile ( gcc::context * ctxt)

References ggc_alloc().

Variable Documentation

◆ call_sums

◆ histogram

vec<histogram_entry *> histogram
Histogram of profile values.
The histogram is represented as an ordered vector of entries allocated via
histogram_pool. During construction a separate hashtable is kept to lookup
duplicate entries.   

Referenced by account_time_size(), ipa_icf::sem_item_optimizer::dump_cong_classes(), dump_histogram(), dump_ic_profile(), gimple_divmod_fixed_value_transform(), gimple_mod_pow2_value_transform(), gimple_mod_subtract_transform(), gimple_stringops_transform(), ipa_profile(), ipa_profile_generate_summary(), ipa_profile_read_summary(), ipa_profile_write_summary(), and stringop_block_profile().

◆ histogram_pool

object_allocator< histogram_entry > histogram_pool("IPA histogram") ( "IPA histogram" )
static

Referenced by account_time_size(), and ipa_profile().