GCC Middle and Back End API 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 "ssa.h"
#include "cgraph.h"
#include "gcov-io.h"
#include "diagnostic-core.h"
#include "profile.h"
#include "langhooks.h"
#include "cfgloop.h"
#include "tree-cfg.h"
#include "tree-cfgcleanup.h"
#include "tree-into-ssa.h"
#include "gimple-iterator.h"
#include "value-prof.h"
#include "symbol-summary.h"
#include "sreal.h"
#include "ipa-cp.h"
#include "ipa-prop.h"
#include "ipa-fnsummary.h"
#include "ipa-inline.h"
#include "tree-inline.h"
#include "auto-profile.h"
#include "tree-pretty-print.h"
#include "gimple-pretty-print.h"
Data Structures | |
class | autofdo::edge_info |
class | autofdo::count_info |
struct | autofdo::string_compare |
class | autofdo::string_table |
class | autofdo::function_instance |
class | autofdo::autofdo_source_profile |
Namespaces | |
namespace | autofdo |
Macros | |
#define | INCLUDE_MAP |
#define | INCLUDE_SET |
#define | DEFAULT_AUTO_PROFILE_FILE "fbdata.afdo" |
#define | AUTO_PROFILE_VERSION 2 |
#define | AFDO_EINFO(e) |
Typedefs | |
typedef std::pair< tree, unsigned > | autofdo::decl_lineno |
typedef auto_vec< decl_lineno > | autofdo::inline_stack |
typedef auto_vec< char * > | autofdo::string_vector |
typedef std::map< unsigned, gcov_type > | autofdo::icall_target_map |
typedef std::set< gimple * > | autofdo::stmt_set |
typedef std::set< basic_block > | autofdo::bb_set |
typedef std::set< edge > | autofdo::edge_set |
Variables | |
static string_table * | autofdo::afdo_string_table |
static autofdo_source_profile * | autofdo::afdo_source_profile |
static gcov_summary * | autofdo::afdo_profile_info |
#define AFDO_EINFO | ( | e | ) |
Intermediate edge info used when propagating AutoFDO profile information. We can't edge->count() directly since it's computed from edge's probability while probability is yet not decided during propagation.
Referenced by autofdo::afdo_calculate_branch_prob(), autofdo::afdo_propagate_circuit(), and autofdo::afdo_propagate_edge().
#define AUTO_PROFILE_VERSION 2 |
Referenced by autofdo::read_profile().
#define DEFAULT_AUTO_PROFILE_FILE "fbdata.afdo" |
The following routines implements AutoFDO optimization. This optimization uses sampling profiles to annotate basic block counts and uses heuristics to estimate branch probabilities. There are three phases in AutoFDO: Phase 1: Read profile from the profile data file. The following info is read from the profile datafile: * string_table: a map between function name and its index. * autofdo_source_profile: a map from function_instance name to function_instance. This is represented as a forest of function_instances. * WorkingSet: a histogram of how many instructions are covered for a given percentage of total cycles. This is describing the binary level information (not source level). This info is used to help decide if we want aggressive optimizations that could increase code footprint (e.g. loop unroll etc.) A function instance is an instance of function that could either be a standalone symbol, or a clone of a function that is inlined into another function. Phase 2: Early inline + value profile transformation. Early inline uses autofdo_source_profile to find if a callsite is: * inlined in the profiled binary. * callee body is hot in the profiling run. If both condition satisfies, early inline will inline the callsite regardless of the code growth. Phase 2 is an iterative process. During each iteration, we also check if an indirect callsite is promoted and inlined in the profiling run. If yes, vpt will happen to force promote it and in the next iteration, einline will inline the promoted callsite in the next iteration. Phase 3: Annotate control flow graph. AutoFDO uses a separate pass to: * Annotate basic block count * Estimate branch probability After the above 3 phases, all profile is readily annotated on the GCC IR. AutoFDO tries to reuse all FDO infrastructure as much as possible to make use of the profile. E.g. it uses existing mechanism to calculate the basic block/edge frequency, as well as the cgraph node/edge count.
Referenced by read_autofdo_file().
#define INCLUDE_MAP |
Read and annotate call graph profile from the auto profile data file. Copyright (C) 2014-2024 Free Software Foundation, Inc. Contributed by Dehao Chen (dehao@google.com) This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GCC; see the file COPYING3. If not see <http://www.gnu.org/licenses/>.
#define INCLUDE_SET |
bool afdo_callsite_hot_enough_for_early_inline | ( | struct cgraph_edge * | edge | ) |
Returns TRUE if EDGE is hot enough to be inlined early.
References profile_count::afdo(), autofdo::afdo_profile_info, autofdo::afdo_source_profile, count, profile_count::from_gcov_type(), autofdo::autofdo_source_profile::get_callsite_total_count(), maybe_hot_count_p(), NULL, and profile_info.
Referenced by want_early_inline_function_p().
void end_auto_profile | ( | void | ) |
Free the resources.
References autofdo::afdo_source_profile, autofdo::afdo_string_table, NULL, and profile_info.
Referenced by compile_file().
simple_ipa_opt_pass * make_pass_ipa_auto_profile | ( | gcc::context * | ctxt | ) |
void read_autofdo_file | ( | void | ) |
Read the profile from the profile data file.
References autofdo::afdo_profile_info, DEFAULT_AUTO_PROFILE_FILE, NULL, autofdo::read_profile(), gcov_summary::runs, and gcov_summary::sum_max.
Referenced by coverage_init().