GCC Middle and Back End API Reference
|
Go to the source code of this file.
Data Structures | |
struct | symtab_node_base |
struct | cgraph_thunk_info |
struct | cgraph_local_info |
struct | cgraph_global_info |
struct | cgraph_rtl_info |
struct | ipa_replace_map |
struct | cgraph_clone_info |
struct | cgraph_node |
struct | cgraph_function_version_info |
struct | cgraph_node_set_def |
struct | varpool_node_set_def |
struct | cgraph_node_set_iterator |
struct | varpool_node_set_iterator |
struct | cgraph_indirect_call_info |
struct | cgraph_edge |
struct | varpool_node |
struct | asm_node |
struct | constant_descriptor_tree |
Typedefs | |
typedef struct ipa_replace_map * | ipa_replace_map_p |
typedef struct cgraph_node * | cgraph_node_ptr |
typedef struct varpool_node * | varpool_node_ptr |
typedef struct cgraph_node_set_def * | cgraph_node_set |
typedef struct varpool_node_set_def * | varpool_node_set |
typedef enum cgraph_inline_failed_enum | cgraph_inline_failed_t |
typedef struct cgraph_edge * | cgraph_edge_p |
typedef void(* | cgraph_edge_hook )(struct cgraph_edge *, void *) |
typedef void(* | cgraph_node_hook )(struct cgraph_node *, void *) |
typedef void(* | cgraph_2edge_hook )(struct cgraph_edge *, struct cgraph_edge *, void *) |
typedef void(* | cgraph_2node_hook )(struct cgraph_node *, struct cgraph_node *, void *) |
Variables | |
const char *const | cgraph_availability_names [] |
const char *const | ld_plugin_symbol_resolution_names [] |
symtab_node | symtab_nodes |
int | cgraph_n_nodes |
int | cgraph_max_uid |
int | cgraph_edge_max_uid |
bool | cgraph_global_info_ready |
enum cgraph_state | cgraph_state |
bool | cgraph_function_flags_ready |
cgraph_node_set | cgraph_new_nodes |
struct asm_node * | asm_nodes |
int | symtab_order |
bool | cpp_implicit_aliases_done |
FILE * | cgraph_dump_file |
typedef void(* cgraph_2edge_hook)(struct cgraph_edge *, struct cgraph_edge *, void *) |
typedef void(* cgraph_2node_hook)(struct cgraph_node *, struct cgraph_node *, void *) |
typedef void(* cgraph_edge_hook)(struct cgraph_edge *, void *) |
typedef struct cgraph_edge* cgraph_edge_p |
typedef enum cgraph_inline_failed_enum cgraph_inline_failed_t |
Reasons for inlining failures.
typedef void(* cgraph_node_hook)(struct cgraph_node *, void *) |
typedef struct cgraph_node* cgraph_node_ptr |
typedef struct cgraph_node_set_def* cgraph_node_set |
typedef struct ipa_replace_map* ipa_replace_map_p |
typedef struct varpool_node* varpool_node_ptr |
typedef struct varpool_node_set_def* varpool_node_set |
enum availability |
enum cgraph_state |
enum symtab_type |
In cgraphunit.c
Referenced by default_asm_output_ident_directive(), and lto_input_toplevel_asms().
|
staticread |
Return callgraph node for given symbol and check it is a function.
Referenced by can_remove_node_now_p(), cgraph_redirect_edge_call_stmt_to_callee(), function_and_variable_visibility(), inline_read_section(), input_cgraph_1(), input_cgraph_opt_section(), input_edge(), input_node(), ipa_profile(), ipa_prop_read_section(), ipa_ref_node(), ipa_ref_referring_node(), ipa_reference_read_optimization_summary(), ipa_tm_execute(), lsei_cgraph_node(), lto_symtab_merge_symbols_1(), mark_functions_to_output(), pure_const_read_summary(), read_replacements_section(), and symtab_node_availability().
|
read |
|
read |
|
read |
void cgraph_add_new_function | ( | tree | , |
bool | |||
) |
Referenced by cgraph_build_static_cdtor_1(), expand_omp_taskreg(), expand_thunk(), and finalize_task_copyfn().
|
read |
|
read |
|
read |
Add thunk alias into callgraph. The alias declaration is ALIAS and it aliases DECL with an adjustments made into the first parameter. See comments in thunk_adjust for detail on the parameters.
References symtab_node_base::alias, cgraph_thunk_info::alias, cgraph_create_node(), cgraph_get_node(), cgraph_remove_node(), symtab_node_base::definition, cgraph_thunk_info::fixed_offset, double_int::from_shwi(), cgraph_node::symbol, cgraph_thunk_info::this_adjusting, cgraph_node::thunk, cgraph_thunk_info::thunk_p, tree_to_double_int(), cgraph_thunk_info::virtual_offset_p, and cgraph_thunk_info::virtual_value.
|
staticread |
Referenced by get_cg_data(), inline_call(), and propagate_constants_accross_call().
|
read |
Allocate cgraph_indirect_call_info and set its fields to default values.
References cgraph_indirect_call_info::param_index.
Referenced by cgraph_create_indirect_edge().
void cgraph_build_static_cdtor | ( | char | which, |
tree | body, | ||
int | priority | ||
) |
Referenced by asan_finish_file(), build_init_ctor(), ipa_lower_emutls(), mudflap_finish_file(), and tsan_finish_file().
void cgraph_call_edge_duplication_hooks | ( | struct cgraph_edge * | cs1, |
struct cgraph_edge * | cs2 | ||
) |
Call all edge duplication hooks.
References cgraph_2edge_hook_list::data, first_cgraph_edge_duplicated_hook, cgraph_2edge_hook_list::hook, and cgraph_2edge_hook_list::next.
Referenced by cgraph_clone_edge(), and cgraph_turn_edge_to_speculative().
void cgraph_call_function_insertion_hooks | ( | struct cgraph_node * | node | ) |
void cgraph_call_node_duplication_hooks | ( | struct cgraph_node * | node1, |
struct cgraph_node * | node2 | ||
) |
Call all node duplication hooks.
References cgraph_2node_hook_list::data, first_cgraph_node_duplicated_hook, cgraph_2node_hook_list::hook, and cgraph_2node_hook_list::next.
Referenced by cgraph_clone_node(), cgraph_copy_node_for_versioning(), and cgraph_create_virtual_clone().
bool cgraph_can_remove_if_no_direct_calls_and_refs_p | ( | struct cgraph_node * | node | ) |
bool cgraph_can_remove_if_no_direct_calls_p | ( | struct cgraph_node * | node | ) |
|
read |
In cgraphclones.c
@verbatim Callgraph clones
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/.
This module provide facilities for clonning functions. I.e. creating new functions based on existing functions with simple modifications, such as replacement of parameters. To allow whole program optimization without actual presence of function bodies, an additional infrastructure is provided for so-called virtual clones A virtual clone in the callgraph is a function that has no associated body, just a description of how to create its body based on a different function (which itself may be a virtual clone). The description of function modifications includes adjustments to the function's signature (which allows, for example, removing or adding function arguments), substitutions to perform on the function body, and, for inlined functions, a pointer to the function that it will be inlined into. It is also possible to redirect any edge of the callgraph from a function to its virtual clone. This implies updating of the call site to adjust for the new function signature. Most of the transformations performed by inter-procedural optimizations can be represented via virtual clones. For instance, a constant propagation pass can produce a virtual clone of the function which replaces one of its arguments by a constant. The inliner can represent its decisions by producing a clone of a function whose body will be later integrated into a given function. Using virtual clones, the program can be easily updated during the Execute stage, solving most of pass interactions problems that would otherwise occur during Transform. Virtual clones are later materialized in the LTRANS stage and turned into real functions. Passes executed after the virtual clone were introduced also perform their Transform stage on new functions, so for a pass there is no significant difference between operating on a real function or a virtual clone introduced before its Execute stage. Optimization passes then work on virtual clones introduced before their Execute stage as if they were real functions. The only difference is that clones are not visible during the Generate Summary stage.
Create clone of E in the node N represented by CALL_EXPR the callgraph.
References apply_probability(), cgraph_edge::call_stmt_cannot_inline_p, cgraph_edge::callee, cgraph_edge::can_throw_external, cgraph_call_edge_duplication_hooks(), cgraph_create_edge(), cgraph_create_indirect_edge(), cgraph_get_node(), count, cgraph_edge::count, cgraph_indirect_call_info::ecf_flags, cgraph_edge::frequency, gimple_call_fndecl(), cgraph_edge::indirect_info, cgraph_edge::indirect_inlining_edge, cgraph_edge::indirect_unknown_callee, cgraph_edge::inline_failed, cgraph_edge::lto_stmt_uid, and cgraph_edge::speculative.
Referenced by cgraph_clone_node(), cgraph_copy_node_for_versioning(), and copy_bb().
|
read |
Create node representing clone of N executed COUNT times. Decrease the execution counts from original node too. The new clone will have decl set to DECL that may or may not be the same as decl of N. When UPDATE_ORIGINAL is true, the counts are subtracted from the original function's profile to reflect the fact that part of execution is handled by node. When CALL_DUPLICATOIN_HOOK is true, the ipa passes are acknowledged about the new clone. Otherwise the caller is responsible for doing so later. If the new node is being inlined into another one, NEW_INLINED_TO should be the outline function the new one is (even indirectly) inlined to. All hooks will see this in node's global.inlined_to, when invoked. Can be NULL if the node is not inlined.
References symtab_node_base::analyzed, cgraph_edge::call_stmt, cgraph_node::callees, cgraph_call_node_duplication_hooks(), cgraph_clone_edge(), cgraph_create_empty_node(), cgraph_redirect_edge_callee(), cgraph_node::clone, cgraph_node::clone_of, cgraph_node::clones, count, cgraph_node::count, symtab_node_base::decl, symtab_node_base::definition, cgraph_node::global, cgraph_node::indirect_calls, cgraph_global_info::inlined_to, ipa_clone_references(), cgraph_local_info::local, cgraph_node::local, symtab_node_base::lto_file_data, cgraph_edge::lto_stmt_uid, cgraph_edge::next_callee, cgraph_node::origin, cgraph_node::prev_sibling_clone, symtab_node_base::ref_list, cgraph_node::rtl, cgraph_node::symbol, symtab_register_node(), and cgraph_clone_info::tree_map.
Referenced by cgraph_create_virtual_clone(), clone_inlined_nodes(), input_node(), and recursive_inlining().
|
read |
Create a new cgraph node which is the new version of OLD_VERSION node. REDIRECT_CALLERS holds the callers edges which should be redirected to point to NEW_VERSION. ALL the callees edges of OLD_VERSION are cloned to the new version node. Return the new version node. If non-NULL BLOCK_TO_COPY determine what basic blocks was copied to prevent duplications of calls that are dead in the clone.
References symtab_node_base::analyzed, bitmap_bit_p(), cgraph_edge::call_stmt, cgraph_node::callees, cgraph_call_node_duplication_hooks(), cgraph_clone_edge(), cgraph_create_node(), cgraph_redirect_edge_callee(), cgraph_node::count, symtab_node_base::definition, symtab_node_base::externally_visible, cgraph_node::global, cgraph_node::indirect_calls, cgraph_local_info::local, cgraph_node::local, cgraph_edge::lto_stmt_uid, cgraph_edge::next_callee, cgraph_node::rtl, and cgraph_node::symbol.
Referenced by cgraph_function_versioning(), and ipa_tm_create_version().
|
read |
Create edge from CALLER to CALLEE in the cgraph.
References cgraph_node::callees, cgraph_node::callers, cgraph_create_edge_1(), cgraph_edge::indirect_unknown_callee, initialize_inline_failed(), cgraph_edge::next_callee, cgraph_edge::next_caller, cgraph_edge::prev_callee, and cgraph_edge::prev_caller.
Referenced by analyze_function(), build_cgraph_edges(), cgraph_clone_edge(), cgraph_create_edge_including_clones(), cgraph_turn_edge_to_speculative(), cgraph_update_edges_for_call_stmt_node(), copy_bb(), gen_emutls_addr(), input_edge(), ipa_tm_insert_gettmclone_call(), ipa_tm_insert_irr_call(), and rebuild_cgraph_edges().
void cgraph_create_edge_including_clones | ( | struct cgraph_node * | orig, |
struct cgraph_node * | callee, | ||
gimple | old_stmt, | ||
gimple | stmt, | ||
gcov_type | count, | ||
int | freq, | ||
cgraph_inline_failed_t | reason | ||
) |
Like cgraph_create_edge walk the clone tree and update all clones sharing same function body. If clones already have edge for OLD_STMT; only update the edge same way as cgraph_set_call_stmt_including_clones does. TODO: COUNT and LOOP_DEPTH should be properly distributed based on relative frequencies of the clones.
References cgraph_create_edge(), cgraph_edge(), cgraph_set_call_stmt(), cgraph_node::clone_of, cgraph_node::clones, cgraph_edge::inline_failed, and cgraph_node::next_sibling_clone.
Referenced by copy_bb().
|
read |
Allocate new callgraph node and insert it into basic data structures.
References cgraph_allocate_node(), cgraph_n_nodes, cgraph_node::count_materialization_scale, NODE_FREQUENCY_NORMAL, cgraph_node::symbol, and SYMTAB_FUNCTION.
Referenced by cgraph_clone_node(), cgraph_create_node(), and input_node().
|
read |
|
read |
Create an indirect edge with a yet-undetermined callee where the call statement destination is a formal parameter of the caller with index PARAM_INDEX.
References cgraph_allocate_init_indirect_info(), cgraph_create_edge_1(), cgraph_indirect_call_info::ecf_flags, gimple_call_fn(), cgraph_node::indirect_calls, cgraph_edge::indirect_info, cgraph_edge::indirect_unknown_callee, initialize_inline_failed(), cgraph_edge::next_callee, obj_type_ref_class(), cgraph_indirect_call_info::otr_token, cgraph_indirect_call_info::otr_type, cgraph_indirect_call_info::param_index, cgraph_indirect_call_info::polymorphic, cgraph_edge::prev_callee, tree_low_cst(), type(), and virtual_method_call_p().
Referenced by build_cgraph_edges(), cgraph_clone_edge(), input_edge(), and rebuild_cgraph_edges().
|
read |
|
read |
Create callgraph node clone with new declaration. The actual body will be copied later at compilation stage. TODO: after merging in ipa-sra use function call notes instead of args_to_skip bitmap interface.
References cgraph_clone_info::args_to_skip, bitmap_bit_p(), bitmap_set_bit(), build_function_decl_skip_args(), cgraph_local_info::can_change_signature, cgraph_call_node_duplication_hooks(), cgraph_clone_node(), cgraph_node::clone, clone_function_name(), cgraph_node::clone_of, cgraph_clone_info::combined_args_to_skip, copy_node(), cgraph_node::count, symtab_node_base::decl, ipa_maybe_record_reference(), IPA_REF_ADDR, cgraph_node::local, map, ipa_replace_map::new_tree, cgraph_node::symbol, cgraph_clone_info::tree_map, tree_versionable_function_p(), and symtab_node_base::unique_name.
Referenced by create_specialized_node().
|
read |
bool cgraph_edge_cannot_lead_to_return | ( | struct cgraph_edge * | ) |
|
inlinestatic |
Return true when the edge E represents a direct recursion.
Referenced by early_inline_small_functions(), edge_badness(), expand_call_inline(), flatten_function(), inline_always_inline_functions(), inline_small_functions(), and simple_edge_hints().
void cgraph_finalize_function | ( | tree | , |
bool | |||
) |
|
read |
Referenced by symtab_unregister_node().
|
staticread |
Return first function with body defined.
|
staticread |
Return first function.
Referenced by analyze_functions(), process_function_and_variable_attributes(), recursive_inlining(), and symtab_remove_unreachable_nodes().
|
staticread |
Return first function with body defined.
bool cgraph_for_node_and_aliases | ( | struct cgraph_node * | node, |
bool(*)(struct cgraph_node *, void *) | callback, | ||
void * | data, | ||
bool | include_overwritable | ||
) |
Call calback on NODE and aliases associated to NODE. When INCLUDE_OVERWRITABLE is false, overwritable aliases and thunks are skipped.
References AVAIL_OVERWRITABLE, cgraph_for_node_and_aliases(), cgraph_function_body_availability(), IPA_REF_ALIAS, ipa_ref_referring_node(), symtab_node_base::ref_list, and cgraph_node::symbol.
Referenced by cgraph_can_remove_if_no_direct_calls_p(), cgraph_for_node_and_aliases(), cgraph_local_node_p(), cgraph_node_can_be_local_p(), cgraph_only_called_directly_p(), cgraph_propagate_frequency(), cgraph_will_be_removed_from_program_if_no_direct_calls(), collect_callers_of_node(), convert_callers(), do_estimate_growth(), estimate_local_effects(), gather_caller_stats(), has_undead_caller_from_outside_scc_p(), identify_dead_nodes(), ipa_early_sra(), ipa_pta_execute(), ipa_tm_create_version(), ipcp_cloning_candidate_p(), symtab_remove_unreachable_nodes(), update_profiling_info(), and want_inline_function_to_all_callers_p().
bool cgraph_for_node_thunks_and_aliases | ( | struct cgraph_node * | node, |
bool(*)(struct cgraph_node *, void *) | callback, | ||
void * | data, | ||
bool | include_overwritable | ||
) |
Call calback on NODE, thunks and aliases associated to NODE. When INCLUDE_OVERWRITABLE is false, overwritable aliases and thunks are skipped.
References AVAIL_OVERWRITABLE, cgraph_edge::caller, cgraph_node::callers, cgraph_for_node_thunks_and_aliases(), cgraph_function_body_availability(), IPA_REF_ALIAS, ipa_ref_referring_node(), cgraph_edge::next_caller, symtab_node_base::ref_list, cgraph_node::symbol, cgraph_node::thunk, and cgraph_thunk_info::thunk_p.
Referenced by cgraph_for_node_thunks_and_aliases(), cgraph_make_node_local(), cgraph_set_const_flag(), cgraph_set_nothrow_flag(), and cgraph_set_pure_flag().
enum availability cgraph_function_body_availability | ( | struct cgraph_node * | ) |
|
read |
|
staticread |
Given NODE, walk the alias chain to return the function NODE is alias of. Do not walk through thunks. When AVAILABILITY is non-NULL, get minimal availability in the chain.
Referenced by caller_growth_limits(), can_early_inline_edge_p(), can_inline_edge_p(), cgraph_function_node(), cgraph_local_node_p(), cgraph_mark_address_taken_node(), cgraph_only_called_directly_p(), clone_of_p(), collect_callers_of_node_1(), do_estimate_edge_hints(), do_estimate_edge_size(), do_estimate_edge_time(), dump_inline_edge_summary(), early_inline_small_functions(), edge_badness(), evaluate_properties_for_edge(), flatten_function(), inline_always_inline_functions(), inline_call(), inline_small_functions(), ipa_compute_jump_functions(), lookup_recursive_calls(), recursive_inlining(), searchc(), speculation_useful_p(), update_callee_keys(), verify_edge_corresponds_to_fndecl(), want_early_inline_function_p(), want_inline_function_to_all_callers_p(), and want_inline_small_function_p().
bool cgraph_function_possibly_inlined_p | ( | tree | ) |
|
read |
Perform function versioning. Function versioning includes copying of the tree and a callgraph update (creating a new cgraph node and updating its callees and callers). REDIRECT_CALLERS varray includes the edges to be redirected to the new version. TREE_MAP is a mapping of tree nodes we want to replace with new ones (according to results of prior analysis). OLD_VERSION_NODE is the node that is versioned. If non-NULL ARGS_TO_SKIP determine function parameters to remove from new version. If SKIP_RETURN is true, the new version will return void. If non-NULL BLOCK_TO_COPY determine what basic blocks to copy. If non_NULL NEW_ENTRY determine new entry BB of the clone. Return the new version's cgraph node.
References build_function_decl_skip_args(), cgraph_local_info::can_change_signature, cgraph_call_function_insertion_hooks(), cgraph_copy_node_for_versioning(), clone_function_name(), copy_node(), symtab_node_base::decl, symtab_node_base::externally_visible, cgraph_local_info::local, cgraph_node::local, cgraph_node::lowered, cgraph_node::symbol, symtab_make_decl_local(), tree_function_versioning(), tree_versionable_function_p(), symtab_node_base::unique_name, and update_call_expr().
Referenced by modify_function(), and split_function().
|
inlinestatic |
Return true when NODE is a function with Gimple body defined in current unit. Functions can also be define externally or they can be thunks with no Gimple representation. Note that at WPA stage, the function body may not be present in memory.
Referenced by do_per_function_toporder(), function_called_by_processed_nodes_p(), init_node_map(), initialize_node_lattices(), inline_small_functions(), ipa_prop_write_all_agg_replacement(), ipa_prop_write_jump_functions(), ipa_pta_execute(), ipa_write_summaries(), ipcp_cloning_candidate_p(), ipcp_decision_stage(), ipcp_propagate_stage(), propagate_constants_accross_call(), propagate_constants_topo(), and symtab_remove_unreachable_nodes().
bool cgraph_get_body | ( | struct cgraph_node * | node | ) |
|
read |
|
read |
|
staticread |
Return callgraph node for given symbol and check it is a function.
Referenced by analyze_function(), analyze_functions(), apply_ipa_transforms(), build_cgraph_edges(), call_may_clobber_ref_p_1(), can_refer_decl_in_current_unit_p(), cgraph_add_thunk(), cgraph_clone_edge(), cgraph_get_create_node(), cgraph_get_create_real_symbol_node(), cgraph_global_info(), cgraph_local_info(), cgraph_rebuild_references(), cgraph_redirect_edge_call_stmt_to_callee(), cgraph_remove_node(), cgraph_rtl_info(), cgraph_same_body_alias(), cgraph_set_call_stmt(), cgraph_update_edges_for_call_stmt(), check_for_nested_with_variably_modified(), computation_cost(), compute_function_frequency(), compute_inline_parameters_for_current(), compute_ltrans_boundary(), copy_bb(), create_task_copyfn(), decide_function_section(), decl_binds_to_current_def_p(), default_binds_local_p_1(), delete_function_version(), devirtualization_time_bonus(), dump_function_header(), dump_tm_clone_pairs(), early_inliner(), estimate_edge_devirt_benefit(), estimate_num_insns(), execute_all_ipa_transforms(), execute_fixup_cfg(), execute_split_functions(), expand_call_tm(), expand_function(), free_lang_data_in_decl(), function_called_by_processed_nodes_p(), function_section_1(), gimple_gen_ic_func_profiler(), gimplify_body(), handle_alias_pairs(), ipa_early_sra(), ipa_make_edge_direct_to_target(), ipa_modify_call_arguments(), ipa_tm_decrement_clone_counts(), ipa_tm_execute(), ipa_tm_insert_gettmclone_call(), ipa_tm_mayenterirr_function(), ipa_tm_scan_calls_block(), ipa_tm_scan_irr_block(), is_pass_explicitly_enabled_or_disabled(), local_pure_const(), lower_nested_functions(), lto_read_body(), lto_symtab_merge_symbols(), maybe_hot_frequency_p(), maybe_record_node(), need_assembler_name_p(), new_omp_context(), optimize_function_for_size_p(), optimize_inline_calls(), probably_never_executed_bb_p(), propagate_controlled_uses(), rebuild_cgraph_edges(), record_cdtor_fn(), ref_maybe_used_by_call_p_1(), reference_to_unused(), remove_cgraph_callee_edges(), save_inline_function_body(), scan_function(), set_nothrow_function_flags(), split_function(), tree_could_trap_p(), tree_function_versioning(), unnest_nesting_tree_1(), unshare_body(), unvisit_body(), update_call_edge_frequencies(), verify_edge_corresponds_to_fndecl(), and write_symbol().
|
read |
const char* cgraph_inline_failed_string | ( | cgraph_inline_failed_t | ) |
|
read |
|
read |
void cgraph_make_node_local | ( | struct cgraph_node * | ) |
void cgraph_mark_address_taken_node | ( | struct cgraph_node * | ) |
|
inlinestatic |
Likewise indicate that a node is needed, i.e. reachable via some external means.
Referenced by ipa_tm_mark_force_output_node(), lto_cgraph_replace_node(), mark_decl_referenced(), and process_function_and_variable_attributes().
void cgraph_materialize_all_clones | ( | void | ) |
Once all functions from compilation unit are in memory, produce all clones and update all calls. We might also do this on demand if we don't want to bring all functions to memory prior compilation, but current WHOPR implementation does that and it is is bit easier to keep everything right in this order.
References symtab_node_base::analyzed, cgraph_clone_info::args_to_skip, cgraph_node::callees, cgraph_dump_file, cgraph_get_body(), cgraph_materialize_clone(), cgraph_node_name(), cgraph_node_remove_callees(), cgraph_node::clone, cgraph_node::clone_of, cgraph_clone_info::combined_args_to_skip, symtab_node_base::decl, dump_bitmap(), gimple_has_body_p(), ipa_clear_stmts_in_references(), ipa_remove_all_references(), ipa_replace_map::new_tree, ipa_replace_map::old_tree, print_generic_expr(), symtab_node_base::ref_list, ipa_replace_map::ref_p, ipa_replace_map::replace_p, cgraph_node::symbol, symtab_remove_unreachable_nodes(), cgraph_clone_info::tree_map, vec_safe_length(), and verify_cgraph().
Referenced by compile().
bool cgraph_maybe_hot_edge_p | ( | struct cgraph_edge * | e | ) |
In predict.c
Referenced by estimate_edge_size_and_time(), gather_caller_stats(), get_info_about_necessary_edges(), ipa_profile(), propagate_effects(), speculation_useful_p(), want_early_inline_function_p(), want_inline_function_to_all_callers_p(), want_inline_self_recursive_call_p(), and want_inline_small_function_p().
|
staticread |
Return next function with body defined after NODE.
|
staticread |
Return next function.
Referenced by process_function_and_variable_attributes(), recursive_inlining(), and symtab_remove_unreachable_nodes().
|
staticread |
Return next reachable static variable with initializer after NODE.
|
inlinestatic |
Return asm name of cgraph node.
Referenced by dump_cgraph_node(), generate_summary(), ipa_reference_read_optimization_summary(), propagate(), and read_write_all_from_decl().
bool cgraph_node_can_be_local_p | ( | struct cgraph_node * | ) |
bool cgraph_node_cannot_return | ( | struct cgraph_node * | ) |
|
read |
|
inlinestatic |
Return true if SET contains NODE.
|
inlinestatic |
Return name of cgraph node.
Referenced by analyze_function(), cgraph_get_create_real_symbol_node(), cgraph_materialize_all_clones(), cgraph_propagate_frequency(), cgraph_propagate_frequency_1(), cgraph_redirect_edge_call_stmt_to_callee(), cgraph_resolve_speculation(), cgraph_turn_edge_to_speculative(), check_ic_target(), convert_callers_for_node(), copy_bb(), create_specialized_node(), decide_about_value(), decide_whether_version_node(), determine_versionability(), dump_cgraph_node(), dump_cgraph_node_set(), dump_inline_edge_summary(), dump_inline_summary(), dump_possible_polymorphic_call_targets(), dump_profile_updates(), early_inline_small_functions(), early_inliner(), edge_badness(), estimate_function_body_sizes(), estimate_local_effects(), estimate_node_size_and_time(), flatten_function(), function_and_variable_visibility(), identify_dead_nodes(), init_node_map(), initialize_node_lattices(), inline_always_inline_functions(), inline_analyze_function(), inline_small_functions(), ipa_inline(), ipa_make_edge_direct_to_target(), ipa_print_node_jump_functions(), ipa_print_node_params(), ipa_profile(), ipa_pta_execute(), ipcp_cloning_candidate_p(), ipcp_transform_function(), lto_cgraph_replace_node(), perhaps_add_new_callers(), print_all_lattices(), propagate_controlled_uses(), propagate_nothrow(), propagate_pure_const(), pure_const_read_summary(), recursive_inlining(), remove_described_reference(), report_inline_failed_reason(), save_inline_function_body(), symtab_remove_unreachable_nodes(), update_edge_key(), update_profiling_info(), verify_cgraph_node(), and want_early_inline_function_p().
void cgraph_node_remove_callees | ( | struct cgraph_node * | node | ) |
void cgraph_node_set_add | ( | cgraph_node_set | , |
struct cgraph_node * | |||
) |
Referenced by cgraph_add_new_function().
cgraph_node_set_iterator cgraph_node_set_find | ( | cgraph_node_set | , |
struct cgraph_node * | |||
) |
cgraph_node_set cgraph_node_set_new | ( | void | ) |
Create a new cgraph node set.
References cgraph_node_set_def::map, cgraph_node_set_def::nodes, and pointer_map_create().
Referenced by cgraph_add_new_function().
|
inlinestatic |
Return true if set is nonempty.
void cgraph_node_set_remove | ( | cgraph_node_set | , |
struct cgraph_node * | |||
) |
|
inlinestatic |
Return number of nodes in SET.
|
inlinestatic |
Return true when function NODE is only called directly or it has alias. i.e. it is not externally visible, address was not taken and it is not used in any other non-standard way.
Referenced by cgraph_non_local_node_p_1(), and cgraph_not_only_called_directly_p_1().
bool cgraph_only_called_directly_p | ( | struct cgraph_node * | ) |
bool cgraph_optimize_for_size_p | ( | struct cgraph_node * | ) |
Referenced by optimize_function_for_size_p().
bool cgraph_process_new_functions | ( | void | ) |
Process CGRAPH_NEW_FUNCTIONS and perform actions necessary to add these functions into callgraph in a way so they look like ordinary reachable functions inserted into callgraph already at construction time.
References analyze_function(), CDI_DOMINATORS, CDI_POST_DOMINATORS, cgraph_call_function_insertion_hooks(), cgraph_finalize_function(), CGRAPH_STATE_CONSTRUCTION, CGRAPH_STATE_EXPANSION, CGRAPH_STATE_IPA, CGRAPH_STATE_IPA_SSA, compute_inline_parameters(), csi_end_p(), csi_next(), csi_node(), csi_start(), symtab_node_base::decl, enqueue_node(), gcc::pass_manager::execute_early_local_passes(), expand_function(), free_cgraph_node_set(), free_dominance_info(), g, gcc::context::get_passes(), gimple_in_ssa_p(), gimple_register_cfg_hooks(), handle_alias_pairs(), inline_summary_vec, pop_cfun(), push_cfun(), and cgraph_node::symbol.
Referenced by analyze_functions(), compile(), execute_ipa_pass_list(), execute_one_pass(), expand_all_functions(), and ipa_passes().
void cgraph_process_same_body_aliases | ( | void | ) |
C++ frontend produce same body aliases all over the place, even before PCH gets streamed out. It relies on us linking the aliases with their function in order to do the fixups, but ipa-ref is not PCH safe. Consequentely we first produce aliases without links, but once C++ FE is sure he won't sream PCH we build the links via this function.
References cgraph_get_create_node(), cpp_implicit_aliases_done, symtab_resolve_alias(), and varpool_node_for_decl().
bool cgraph_propagate_frequency | ( | struct cgraph_node * | node | ) |
void cgraph_rebuild_references | ( | void | ) |
Rebuild cgraph edges for current function node. This needs to be run after passes that don't update the cgraph.
References cfun, cgraph_get_node(), cgraph_node::count, current_function_decl, gsi_end_p(), gsi_next(), gsi_start_bb(), gsi_start_phis(), gsi_stmt(), ipa_record_stmt_references(), ipa_remove_reference(), record_eh_tables(), symtab_node_base::ref_list, ipa_ref::speculative, and cgraph_node::symbol.
Referenced by tree_function_versioning().
gimple cgraph_redirect_edge_call_stmt_to_callee | ( | struct cgraph_edge * | ) |
void cgraph_redirect_edge_callee | ( | struct cgraph_edge * | , |
struct cgraph_node * | |||
) |
void cgraph_release_function_body | ( | struct cgraph_node * | ) |
void cgraph_remove_edge | ( | struct cgraph_edge * | ) |
void cgraph_remove_edge_duplication_hook | ( | struct cgraph_2edge_hook_list * | ) |
void cgraph_remove_edge_removal_hook | ( | struct cgraph_edge_hook_list * | ) |
void cgraph_remove_function_insertion_hook | ( | struct cgraph_node_hook_list * | ) |
void cgraph_remove_node | ( | struct cgraph_node * | ) |
bool cgraph_remove_node_and_inline_clones | ( | struct cgraph_node * | , |
struct cgraph_node * | |||
) |
void cgraph_remove_node_duplication_hook | ( | struct cgraph_2node_hook_list * | ) |
void cgraph_remove_node_removal_hook | ( | struct cgraph_node_hook_list * | ) |
void cgraph_reset_node | ( | struct cgraph_node * | ) |
Referenced by analyze_functions(), cgraph_finalize_function(), and handle_alias_pairs().
|
read |
|
read |
|
read |
void cgraph_set_call_stmt | ( | struct cgraph_edge * | e, |
gimple | new_stmt, | ||
bool | update_speculative | ||
) |
Change field call_stmt of edge E to NEW_STMT. If UPDATE_SPECULATIVE and E is any component of speculative edge, then update all components.
References cgraph_node::call_site_hash, cgraph_edge::call_stmt, cgraph_edge::caller, cgraph_edge::can_throw_external, cgraph_add_edge_to_call_site_hash(), cgraph_get_node(), cgraph_make_edge_direct(), cgraph_set_call_stmt(), cgraph_speculative_call_info(), symtab_node_base::decl, gimple_call_fndecl(), cgraph_edge::indirect_unknown_callee, pop_cfun(), push_cfun(), cgraph_edge::speculative, ipa_ref::stmt, stmt_can_throw_external(), and cgraph_node::symbol.
Referenced by cgraph_create_edge_including_clones(), cgraph_set_call_stmt(), cgraph_set_call_stmt_including_clones(), cgraph_update_edges_for_call_stmt_node(), copy_bb(), and ipa_modify_call_arguments().
void cgraph_set_call_stmt_including_clones | ( | struct cgraph_node * | orig, |
gimple | old_stmt, | ||
gimple | new_stmt, | ||
bool | update_speculative | ||
) |
Like cgraph_set_call_stmt but walk the clone tree and update all clones sharing the same function body. When WHOLE_SPECULATIVE_EDGES is true, all three components of speculative edge gets updated. Otherwise we update only direct call.
References cgraph_edge(), cgraph_set_call_stmt(), cgraph_speculative_call_info(), cgraph_node::clone_of, cgraph_node::clones, cgraph_edge::indirect_unknown_callee, cgraph_node::next_sibling_clone, ipa_ref::speculative, and cgraph_edge::speculative.
Referenced by cgraph_redirect_edge_call_stmt_to_callee(), and copy_bb().
void cgraph_set_const_flag | ( | struct cgraph_node * | , |
bool | , | ||
bool | |||
) |
void cgraph_set_nothrow_flag | ( | struct cgraph_node * | , |
bool | |||
) |
void cgraph_set_pure_flag | ( | struct cgraph_node * | , |
bool | , | ||
bool | |||
) |
void cgraph_speculative_call_info | ( | struct cgraph_edge * | e, |
struct cgraph_edge *& | direct, | ||
struct cgraph_edge *& | indirect, | ||
struct ipa_ref *& | reference | ||
) |
Speculative call consist of three components: 1) an indirect edge representing the original call 2) an direct edge representing the new call 3) ADDR_EXPR reference representing the speculative check. All three components are attached to single statement (the indirect call) and if one of them exists, all of them must exist. Given speculative call edge E, return all three components.
References cgraph_edge::call_stmt, cgraph_node::callees, cgraph_edge::caller, cgraph_edge(), cgraph_node::indirect_calls, cgraph_edge::indirect_unknown_callee, ipa_ref::lto_stmt_uid, cgraph_edge::lto_stmt_uid, cgraph_edge::next_callee, symtab_node_base::ref_list, ipa_ref::speculative, cgraph_edge::speculative, ipa_ref::stmt, and cgraph_node::symbol.
Referenced by cgraph_redirect_edge_call_stmt_to_callee(), cgraph_resolve_speculation(), cgraph_set_call_stmt(), cgraph_set_call_stmt_including_clones(), copy_bb(), and speculation_useful_p().
|
read |
Turn edge E into speculative call calling N2. Update the profile so the direct call is taken COUNT times with FREQUENCY. At clone materialization time, the indirect call E will be expanded as: if (call_dest == N2) n2 (); else call call_dest At this time the function just creates the direct call, the referencd representing the if conditional and attaches them all to the orginal indirect call statement. Return direct edge created.
References cgraph_edge::call_stmt, cgraph_edge::caller, cgraph_edge::can_throw_external, cgraph_call_edge_duplication_hooks(), cgraph_create_edge(), cgraph_mark_address_taken_node(), cgraph_node_name(), cgraph_edge::count, symtab_node_base::decl, dump_file, cgraph_edge::frequency, initialize_inline_failed(), ipa_record_reference(), IPA_REF_ADDR, ipa_ref::lto_stmt_uid, cgraph_edge::lto_stmt_uid, symtab_node_base::order, ipa_ref::speculative, cgraph_edge::speculative, and cgraph_node::symbol.
Referenced by ipa_profile().
void cgraph_unnest_node | ( | struct cgraph_node * | ) |
enum availability cgraph_variable_initializer_availability | ( | struct varpool_node * | ) |
Referenced by dump_varpool_node(), symtab_node_availability(), and varpool_for_node_and_aliases().
bool cgraph_will_be_removed_from_program_if_no_direct_calls | ( | struct cgraph_node * | node | ) |
vec<cgraph_edge_p> collect_callers_of_node | ( | struct cgraph_node * | node | ) |
void compile | ( | void | ) |
Perform simple optimizations based on callgraph.
References gcc::pass_manager::all_late_ipa_passes, gcc_debug_hooks::assembly_start, bitmap_obstack_initialize(), bitmap_obstack_release(), cgraph_dump_file, cgraph_global_info_ready, cgraph_materialize_all_clones(), cgraph_process_new_functions(), CGRAPH_STATE_EXPANSION, CGRAPH_STATE_FINISHED, CGRAPH_STATE_IPA, debug_hooks, symtab_node_base::decl, dump_cgraph_node(), dump_file, dump_memory_report(), dump_symtab(), error_found, execute_ipa_pass_list(), expand_all_functions(), g, gcc::context::get_passes(), gimple_has_body_p(), cgraph_node::global, cgraph_global_info::inlined_to, internal_error(), ipa_passes(), lookup_attribute(), lto_streamer_hooks_init(), mark_functions_to_output(), output_asm_statements(), output_in_order(), output_weakrefs(), seen_error(), cgraph_node::symbol, symtab_alias_target(), symtab_remove_unreachable_nodes(), timevar_pop(), timevar_push(), varpool_output_variables(), and verify_symtab().
Referenced by finalize_compilation_unit().
int compute_call_stmt_bb_frequency | ( | tree | , |
basic_block | bb | ||
) |
Referenced by build_cgraph_edges(), cgraph_redirect_edge_call_stmt_to_callee(), cgraph_update_edges_for_call_stmt_node(), copy_bb(), estimate_function_body_sizes(), execute_split_functions(), ipa_tm_insert_gettmclone_call(), ipa_tm_insert_irr_call(), lower_emutls_function_body(), rebuild_cgraph_edges(), tree_function_versioning(), update_call_edge_frequencies(), and verify_edge_count_and_frequency().
htab_t constant_pool_htab | ( | void | ) |
|
inlinestatic |
Return true if iterator CSI points to nothing.
Referenced by cgraph_process_new_functions(), and dump_cgraph_node_set().
|
inlinestatic |
Advance iterator CSI.
Referenced by cgraph_process_new_functions(), and dump_cgraph_node_set().
|
staticread |
Return the node pointed to by CSI.
Referenced by cgraph_process_new_functions(), and dump_cgraph_node_set().
|
inlinestatic |
Return an iterator to the first node in SET.
Referenced by cgraph_process_new_functions(), and dump_cgraph_node_set().
Referenced by compute_ltrans_boundary(), constant_after_peeling(), dump_varpool_node(), expand_expr_real_1(), get_base_constructor(), get_symbol_constant_value(), gimple_get_virt_method_for_binfo(), param_change_prob(), process_references(), string_constant(), symtab_remove_unreachable_nodes(), and varpool_remove_node().
void debug_cgraph | ( | void | ) |
Dump the call graph to stderr.
References dump_cgraph().
void debug_cgraph_node | ( | struct cgraph_node * | ) |
void debug_cgraph_node_set | ( | cgraph_node_set | ) |
void debug_symtab | ( | void | ) |
Dump symbol table to stderr.
References dump_symtab().
void debug_symtab_node | ( | symtab_node | ) |
void debug_varpool | ( | void | ) |
Dump the variable pool to stderr.
References dump_varpool().
void debug_varpool_node_set | ( | varpool_node_set | ) |
|
inlinestatic |
Return true if the TM_CLONE bit is set for a given FNDECL.
Referenced by dump_function_to_file(), dump_gimple_call(), execute_lower_tm(), expand_block_edges(), expand_regions_1(), gate_tm_init(), ipa_tm_transform_calls_redirect(), is_tm_builtin(), and print_node().
void delete_function_version | ( | tree | decl | ) |
Remove the cgraph_function_version_info and cgraph_node for DECL. This DECL is a duplicate declaration.
void dump_cgraph | ( | FILE * | ) |
In cgraph.c
void dump_cgraph_node | ( | FILE * | , |
struct cgraph_node * | |||
) |
void dump_cgraph_node_set | ( | FILE * | , |
cgraph_node_set | |||
) |
Referenced by debug_cgraph_node_set().
void dump_symtab | ( | FILE * | ) |
Referenced by analyze_functions(), compile(), debug_symtab(), execute_todo(), and ipa_pta_execute().
void dump_symtab_base | ( | FILE * | , |
symtab_node | |||
) |
Referenced by dump_cgraph_node(), and dump_varpool_node().
void dump_symtab_node | ( | FILE * | , |
symtab_node | |||
) |
Referenced by debug_symtab_node(), dump_symtab(), lto_symtab_merge_decls_1(), and verify_symtab_node().
void dump_varpool | ( | FILE * | ) |
Referenced by debug_varpool().
void dump_varpool_node | ( | FILE * | , |
struct varpool_node * | |||
) |
Referenced by dump_symtab_node(), and dump_varpool().
void dump_varpool_node_set | ( | FILE * | , |
varpool_node_set | |||
) |
Referenced by debug_varpool_node_set().
void expand_thunk | ( | struct cgraph_node * | ) |
Referenced by assemble_thunks_and_aliases().
void finalize_compilation_unit | ( | void | ) |
Analyze the whole compilation unit once it is parsed completely.
References analyze_functions(), compile(), current_function_decl, dump_passes(), finalize_size_functions(), handle_alias_pairs(), set_cfun(), timevar_pop(), and timevar_push().
Referenced by write_global_declarations().
void fixup_same_cpp_alias_visibility | ( | symtab_node | node, |
symtab_node | target | ||
) |
Referenced by analyze_functions(), and symtab_resolve_alias().
void fixup_same_cpp_alias_visibility | ( | symtab_node | , |
symtab_node | target, | ||
tree | |||
) |
void free_cgraph_node_set | ( | cgraph_node_set | ) |
Referenced by cgraph_process_new_functions().
void free_varpool_node_set | ( | varpool_node_set | ) |
Referenced by ipa_lower_emutls().
|
read |
Get the cgraph_function_version_info node corresponding to node.
|
write |
Symbol table entry.
void init_cgraph | ( | void | ) |
Initialize callgraph dump file.
References cgraph_dump_file, dump_begin(), and TDI_cgraph.
Referenced by do_compile().
basic_block init_lowered_empty_function | ( | tree | , |
bool | |||
) |
Initialize datastructures so DECL is a function in lowered gimple form. IN_SSA is true if the gimple is in SSA.
Referenced by expand_thunk().
|
read |
Insert a new cgraph_function_version_info node into cgraph_fnver_htab corresponding to cgraph_node NODE.
void ipa_discover_readonly_nonaddressable_vars | ( | void | ) |
Discover variables that have no longer address taken or that are read only and update their flags. FIXME: This can not be done in between gimplify and omp_expand since readonly flag plays role on what is shared and what is not. Currently we do this transformation as part of whole program visibility and re-do at ipa-reference pass (to take into account clonning), but it would make sense to do it before early optimizations.
References symtab_node_base::decl, symtab_node_base::definition, dump_file, IPA_REF_ADDR, IPA_REF_LOAD, IPA_REF_STORE, symtab_node_base::ref_list, varpool_node::symbol, varpool_all_refs_explicit_p(), and varpool_node_name().
Referenced by propagate(), and whole_program_function_and_variable_visibility().
void ipa_record_stmt_references | ( | struct cgraph_node * | , |
gimple | |||
) |
Referenced by build_cgraph_edges(), cgraph_rebuild_references(), ipa_modify_call_arguments(), and rebuild_cgraph_edges().
unsigned int rebuild_cgraph_edges | ( | void | ) |
In cgraphbuild.c
Rebuild cgraph edges for current function node. This needs to be run after passes that don't update the cgraph.
References cfun, cgraph_create_edge(), cgraph_create_indirect_edge(), cgraph_get_create_node(), cgraph_get_node(), cgraph_node_remove_callees(), compute_call_stmt_bb_frequency(), basic_block_def::count, cgraph_node::count, current_function_decl, gimple_call_flags(), gimple_call_fndecl(), cgraph_node::global, gsi_end_p(), gsi_next(), gsi_start_bb(), gsi_start_phis(), gsi_stmt(), cgraph_global_info::inlined_to, ipa_record_stmt_references(), ipa_remove_all_references(), is_gimple_call(), record_eh_tables(), symtab_node_base::ref_list, and cgraph_node::symbol.
Referenced by apply_ipa_transforms(), execute_function_todo(), expand_omp_taskreg(), expand_thunk(), ipa_tm_scan_calls_transaction(), modify_function(), split_function(), and tree_profiling().
Record that DECL1 and DECL2 are semantically identical function versions.
void record_references_in_initializer | ( | tree | , |
bool | |||
) |
Referenced by new_emutls_decl(), and varpool_analyze_node().
void release_function_body | ( | tree | ) |
bool resolution_used_from_other_file_p | ( | enum | ld_plugin_symbol_resolution | ) |
Referenced by symtab_used_from_object_file_p().
void symtab_add_to_same_comdat_group | ( | symtab_node | new_node, |
symtab_node | old_node | ||
) |
Add NEW_ to the same comdat group that OLD is in.
Referenced by fixup_same_cpp_alias_visibility().
|
inlinestatic |
FIXME: inappropriate dependency of cgraph on IPA.
Return node that alias N is aliasing.
Referenced by analyze_functions(), compile(), output_weakrefs(), symtab_alias_ultimate_target(), and symtab_resolve_alias().
symtab_node symtab_alias_ultimate_target | ( | symtab_node | , |
enum availability * | avail = NULL |
||
) |
Referenced by symtab_resolve_alias().
|
inlinestatic |
Return true if NODE can be discarded by linker from the binary.
Referenced by can_replace_by_local_alias(), and ipa_profile().
void symtab_dissolve_same_comdat_group_list | ( | symtab_node | node | ) |
Referenced by clone_inlined_nodes(), and function_and_variable_visibility().
bool symtab_for_node_and_aliases | ( | symtab_node | node, |
bool(*)(symtab_node, void *) | callback, | ||
void * | data, | ||
bool | include_overwritable | ||
) |
Call calback on NODE and aliases associated to NODE. When INCLUDE_OVERWRITABLE is false, overwritable aliases and thunks are skipped.
References AVAIL_OVERWRITABLE, IPA_REF_ALIAS, ipa_ref::referring, symtab_for_node_and_aliases(), and symtab_node_availability().
Referenced by symtab_for_node_and_aliases(), and symtab_nonoverwritable_alias().
symtab_node symtab_get_node | ( | const_tree | ) |
void symtab_initialize_asm_name_hash | ( | void | ) |
Initalize asm name hash unless.
References assembler_name_hash, eq_assembler_name(), hash_node_by_assembler_name(), and insert_to_assembler_name_hash().
Referenced by lto_symtab_merge_decls(), lto_symtab_merge_symbols(), and symtab_node_for_asm().
void symtab_insert_node_to_hashtable | ( | symtab_node | ) |
Referenced by cgraph_get_create_real_symbol_node(), lto_symtab_merge_symbols(), and save_inline_function_body().
void symtab_make_decl_local | ( | tree | ) |
Referenced by cgraph_function_versioning(), cgraph_make_node_local_1(), and function_and_variable_visibility().
const char* symtab_node_asm_name | ( | symtab_node | ) |
Referenced by analyze_functions(), dump_symtab_base(), ipa_dump_references(), ipa_dump_referring(), and lto_symtab_merge_decls_1().
enum availability symtab_node_availability | ( | symtab_node | ) |
Referenced by can_replace_by_local_alias(), symtab_alias_ultimate_target(), and symtab_for_node_and_aliases().
symtab_node symtab_node_for_asm | ( | const_tree | asmname | ) |
const char* symtab_node_name | ( | symtab_node | ) |
Referenced by analyze_functions(), dump_symtab_base(), init_node_map(), and remove_described_reference().
symtab_node symtab_nonoverwritable_alias | ( | symtab_node | ) |
Referenced by function_and_variable_visibility(), and ipa_profile().
void symtab_prevail_in_asm_name_hash | ( | symtab_node | node | ) |
Referenced by cgraph_get_create_real_symbol_node(), and lto_symtab_merge_decls_1().
|
inlinestatic |
Return true when the symbol is real symbol, i.e. it is not inline clone or abstract function kept for debug info purposes only.
Referenced by build_type_inheritance_graph(), lto_symtab_symbol_p(), maybe_record_node(), output_symbol_p(), and update_type_inheritance_graph().
void symtab_register_node | ( | symtab_node | ) |
In symtab.c
Referenced by cgraph_clone_node(), cgraph_create_node(), input_node(), input_varpool_node(), and varpool_node_for_decl().
void symtab_remove_node | ( | symtab_node | ) |
Referenced by analyze_functions().
bool symtab_remove_unreachable_nodes | ( | bool | , |
FILE * | |||
) |
In ipa.c
Referenced by cgraph_materialize_all_clones(), compile(), execute_one_pass(), execute_todo(), ipa_inline(), and ipa_passes().
bool symtab_resolve_alias | ( | symtab_node | node, |
symtab_node | target | ||
) |
void symtab_unregister_node | ( | symtab_node | ) |
Referenced by cgraph_remove_node(), and varpool_remove_node().
bool symtab_used_from_object_file_p | ( | symtab_node | ) |
void tree_function_versioning | ( | tree | old_decl, |
tree | new_decl, | ||
vec< ipa_replace_map_p, va_gc > * | tree_map, | ||
bool | update_clones, | ||
bitmap | args_to_skip, | ||
bool | skip_return, | ||
bitmap | blocks_to_copy, | ||
basic_block | new_entry | ||
) |
Create a copy of a function's tree. OLD_DECL and NEW_DECL are FUNCTION_DECL tree nodes of the original function and the new copied function respectively. In case we want to replace a DECL tree with another tree while duplicating the function's body, TREE_MAP represents the mapping between these trees. If UPDATE_CLONES is set, the call_stmt fields of edges of clones of the function will be updated. If non-NULL ARGS_TO_SKIP determine function parameters to remove from new version. If SKIP_RETURN is true, the new version will return void. If non-NULL BLOCK_TO_COPY determine what basic blocks to copy. If non_NULL NEW_ENTRY determine new entry BB of the clone.
References add_local_variables(), cgraph_edge::call_stmt, cgraph_node::callees, CB_CGE_MOVE, CB_CGE_MOVE_CLONES, CDI_DOMINATORS, CDI_POST_DOMINATORS, cfun, cgraph_get_node(), cgraph_rebuild_references(), compute_call_stmt_bb_frequency(), copy_arguments_for_versioning(), copy_body(), copy_decl_no_change(), copy_static_chain(), basic_block_def::count, cgraph_node::count, cgraph_edge::count, function::curr_properties, current_function_decl, debug_hooks, decl_debug_args_insert(), decl_debug_args_lookup(), declare_inline_vars(), delete_unreachable_blocks_update_callgraph(), dump_file, lang_hooks::dup_lang_specific_decl, fold_cond_expr_cond(), fold_convertible_p(), fold_marked_statements(), free_dominance_info(), cgraph_edge::frequency, gimple_bb(), gimple_build_nop(), gimple_in_ssa_p(), cgraph_node::indirect_calls, walk_stmt_info::info, initialize_cfun(), insert_decl_map(), insert_init_stmt(), loop_optimizer_init(), loops_for_fn(), make_ssa_name(), memset(), ipa_replace_map::new_tree, cgraph_edge::next_callee, function::nonlocal_goto_save_area, number_blocks(), ipa_replace_map::old_tree, gcc_debug_hooks::outlining_inline_function, ipa_replace_map::parm_num, pointer_map_create(), pointer_map_destroy(), pointer_set_create(), pointer_set_destroy(), pop_cfun(), print_generic_expr(), rebuild_frequencies(), remap_blocks(), remap_decl(), remap_gimple_op_r(), ipa_replace_map::replace_p, function::returns_pcc_struct, function::returns_struct, set_ssa_default_def(), setup_one_parameter(), single_succ_edge(), split_edge(), ssa_default_def(), update_clone_info(), update_ssa(), cgraph_node::used_as_abstract_origin, useless_type_conversion_p(), vec_safe_copy(), and vec_safe_is_empty().
Referenced by cgraph_function_versioning(), cgraph_materialize_clone(), ipa_tm_create_version(), and save_inline_function_body().
|
staticread |
Return varpool node for given symbol and check it is a variable.
Referenced by ipa_ref_referring_varpool_node(), ipa_ref_varpool_node(), lsei_varpool_node(), lto_symtab_merge_symbols_1(), output_symtab(), and symtab_node_availability().
void varpool_add_new_variable | ( | tree | ) |
Referenced by get_emutls_init_templ_addr(), and new_emutls_decl().
|
staticread |
Referenced by create_emultls_var(), and ctor_for_folding().
|
inlinestatic |
Return true when all references to VNODE must be visible in ipa_ref_list. i.e. if the variable is not externally visible or not used in some magic way (asm statement or such). The magic uses are all summarized in force_output flag.
Referenced by create_variable_info_for(), and ipa_discover_readonly_nonaddressable_vars().
void varpool_analyze_node | ( | struct varpool_node * | ) |
Referenced by analyze_functions(), and varpool_finalize_decl().
bool varpool_assemble_decl | ( | struct varpool_node * | node | ) |
Referenced by asan_finish_file(), output_in_order(), varpool_finalize_decl(), and varpool_output_variables().
|
inlinestatic |
Return true when function NODE can be removed from callgraph if all direct calls are eliminated.
Referenced by symtab_remove_unreachable_nodes(), and varpool_remove_unreferenced_decls().
|
read |
In varpool.c
@verbatim Callgraph handling code.
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/.
Allocate new callgraph node and insert it into basic data structures.
References varpool_node::symbol, and SYMTAB_VARIABLE.
Referenced by input_varpool_node(), and varpool_node_for_decl().
|
read |
Referenced by handle_alias_pairs(), new_emutls_decl(), symtab_nonoverwritable_alias(), and varpool_extra_name_alias().
bool varpool_externally_visible_p | ( | struct varpool_node * | ) |
Referenced by function_and_variable_visibility(), and varpool_add_new_variable().
|
read |
void varpool_finalize_decl | ( | tree | ) |
Referenced by add_new_static_var(), build_cgraph_edges(), build_one_array(), coverage_end_function(), coverage_obj_finish(), coverage_obj_fn(), expand_omp_taskreg(), init_ic_make_global_vars(), lower_omp_critical(), process_function_and_variable_attributes(), rest_of_decl_compilation(), tree_output_constant_def(), and varpool_add_new_variable().
void varpool_finalize_named_section_flags | ( | struct varpool_node * | node | ) |
Referenced by output_in_order(), and varpool_output_variables().
|
staticread |
Return first reachable static variable with initializer.
Referenced by varpool_remove_unreferenced_decls().
|
staticread |
Return first reachable static variable with initializer.
|
staticread |
Return first variable.
Referenced by analyze_functions(), process_function_and_variable_attributes(), and symtab_remove_unreachable_nodes().
bool varpool_for_node_and_aliases | ( | struct varpool_node * | node, |
bool(*)(struct varpool_node *, void *) | callback, | ||
void * | data, | ||
bool | include_overwritable | ||
) |
Call calback on NODE and aliases associated to NODE. When INCLUDE_OVERWRITABLE is false, overwritable aliases and thunks are skipped.
References AVAIL_OVERWRITABLE, cgraph_variable_initializer_availability(), IPA_REF_ALIAS, ipa_ref_referring_varpool_node(), symtab_node_base::ref_list, varpool_node::symbol, and varpool_for_node_and_aliases().
Referenced by ipa_lower_emutls(), and varpool_for_node_and_aliases().
|
staticread |
Return varpool node for given symbol and check it is a function.
Referenced by can_refer_decl_in_current_unit_p(), compute_ltrans_boundary(), create_emultls_var(), create_variable_info_for(), ctor_for_folding(), dbxout_expand_expr(), decl_binds_to_current_def_p(), default_binds_local_p_1(), emutls_index(), get_constraint_for_ssa_var(), get_symbol_initial_value(), premark_types_used_by_global_vars_helper(), reference_to_unused(), tree_could_trap_p(), varpool_analyze_node(), varpool_node_for_decl(), wrapup_global_declaration_2(), and write_symbol().
void varpool_mark_needed_node | ( | struct varpool_node * | ) |
|
staticread |
Return next reachable static variable with initializer after NODE.
Referenced by varpool_remove_unreferenced_decls().
|
staticread |
Return next reachable static variable with initializer after NODE.
|
staticread |
Return next variable after NODE.
Referenced by process_function_and_variable_attributes(), and symtab_remove_unreachable_nodes().
|
inlinestatic |
Return asm name of varpool node.
Referenced by varpool_remove_unreferenced_decls().
|
read |
Referenced by new_emutls_decl().
|
read |
Referenced by add_new_static_var(), asan_finish_file(), assemble_alias(), cgraph_process_same_body_aliases(), get_emutls_init_templ_addr(), mark_address(), mark_decl_referenced(), mark_load(), mark_store(), new_emutls_decl(), record_reference(), record_references_in_initializer(), record_type_list(), rest_of_decl_compilation(), varpool_add_new_variable(), varpool_create_variable_alias(), varpool_extra_name_alias(), and varpool_finalize_decl().
|
inlinestatic |
Return true if SET contains NODE.
|
inlinestatic |
Return name of varpool node.
Referenced by dump_varpool_node_set(), function_and_variable_visibility(), ipa_discover_readonly_nonaddressable_vars(), and symtab_remove_unreachable_nodes().
void varpool_node_set_add | ( | varpool_node_set | , |
struct varpool_node * | |||
) |
Referenced by ipa_lower_emutls().
varpool_node_set_iterator varpool_node_set_find | ( | varpool_node_set | , |
struct varpool_node * | |||
) |
Referenced by emutls_index().
varpool_node_set varpool_node_set_new | ( | void | ) |
Create a new varpool node set.
References varpool_node_set_def::map, varpool_node_set_def::nodes, and pointer_map_create().
Referenced by ipa_lower_emutls().
|
inlinestatic |
Return true if set is nonempty.
void varpool_node_set_remove | ( | varpool_node_set | , |
struct varpool_node * | |||
) |
|
inlinestatic |
Return number of nodes in SET.
bool varpool_output_variables | ( | void | ) |
Output all variables enqueued to be assembled.
References changed, seen_error(), timevar_pop(), timevar_push(), varpool_assemble_decl(), varpool_finalize_named_section_flags(), and varpool_remove_unreferenced_decls().
Referenced by compile().
void varpool_remove_initializer | ( | struct varpool_node * | ) |
Referenced by symtab_remove_unreachable_nodes(), and varpool_remove_node().
void varpool_remove_node | ( | struct varpool_node * | node | ) |
void varpool_reset_queue | ( | void | ) |
|
staticread |
Given NODE, walk the alias chain to return the function NODE is alias of. Do not walk through thunks. When AVAILABILITY is non-NULL, get minimal availability in the chain.
Referenced by ctor_for_folding(), get_constraint_for_ssa_var(), ipa_lower_emutls(), and tree_could_trap_p().
void verify_cgraph | ( | void | ) |
Verify whole cgraph structure.
References seen_error(), and verify_cgraph_node().
Referenced by cgraph_materialize_all_clones(), and ipa_tm_execute().
void verify_cgraph_node | ( | struct cgraph_node * | ) |
void verify_symtab | ( | void | ) |
Verify symbol table for internal consistency.
References verify_symtab_node().
Referenced by compile(), and symtab_remove_unreachable_nodes().
bool verify_symtab_base | ( | symtab_node | ) |
Referenced by verify_cgraph_node(), and verify_symtab_node().
void verify_symtab_node | ( | symtab_node | ) |
Referenced by verify_symtab().
|
inlinestatic |
Return true if iterator VSI points to nothing.
Referenced by dump_varpool_node_set().
|
inlinestatic |
Advance iterator VSI.
Referenced by dump_varpool_node_set().
|
staticread |
Return the node pointed to by VSI.
Referenced by dump_varpool_node_set().
|
inlinestatic |
Return an iterator to the first node in SET.
Referenced by dump_varpool_node_set().
struct asm_node* asm_nodes |
Linked list of cgraph asm nodes.
Referenced by lto_output_toplevel_asms().
const char* const cgraph_availability_names[] |
Names used to print out the availability enum.
Referenced by dump_varpool_node().
FILE* cgraph_dump_file |
int cgraph_edge_max_uid |
Maximal uid used in cgraph edges.
Referenced by cgraph_create_edge_1(), do_estimate_edge_time(), grow_next_edge_clone_vector(), initialize_growth_caches(), inline_summary_alloc(), and ipa_check_create_edge_args().
bool cgraph_function_flags_ready |
Set when the cgraph is fully build and the basic flags are computed.
Referenced by can_refer_decl_in_current_unit_p(), cgraph_variable_initializer_availability(), dump_cgraph_node(), dump_varpool_node(), function_and_variable_visibility(), and varpool_analyze_node().
bool cgraph_global_info_ready |
Set when whole unit has been analyzed so we can access global info.
Referenced by assemble_alias(), cgraph_function_possibly_inlined_p(), cgraph_global_info(), cgraph_remove_node(), cgraph_same_body_alias(), compile(), expand_call_inline(), expand_function(), preserve_function_body_p(), reference_to_unused(), and wrapup_global_declaration_2().
int cgraph_max_uid |
Maximal uid used in cgraph nodes.
Referenced by cgraph_allocate_node(), create_specialized_node(), do_estimate_growth(), initialize_growth_caches(), inline_summary_alloc(), ipa_check_create_node_params(), and ipa_set_node_agg_value_chain().
int cgraph_n_nodes |
Number of nodes in existence.
Referenced by build_toporder_info(), cgraph_create_empty_node(), cgraph_remove_node(), do_per_function_toporder(), expand_all_functions(), inline_small_functions(), ipa_inline(), ipa_profile(), ipa_reduced_postorder(), ipa_reverse_postorder(), ipa_write_summaries(), propagate(), propagate_nothrow(), and propagate_pure_const().
cgraph_node_set cgraph_new_nodes |
@verbatim Driver of optimization process
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/.
This module implements main driver of compilation process. The main scope of this file is to act as an interface in between tree based frontends and the backend. The front-end is supposed to use following functionality: - cgraph_finalize_function This function is called once front-end has parsed whole body of function and it is certain that the function body nor the declaration will change. (There is one exception needed for implementing GCC extern inline function.) - varpool_finalize_decl This function has same behavior as the above but is used for static variables. - add_asm_node Insert new toplevel ASM statement - finalize_compilation_unit This function is called once (source level) compilation unit is finalized and it will no longer change. The symbol table is constructed starting from the trivially needed symbols finalized by the frontend. Functions are lowered into GIMPLE representation and callgraph/reference lists are constructed. Those are used to discover other necessary functions and variables. At the end the bodies of unreachable functions are removed. The function can be called multiple times when multiple source level compilation units are combined. - compile This passes control to the back-end. Optimizations are performed and final assembler is generated. This is done in the following way. Note that with link time optimization the process is split into three stages (compile time, linktime analysis and parallel linktime as indicated bellow). Compile time: 1) Inter-procedural optimization. (ipa_passes) This part is further split into: a) early optimizations. These are local passes executed in the topological order on the callgraph. The purpose of early optimiations is to optimize away simple things that may otherwise confuse IP analysis. Very simple propagation across the callgraph is done i.e. to discover functions without side effects and simple inlining is performed. b) early small interprocedural passes. Those are interprocedural passes executed only at compilation time. These include, for example, transational memory lowering, unreachable code removal and other simple transformations. c) IP analysis stage. All interprocedural passes do their analysis. Interprocedural passes differ from small interprocedural passes by their ability to operate across whole program at linktime. Their analysis stage is performed early to both reduce linking times and linktime memory usage by not having to represent whole program in memory. d) LTO sreaming. When doing LTO, everything important gets streamed into the object file. Compile time and or linktime analysis stage (WPA): At linktime units gets streamed back and symbol table is merged. Function bodies are not streamed in and not available. e) IP propagation stage. All IP passes execute their IP propagation. This is done based on the earlier analysis without having function bodies at hand. f) Ltrans streaming. When doing WHOPR LTO, the program is partitioned and streamed into multple object files. Compile time and/or parallel linktime stage (ltrans) Each of the object files is streamed back and compiled separately. Now the function bodies becomes available again. 2) Virtual clone materialization (cgraph_materialize_clone) IP passes can produce copies of existing functoins (such as versioned clones or inline clones) without actually manipulating their bodies by creating virtual clones in the callgraph. At this time the virtual clones are turned into real functions 3) IP transformation All IP passes transform function bodies based on earlier decision of the IP propagation. 4) late small IP passes Simple IP passes working within single program partition. 5) Expansion (expand_all_functions) At this stage functions that needs to be output into assembler are identified and compiled in topological order 6) Output of variables and aliases Now it is known what variable references was not optimized out and thus all variables are output to the file. Note that with -fno-toplevel-reorder passes 5 and 6 are combined together in cgraph_output_in_order. Finally there are functions to manipulate the callgraph from backend. - cgraph_add_new_function is used to add backend produced functions introduced after the unit is finalized. The functions are enqueue for later processing and inserted into callgraph with cgraph_process_new_functions. - cgraph_function_versioning produces a copy of function into new one (a version) and apply simple transformations
Queue of cgraph nodes scheduled to be added into cgraph. This is a secondary queue used during optimization to accommodate passes that may generate new functions that need to be optimized and expanded.
Referenced by can_remove_node_now_p_1().
enum cgraph_state cgraph_state |
What state callgraph is in right now.
bool cpp_implicit_aliases_done |
Did procss_same_body_aliases run?
Referenced by analyze_functions(), cgraph_process_same_body_aliases(), cgraph_same_body_alias(), and varpool_extra_name_alias().
const char* const ld_plugin_symbol_resolution_names[] |
@verbatim Symbol table.
Copyright (C) 2012-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/.
Referenced by dump_symtab_base().
symtab_node symtab_nodes |
Linked list of symbol table nodes.
Referenced by analyze_functions(), symtab_register_node(), and symtab_unregister_node().
int symtab_order |
The order index of the next symtab node to be created. This is used so that we can sort the cgraph nodes in order by when we saw them, to support -fno-toplevel-reorder.
Referenced by add_asm_node(), input_cgraph_1(), input_node(), input_varpool_node(), lto_input_toplevel_asms(), output_in_order(), and symtab_register_node().