GCC Middle and Back End API Reference
ipa-inline.h File Reference

Go to the source code of this file.

Data Structures

struct  condition
struct  predicate
struct  size_time_entry
struct  inline_summary
struct  inline_param_summary
struct  inline_edge_summary
struct  edge_growth_cache_entry

Typedefs

typedef struct condition condition
typedef int inline_hints
typedef vec< condition, va_gc > * conditions
typedef unsigned int clause_t
typedef struct size_time_entry size_time_entry
typedef struct inline_summary inline_summary_t
typedef struct inline_param_summary inline_param_summary_t
typedef struct inline_edge_summary inline_edge_summary_t
typedef struct
edge_growth_cache_entry 
edge_growth_cache_entry

Enumerations

enum  inline_hints_vals {
  INLINE_HINT_indirect_call = 1, INLINE_HINT_loop_iterations = 2, INLINE_HINT_loop_stride = 4, INLINE_HINT_same_scc = 8,
  INLINE_HINT_in_scc = 16, INLINE_HINT_declared_inline = 32, INLINE_HINT_cross_module = 64, INLINE_HINT_array_index = 128
}

Functions

void debug_inline_summary (struct cgraph_node *)
void dump_inline_summaries (FILE *f)
void dump_inline_summary (FILE *f, struct cgraph_node *node)
void dump_inline_hints (FILE *f, inline_hints)
void inline_generate_summary (void)
void inline_read_summary (void)
void inline_write_summary (void)
void inline_free_summary (void)
void initialize_inline_failed (struct cgraph_edge *)
int estimate_time_after_inlining (struct cgraph_node *, struct cgraph_edge *)
int estimate_size_after_inlining (struct cgraph_node *, struct cgraph_edge *)
void estimate_ipcp_clone_size_and_time (struct cgraph_node *, vec< tree >, vec< tree >, vec< ipa_agg_jump_function_p >, int *, int *, inline_hints *)
int do_estimate_growth (struct cgraph_node *)
void inline_merge_summary (struct cgraph_edge *edge)
void inline_update_overall_summary (struct cgraph_node *node)
int do_estimate_edge_size (struct cgraph_edge *edge)
int do_estimate_edge_time (struct cgraph_edge *edge)
inline_hints do_estimate_edge_hints (struct cgraph_edge *edge)
void initialize_growth_caches (void)
void free_growth_caches (void)
void compute_inline_parameters (struct cgraph_node *, bool)
bool speculation_useful_p (struct cgraph_edge *e, bool anticipate_inlining)
bool inline_call (struct cgraph_edge *, bool, vec< cgraph_edge_p > *, int *, bool)
unsigned int inline_transform (struct cgraph_node *)
void clone_inlined_nodes (struct cgraph_edge *e, bool, bool, int *)
static struct inline_summaryinline_summary ()
static struct inline_edge_summaryinline_edge_summary ()
static int estimate_growth ()
static int estimate_edge_size ()
static int estimate_edge_growth ()
static int estimate_edge_time ()
static inline_hints estimate_edge_hints ()
static void reset_node_growth_cache ()
static void reset_edge_growth_cache ()

Variables

vec< inline_summary_t, va_gc > * inline_summary_vec
vec< inline_edge_summary_tinline_edge_summary_vec
vec< int > node_growth_cache
vec< edge_growth_cache_entryedge_growth_cache
int ncalls_inlined
int nfunctions_inlined

Typedef Documentation

typedef unsigned int clause_t
typedef struct condition condition
@verbatim Inlining decision heuristics.

Copyright (C) 2003-2013 Free Software Foundation, Inc. Contributed by Jan Hubicka

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/.

