GCC Middle and Back End API Reference
|
#include "config.h"
#include "system.h"
#include "coretypes.h"
#include "tm.h"
#include "tree.h"
#include "cgraph.h"
#include "tree-pass.h"
#include "gimple.h"
#include "ggc.h"
#include "flags.h"
#include "target.h"
#include "tree-iterator.h"
#include "ipa-utils.h"
#include "hash-table.h"
#include "profile.h"
#include "params.h"
#include "value-prof.h"
#include "alloc-pool.h"
#include "tree-inline.h"
#include "lto-streamer.h"
#include "data-streamer.h"
#include "ipa-inline.h"
Data Structures | |
struct | histogram_entry |
struct | histogram_hash |
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 () |
static void | dump_histogram () |
static void | ipa_profile_generate_summary () |
static void | ipa_profile_write_summary () |
static void | ipa_profile_read_summary () |
static bool | ipa_propagate_frequency_1 () |
bool | contains_hot_call_p () |
bool | ipa_propagate_frequency () |
static unsigned int | ipa_profile () |
static bool | gate_ipa_profile () |
ipa_opt_pass_d * | make_pass_ipa_profile () |
Variables | |
vec< histogram_entry * > | histogram |
static alloc_pool | histogram_pool |
|
static |
Account TIME and SIZE executed COUNT times into HISTOGRAM. HASHTABLE is the on-side hash kept to avoid duplicates.
References pool_alloc().
Referenced by ipa_profile_read_summary().
int cmp_counts | ( | ) |
bool contains_hot_call_p | ( | ) |
Return ture if NODE contains hot calls.
References symtab_node_base::alias, symtab_node_base::analyzed, cgraph_for_node_and_aliases(), cgraph_node_name(), changed, symtab_node_base::decl, DECL_VIRTUAL_P, dump_file, dump_flags, gcc_assert, ipa_propagate_frequency_1(), cgraph_local_info::local, cgraph_node::local, ipa_propagate_frequency_data::only_called_at_exit, and ipa_propagate_frequency_data::only_called_at_startup.
|
static |
Dump HISTOGRAM to FILE.
References overall_size.
|
static |
|
static |
Simple ipa profile pass propagating frequencies across the callgraph.
Produce speculative calls: we saved common traget from porfiling into e->common_target_id. Now, at link time, we can look up corresponding function node and produce speculative call.
Target may be overwritable, but profile says that control flow goes to this particular implementation of N2. Speculate on the local alias to allow inlining.
|
static |
Collect histogram from CFG profiles.
No need to do sanity check: gimple_ic_transform already takes away bad histograms.
counter 0 is target, counter 1 is number of execution we called target, counter 2 is total number of executions.
|
static |
Deserialize the ipa info for lto.
References account_time_size(), lto_create_simple_input_block(), lto_destroy_simple_input_block(), LTO_section_ipa_profile, streamer_read_gcov_count(), and streamer_read_uhwi().
|
static |
Serialize the ipa info for lto.
bool ipa_propagate_frequency | ( | ) |
See if the frequency of NODE can be updated based on frequencies of its callers.
We can not propagate anything useful about externally visible functions nor about virtuals.
With profile we can decide on hot/normal based on count.
These come either from profile or user hints; never update them.
References cgraph_node_name(), dump_file, and cgraph_node::only_called_at_startup.
|
static |
Worker for ipa_propagate_frequency_1.
It makes sense to put main() together with the static constructors. It will be executed for sure, but rest of functions called from main are definitely not at startup only.
When profile feedback is available, do not try to propagate too hard; counts are already good guide on function frequencies and roundoff errors can make us to push function into unlikely section even when it is executed by the train run. Transfer the function only if all callers are unlikely executed.
Referenced by contains_hot_call_p().
ipa_opt_pass_d* make_pass_ipa_profile | ( | ) |
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.
|
static |