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

Functions

static void update_noncloned_frequencies (struct cgraph_node *node, int freq_scale)
static bool can_remove_node_now_p_1 ()
static bool can_remove_node_now_p ()
void clone_inlined_nodes (struct cgraph_edge *e, bool duplicate, bool update_original, int *overall_size)
bool inline_call (struct cgraph_edge *e, bool update_original, vec< cgraph_edge_p > *new_edges, int *overall_size, bool update_overall_summary)
static struct cgraph_nodesave_inline_function_body ()
static bool preserve_function_body_p ()
unsigned int inline_transform ()

Variables

int ncalls_inlined
int nfunctions_inlined
bool speculation_removed

Function Documentation

static bool can_remove_node_now_p ( )
static
We are going to eliminate last direct call to NODE (or alias of it) via edge E.
   Verify that the NODE can be removed from unit and if it is contained in comdat
   group that the whole comdat group is removable.   

References cgraph_node::callers, can_remove_node_now_p_1(), cgraph(), symtab_node_base::same_comdat_group, and cgraph_node::symbol.

Referenced by clone_inlined_nodes(), and inline_call().

static bool can_remove_node_now_p_1 ( )
static
We removed or are going to remove the last call to NODE.
   Return true if we can and want proactively remove the NODE now.
   This is important to do, since we want inliner to know when offline
   copy of function was removed.   

References symtab_node_base::address_taken, cgraph_can_remove_if_no_direct_calls_p(), cgraph_new_nodes, symtab_node_base::decl, ipa_ref_has_aliases_p(), symtab_node_base::ref_list, cgraph_node::symbol, and cgraph_node::used_as_abstract_origin.

Referenced by can_remove_node_now_p().

bool inline_call ( struct cgraph_edge e,
bool  update_original,
vec< cgraph_edge_p > *  new_edges,
int *  overall_size,
bool  update_overall_summary 
)
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().

static bool preserve_function_body_p ( )
static
Return true when function body of DECL still needs to be kept around
   for later re-use.   

References symtab_node_base::alias, cgraph_global_info_ready, cgraph_node::clones, cgraph_node::symbol, cgraph_node::thunk, and cgraph_thunk_info::thunk_p.

Referenced by inline_transform().

static struct cgraph_node* save_inline_function_body ( )
staticread
Copy function body of NODE and redirect all inline clones to it.
   This is done before inline plan is applied to NODE when there are
   still some inline clones if it.

   This is necessary because inline decisions are not really transitive
   and the other inline clones may have different bodies.   

References cgraph_get_node(), cgraph_node_name(), cgraph_remove_node_and_inline_clones(), cgraph_node::clone_of, cgraph_node::clones, copy_node(), symtab_node_base::decl, dump_file, cgraph_node::next_sibling_clone, cgraph_node::prev_sibling_clone, cgraph_node::symbol, symtab_insert_node_to_hashtable(), tree_function_versioning(), and verify_cgraph_node().

Referenced by inline_transform().

static void update_noncloned_frequencies ( struct cgraph_node node,
int  freq_scale 
)
static

Variable Documentation

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().

bool speculation_removed

Referenced by clone_inlined_nodes(), and inline_call().