GCC Middle and Back End API Reference
cgraphclones.cc File Reference
#include "config.h"
#include "system.h"
#include "coretypes.h"
#include "backend.h"
#include "target.h"
#include "rtl.h"
#include "tree.h"
#include "gimple.h"
#include "stringpool.h"
#include "cgraph.h"
#include "lto-streamer.h"
#include "tree-eh.h"
#include "tree-cfg.h"
#include "tree-inline.h"
#include "attribs.h"
#include "dumpfile.h"
#include "gimple-pretty-print.h"
#include "alloc-pool.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 "symtab-thunks.h"
#include "symtab-clones.h"
#include "gt-cgraphclones.h"
Include dependency graph for cgraphclones.cc:

Functions

void set_new_clone_decl_and_node_flags (cgraph_node *new_node)
static cgraph_nodeduplicate_thunk_for_node (cgraph_node *thunk, cgraph_node *node)
void dump_callgraph_transformation (const cgraph_node *original, const cgraph_node *clone, const char *suffix)
static void localize_profile (cgraph_node *n)
tree clone_function_name_numbered (const char *name, const char *suffix)
tree clone_function_name_numbered (tree decl, const char *suffix)
tree clone_function_name (const char *name, const char *suffix, unsigned long number)
tree clone_function_name (tree decl, const char *suffix, unsigned long number)
tree clone_function_name (tree decl, const char *suffix)
static void update_call_expr (cgraph_node *new_version)

Variables

static hash_map< const char *, unsigned > * clone_fn_ids

Function Documentation

◆ clone_function_name() [1/3]

tree clone_function_name ( const char * name,
const char * suffix,
unsigned long number )
Return a new assembler name for a clone of decl named NAME. Apart from the string SUFFIX, the new name will end with the specified NUMBER. If clone numbering is not needed then the two argument clone_function_name should be used instead.

References ASM_FORMAT_PRIVATE_NAME, get_identifier(), and symbol_table::symbol_suffix_separator().

Referenced by clone_function_name(), clone_function_name_numbered(), create_dispatcher_calls(), create_locality_clone(), create_target_clone(), cgraph_node::create_version_clone_with_body(), cgraph_node::create_virtual_clone(), expand_omp_target(), final_scan_insn_1(), and symtab_node::noninterposable_alias().

◆ clone_function_name() [2/3]

tree clone_function_name ( tree decl,
const char * suffix )
Return a new assembler name ending with the string SUFFIX for a clone of DECL.

References DECL_ASSEMBLER_NAME, get_identifier(), IDENTIFIER_POINTER, and symbol_table::symbol_suffix_separator().

◆ clone_function_name() [3/3]

tree clone_function_name ( tree decl,
const char * suffix,
unsigned long number )
Return a new assembler name for a clone of DECL. Apart from the string SUFFIX, the new name will end with the specified NUMBER. If clone numbering is not needed then the two argument clone_function_name should be used instead.

References clone_function_name(), DECL_ASSEMBLER_NAME, and IDENTIFIER_POINTER.

◆ clone_function_name_numbered() [1/2]

tree clone_function_name_numbered ( const char * name,
const char * suffix )
Return a new assembler name for a clone of decl named NAME. Apart from the string SUFFIX, the new name will end with a unique (for each NAME) unspecified number. If clone numbering is not needed then the two argument clone_function_name should be used instead. Should not be called directly except for by lto-partition.cc:privatize_symbol_name_1.

References clone_fn_ids, clone_function_name(), clone_function_name_numbered(), hash_map< KeyId, Value, Traits >::create_ggc(), get_identifier(), and IDENTIFIER_POINTER.

Referenced by clone_function_name_numbered(), clone_function_name_numbered(), create_assumption_fn(), create_omp_child_function_name(), cgraph_node::create_version_clone_with_body(), duplicate_thunk_for_node(), and simd_clone_create().

◆ clone_function_name_numbered() [2/2]

tree clone_function_name_numbered ( tree decl,
const char * suffix )
Return a new assembler name for a clone of DECL. Apart from string SUFFIX, the new name will end with a unique (for each DECL assembler name) unspecified number. If clone numbering is not needed then the two argument clone_function_name should be used instead.

References clone_function_name_numbered(), DECL_ASSEMBLER_NAME, and IDENTIFIER_POINTER.

◆ dump_callgraph_transformation()

void dump_callgraph_transformation ( const cgraph_node * original,
const cgraph_node * clone,
const char * suffix )
Dump information about creation of a call graph node clone to the dump file created by the -fdump-ipa-clones option. ORIGINAL is the function being cloned, CLONE is the new clone. SUFFIX is a string that helps identify the reason for cloning, often it is the suffix used by a particular IPA pass to create unique function names. SUFFIX can be NULL and in that case the dumping will not take place, which must be the case only for helper clones which will never be emitted to the output.

References symtab_node::asm_name(), symtab_node::decl, DECL_SOURCE_COLUMN, DECL_SOURCE_FILE, DECL_SOURCE_LINE, symtab_node::get_uid(), and symtab.

Referenced by clone_inlined_nodes(), cgraph_node::create_clone(), and cgraph_node::create_version_clone().

◆ duplicate_thunk_for_node()

◆ localize_profile()

◆ set_new_clone_decl_and_node_flags()

◆ update_call_expr()

void update_call_expr ( cgraph_node * new_version)
static
The edges representing the callers of the NEW_VERSION node were fixed by cgraph_function_versioning (), now the call_expr in their respective tree code should be updated to call the NEW_VERSION.

References cgraph_edge::call_stmt, cgraph_edge::caller, cgraph_node::callers, symtab_node::decl, DECL_STRUCT_FUNCTION, gcc_assert, gimple_call_set_fndecl(), maybe_clean_eh_stmt_fn(), and cgraph_edge::next_caller.

Referenced by cgraph_node::create_version_clone_with_body().

Variable Documentation

◆ clone_fn_ids

hash_map<const char *, unsigned>* clone_fn_ids
static