Representation of inline parameters that do depend on context function is
   inlined into (i.e. known constant values of function parameters.

   Conditions that are interesting for function body are collected into CONDS
   vector.  They are of simple for  function_param OP VAL, where VAL is
   IPA invariant.  The conditions are then referred by predicates.   
typedef int inline_hints

Enumeration Type Documentation

Inline hints are reasons why inline heuristics should preffer inlining given
   function.  They are represtented as bitmap of the following values.   
Enumerator:
INLINE_HINT_indirect_call 
INLINE_HINT_loop_iterations 
INLINE_HINT_loop_stride 
INLINE_HINT_same_scc 
INLINE_HINT_in_scc 
INLINE_HINT_declared_inline 
INLINE_HINT_cross_module 
INLINE_HINT_array_index 

Function Documentation

void compute_inline_parameters ( struct cgraph_node ,
bool   
)
void debug_inline_summary ( struct cgraph_node )
In ipa-inline-analysis.c   
inline_hints do_estimate_edge_hints ( struct cgraph_edge edge)
int do_estimate_edge_size ( struct cgraph_edge edge)
int do_estimate_edge_time ( struct cgraph_edge edge)
int do_estimate_growth ( struct cgraph_node )
void dump_inline_hints ( FILE *  f,
inline_hints   
)
void dump_inline_summaries ( FILE *  f)
void dump_inline_summary ( FILE *  f,
struct cgraph_node node 
)
static int estimate_edge_growth ( )
inlinestatic
static inline_hints estimate_edge_hints ( )
inlinestatic
Return estimated callee runtime increase after inlning
   EDGE.   

References do_estimate_edge_hints(), edge_growth_cache, and cgraph_edge::uid.

Referenced by edge_badness(), and want_inline_small_function_p().

static int estimate_edge_size ( )
inlinestatic
Return estimated size of the inline sequence of EDGE.   

References do_estimate_edge_size(), edge_growth_cache, and cgraph_edge::uid.

Referenced by estimate_edge_growth().

static int estimate_edge_time ( )
inlinestatic
Return estimated callee runtime increase after inlning
   EDGE.   

References do_estimate_edge_time(), edge_growth_cache, and cgraph_edge::uid.

Referenced by big_speedup_p(), edge_badness(), and estimate_time_after_inlining().

static int estimate_growth ( )
inlinestatic
Return estimated unit growth after inlning all calls to NODE.
   Quick accesors to the inline growth caches.  
   For convenience we keep zero 0 as unknown.  Because growth
   can be both positive and negative, we simply increase positive
   growths by 1.  

References do_estimate_growth(), node_growth_cache, and cgraph_node::uid.

Referenced by edge_badness(), inline_small_functions(), want_inline_function_to_all_callers_p(), and want_inline_small_function_p().

void estimate_ipcp_clone_size_and_time ( struct cgraph_node node,
vec< tree known_vals,
vec< tree known_binfos,
vec< ipa_agg_jump_function_p known_aggs,
int *  ret_size,
int *  ret_time,
inline_hints hints 
)
Estimate size and time needed to execute callee of EDGE assuming that
   parameters known to be constant at caller of EDGE are propagated.
   KNOWN_VALS and KNOWN_BINFOS are vectors of assumed known constant values
   and types for parameters.   

References estimate_node_size_and_time(), evaluate_conditions_for_known_args(), and vNULL.

Referenced by estimate_local_effects().

int estimate_size_after_inlining ( struct cgraph_node node,
struct cgraph_edge edge 
)
Estimate the size of NODE after inlining EDGE which should be an
   edge to either NODE or a call inlined into NODE.   

References estimate_edge_growth(), false_predicate_p(), inline_edge_summary(), inline_summary(), inline_edge_summary::predicate, and inline_summary::size.

Referenced by caller_growth_limits(), and recursive_inlining().

int estimate_time_after_inlining ( struct cgraph_node node,
struct cgraph_edge edge 
)
Estimate self time of the function NODE after inlining EDGE.   

References estimate_edge_time(), false_predicate_p(), inline_edge_summary(), inline_summary(), inline_edge_summary::predicate, and inline_summary::time.

void free_growth_caches ( void  )
Free growth caches.   

Referenced by inline_small_functions().

void initialize_growth_caches ( void  )
Initialize growth caches.   

References cgraph_edge_max_uid, and cgraph_max_uid.

Referenced by inline_small_functions().

void initialize_inline_failed ( struct cgraph_edge )
bool inline_call ( struct cgraph_edge e,
bool  update_original,
vec< cgraph_edge_p > *  new_edges,
int *  overall_size,
bool  update_overall_summary 
)
In ipa-inline-transform.c   
Mark edge E as inlined and update callgraph accordingly.  UPDATE_ORIGINAL
   specify whether profile of original function should be updated.  If any new
   indirect edges are discovered in the process, add them to NEW_EDGES, unless
   it is NULL. If UPDATE_OVERALL_SUMMARY is false, do not bother to recompute overall
   size of caller after inlining. Caller is required to eventually do it via
   inline_update_overall_summary.

   Return true iff any new callgraph edges were discovered as a
   result of inlining.   

References cgraph_edge::callee, cgraph_edge::caller, cgraph_node::callers, can_remove_node_now_p(), cgraph_alias_target(), cgraph_function_or_thunk_node(), cgraph_redirect_edge_callee(), cgraph_remove_node(), clone_inlined_nodes(), symtab_node_base::decl, estimate_edge_growth(), cgraph_node::global, inline_edge_summary(), cgraph_edge::inline_failed, inline_merge_summary(), inline_summary(), inline_update_overall_summary(), cgraph_global_info::inlined_to, ipa_propagate_indirect_call_infos(), ncalls_inlined, inline_edge_summary::predicate, inline_summary::size, speculation_removed, and cgraph_node::symbol.

Referenced by early_inline_small_functions(), flatten_function(), inline_always_inline_functions(), inline_small_functions(), ipa_inline(), and recursive_inlining().

void inline_merge_summary ( struct cgraph_edge edge)
void inline_read_summary ( void  )
Read inline summary.  Jump functions are shared among ipa-cp
   and inliner, so when ipa-cp is active, we don't need to write them
   twice.   

References add_new_function(), cgraph_add_function_insertion_hook(), fatal_error(), inline_read_section(), inline_summary_alloc(), ipa_prop_read_jump_functions(), ipa_register_cgraph_hooks(), len, lto_get_file_decl_data(), lto_get_section_data(), and LTO_section_inline_summary.

unsigned int inline_transform ( struct cgraph_node )
void inline_update_overall_summary ( struct cgraph_node node)
static void reset_edge_growth_cache ( )
inlinestatic
static void reset_node_growth_cache ( )
inlinestatic
Reset cached value for NODE.   

References node_growth_cache, and cgraph_node::uid.

Referenced by heap_edge_removal_hook(), inline_small_functions(), ipa_inline(), and reset_edge_caches().

bool speculation_useful_p ( struct cgraph_edge e,
bool  anticipate_inlining 
)

Variable Documentation

vec<inline_summary_t, va_gc>* inline_summary_vec
VECtor holding inline summaries.  
   In GGC memory because conditions might point to constant trees.   

Referenced by cgraph_process_new_functions().

int ncalls_inlined
@verbatim Callgraph transformations to handle inlining

Copyright (C) 2003-2013 Free Software Foundation, Inc. Contributed by Jan Hubicka

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/.

The inline decisions are stored in callgraph in "inline plan" and
   applied later.

   To mark given call inline, use inline_call function.
   The function marks the edge inlinable and, if necessary, produces
   virtual clone in the callgraph representing the new copy of callee's
   function body.

   The inline plan is applied on given function body by inline_transform.   

Referenced by inline_call(), and ipa_inline().

int nfunctions_inlined

Referenced by clone_inlined_nodes(), and ipa_inline().

vec<int> node_growth_cache
Cached node/edge growths.   

Referenced by estimate_growth(), and reset_node_growth_cache().