GCC Middle and Back End API Reference
|
#include "config.h"
#include "system.h"
#include "coretypes.h"
#include "backend.h"
#include "rtl.h"
#include "tree.h"
#include "gimple.h"
#include "predict.h"
#include "stringpool.h"
#include "tree-streamer.h"
#include "cgraph.h"
#include "tree-pass.h"
#include "profile.h"
#include "context.h"
#include "pass_manager.h"
#include "ipa-utils.h"
#include "omp-offload.h"
#include "omp-general.h"
#include "attribs.h"
#include "alloc-pool.h"
#include "symbol-summary.h"
#include "symtab-thunks.h"
#include "symtab-clones.h"
Macros | |
#define | LDPR_NUM_KNOWN (LDPR_PREVAILING_DEF_IRONLY_EXP + 1) |
Enumerations | |
enum | LTO_symtab_tags { LTO_symtab_unavail_node = 1 , LTO_symtab_analyzed_node , LTO_symtab_edge , LTO_symtab_indirect_edge , LTO_symtab_variable , LTO_symtab_indirect_function , LTO_symtab_last_tag } |
Variables | |
bool | asm_nodes_output = false |
#define LDPR_NUM_KNOWN (LDPR_PREVAILING_DEF_IRONLY_EXP + 1) |
Number of LDPR values known to GCC.
Referenced by input_overwrite_node(), input_varpool_node(), lto_output_node(), and lto_output_varpool_node().
enum LTO_symtab_tags |
|
static |
Add NODE into encoder as well as nodes it is cloned from. Do it in a way so clones appear first.
References add_node_to(), and cgraph_node::inlined_to.
|
static |
Add NODE into encoder as well as nodes it is cloned from. Do it in a way so clones appear first.
References add_node_to(), cgraph_node::clone_of, gcc_checking_assert, lto_symtab_encoder_encode(), and lto_symtab_encoder_d::nodes.
Referenced by add_node_to(), add_node_to(), compute_ltrans_boundary(), and create_references().
lto_symtab_encoder_t compute_ltrans_boundary | ( | lto_symtab_encoder_t | in_encoder | ) |
Find all symbols we want to stream into given partition and insert them to encoders. The function actually replaces IN_ENCODER by new one. The reason is that streaming code needs clone's origin to be streamed before clone. This means that we need to insert the nodes in specific order. This order is ignored by the partitioning logic earlier.
References hash_set< KeyId, Lazy, Traits >::add(), add_node_to(), symtab_node::alias, symtab_node::analyzed, cgraph_edge::callee, cgraph_node::callees, create_references(), DECL_VIRTUAL_P, symtab_node::definition, dyn_cast(), gcc_assert, symtab_node::get_alias_target(), i, cgraph_node::indirect_calls, cgraph_node::inlined_to, is_a(), lsei_cgraph_node(), lsei_end_p(), lsei_next_function_in_partition(), lsei_next_variable_in_partition(), lsei_start_function_in_partition(), lsei_start_variable_in_partition(), lsei_varpool_node(), lto_set_symtab_encoder_encode_initializer(), lto_set_symtab_encoder_in_partition(), lto_symtab_encoder_delete(), lto_symtab_encoder_deref(), lto_symtab_encoder_encode(), lto_symtab_encoder_encode_initializer_p(), lto_symtab_encoder_in_partition_p(), lto_symtab_encoder_new(), lto_symtab_encoder_size(), symtab_node::need_lto_streaming, cgraph_edge::next_callee, NULL, possible_polymorphic_call_targets(), cgraph_node::thunk, and symtab_node::transparent_alias.
Referenced by ipa_write_summaries().
|
static |
Add all references in NODE to encoders.
References add_node_to(), dyn_cast(), i, is_a(), symtab_node::iterate_reference(), lto_symtab_encoder_encode(), NULL, and ipa_ref::referred.
Referenced by compute_ltrans_boundary().
Return string alias is alias of.
References DECL_ATTRIBUTES, get_identifier(), lookup_attribute(), TREE_STRING_POINTER, and TREE_VALUE.
Referenced by input_node(), and input_varpool_node().
|
static |
Read a cgraph from IB using the info in FILE_DATA.
References symtab_node::aux, symtab_node::decl, dyn_cast(), FOR_EACH_VEC_ELT, gcc_assert, i, input_edge(), input_node(), input_varpool_node(), internal_error(), is_a(), LCC_NOT_FOUND, lto_input_toplevel_asms(), LTO_symtab_edge, lto_symtab_encoder_encode(), LTO_symtab_indirect_edge, LTO_symtab_last_tag, LTO_symtab_variable, symbol_table::max_unit, NULL, NULL_TREE, symbol_table::order, lto_file_decl_data::order_base, symtab_node::same_comdat_group, streamer_read_enum, symtab, lto_file_decl_data::symtab_node_encoder, lto_file_decl_data::unit_base, and vNULL.
Referenced by input_symtab().
|
static |
Read section in file FILE_DATA of length LEN with data DATA.
References count, dyn_cast(), data_in::file_data, header, i, input_node_opt_summary(), lto_data_in_create(), lto_data_in_delete(), lto_free_section_data(), LTO_section_cgraph_opt_sum, NULL, streamer_read_uhwi(), and vNULL.
Referenced by input_cgraph_opt_summary().
|
static |
Input optimization summary of cgraph.
References input_cgraph_opt_section(), lto_get_file_decl_data(), lto_get_summary_section_data(), and LTO_section_cgraph_opt_sum.
Referenced by input_symtab().
|
static |
Read an edge from IB. NODES points to a vector of previously read nodes for decoding caller and callee of the edge to be read. If INDIRECT is true, the edge being read is indirect (in the sense that it has indirect_unknown_callee set).
References bp_unpack_enum, bp_unpack_value(), bp_unpack_var_len_unsigned(), count, cgraph_node::create_edge(), cgraph_node::create_indirect_edge(), symtab_node::decl, dyn_cast(), ECF_CONST, ECF_MALLOC, ECF_NORETURN, ECF_NOTHROW, ECF_PURE, ECF_RETURNS_TWICE, cgraph_edge::indirect_inlining_edge, cgraph_edge::inline_failed, internal_error(), NULL, NULL_TREE, cgraph_edge::speculative_id, profile_count::stream_in(), streamer_read_bitpack(), and streamer_read_hwi().
Referenced by input_cgraph_1().
|
static |
Input optimisation summary of EDGE.
Referenced by input_node_opt_summary().
|
static |
Read a node from input_block IB. TAG is the node's tag just read. Return the node read or overwriten.
References symtab_node::alias, symtab_node::alias_target, symtab_node::analyzed, symtab_node::aux, cgraph_node::count, count, cgraph_node::count_materialization_scale, symbol_table::create_empty(), symtab_node::decl, DECL_ATTRIBUTES, DECL_STATIC_CONSTRUCTOR, DECL_STATIC_DESTRUCTOR, dyn_cast(), fndecl_built_in_p(), g, gcc_assert, get_alias_symbol(), thunk_info::get_create(), gcc::context::get_passes(), cgraph_node::get_uid(), i, symtab_node::ifunc_resolver, cgraph_node::inlined_to, input_overwrite_node(), internal_error(), cgraph_node::ipa_transforms_to_apply, LCC_NOT_FOUND, lookup_attribute(), lto_input_fn_decl_ref(), LTO_symtab_analyzed_node, symbol_table::max_unit, NULL, symbol_table::order, symtab_node::order, lto_file_decl_data::order_base, gcc::pass_manager::passes_by_id, cgraph_node::profile_id, read_identifier(), read_string(), symtab_node::register_symbol(), symtab_node::same_comdat_group, symtab_node::set_comdat_group(), cgraph_node::set_fini_priority(), symtab_node::set_init_priority(), symtab_node::set_section_for_node(), profile_count::stream_in(), thunk_info::stream_in(), streamer_read_bitpack(), streamer_read_hwi(), streamer_read_uhwi(), symtab, cgraph_node::tp_first_run, profile_count::uninitialized(), lto_file_decl_data::unit_base, cgraph_node::unit_id, vNULL, and symtab_node::weakref.
Referenced by input_cgraph_1().
|
static |
Input optimisation summary of NODE.
References ipa_adjusted_param::alias_ptr_type, ipa_adjusted_param::base_index, bp_unpack_value(), cgraph_node::callees, count, clone_info::get_create(), ggc_alloc(), i, cgraph_node::indirect_calls, input_edge_opt_summary(), IPA_PARAM_MAX_INDEX_BITS, IPA_PARAM_OP_NEW, IPA_PARAM_OP_SPLIT, map, cgraph_edge::next_callee, NULL, ipa_adjusted_param::op, clone_info::param_adjustments, ipa_adjusted_param::param_prefix_index, ipa_adjusted_param::prev_clone_adjustment, ipa_adjusted_param::prev_clone_index, ipa_adjusted_param::reverse, stream_read_tree, streamer_read_bitpack(), streamer_read_hwi(), streamer_read_uhwi(), clone_info::tree_map, ipa_adjusted_param::type, ipa_adjusted_param::unit_offset, ipa_adjusted_param::user_flag, and vec_safe_push().
Referenced by input_cgraph_opt_section().
void input_offload_tables | ( | bool | do_force_output | ) |
Input function/variable tables that will allow libgomp to look up offload target code, and store them into OFFLOAD_FUNCS and OFFLOAD_VARS.
References DECL_CONTEXT, DECL_NAME, error(), fatal_error(), lto_input_block::file_data, lto_file_decl_data::file_name, fopen, symtab_node::force_output, cgraph_node::get(), varpool_node::get(), IDENTIFIER_POINTER, inform(), input_location, lto_input_block::len, lto_create_simple_input_block(), lto_destroy_simple_input_block(), lto_get_file_decl_data(), lto_input_fn_decl_ref(), lto_input_var_decl_ref(), LTO_section_offload_table, LTO_symtab_edge, LTO_symtab_indirect_function, LTO_symtab_last_tag, LTO_symtab_unavail_node, LTO_symtab_variable, cgraph_node::mark_force_output(), NULL, NULL_TREE, offload_funcs, offload_ind_funcs, offload_vars, omp_requires_mask, OMP_REQUIRES_TARGET_USED, omp_requires_to_name(), streamer_read_enum, streamer_read_hwi(), TREE_CODE, UNKNOWN_LOCATION, and vec_safe_push().
|
static |
Overwrite the information in NODE based on FILE_DATA, TAG, FLAGS, STACK_SIZE, SELF_TIME and SELF_SIZE. This is called either to initialize NODE or to replace the values in it, for instance because the first time we saw it, the function body was not available but now it is. BP is a bitpack with all the bitflags for NODE read from the stream. Initialize HAS_THUNK_INFO to indicate if thunk info should be streamed in.
References symtab_node::address_taken, symtab_node::alias, symtab_node::analyzed, symtab_node::aux, symtab_node::body_removed, bp_unpack_enum, bp_unpack_value(), cgraph_node::calls_comdat_local, cgraph_node::calls_declare_variant_alt, cgraph_node::can_change_signature, cgraph_node::clone_of, symtab_node::decl, DECL_EXTERNAL, cgraph_node::declare_variant_alt, symtab_node::definition, symtab_node::externally_visible, symtab_node::force_output, symtab_node::forced_by_abi, cgraph_node::frequency, cgraph_node::icf_merged, symtab_node::implicit_section, symtab_node::in_other_partition, LDPR_NUM_KNOWN, cgraph_node::local, cgraph_node::lowered, symtab_node::lto_file_data, LTO_symtab_analyzed_node, cgraph_node::merged_comdat, cgraph_node::merged_extern_inline, symtab_node::no_reorder, cgraph_node::nonfreeing_fn, cgraph_node::only_called_at_exit, cgraph_node::only_called_at_startup, cgraph_node::parallelized_function, cgraph_node::redefined_extern_inline, symtab_node::resolution, symtab_node::semantic_interposition, cgraph_node::split_part, symtab_node::symver, cgraph_node::thunk, cgraph_node::tm_clone, symtab_node::transparent_alias, TREE_STATIC, symtab_node::unique_name, symtab_node::used_from_other_partition, verify_node_partition(), cgraph_node::versionable, and symtab_node::weakref.
Referenced by input_node().
|
static |
Input profile_info from IB.
References lto_file_decl_data::profile_info, gcov_summary::runs, set_hot_bb_threshold(), streamer_read_gcov_count(), and streamer_read_uhwi().
Referenced by input_symtab().
|
static |
Read a node from input_block IB. TAG is the node's tag just read. Return the node read or overwriten.
References bp_unpack_value(), symtab_node::create_reference(), is_a(), ipa_ref::lto_stmt_uid, NULL, ipa_ref::speculative, ipa_ref::speculative_id, streamer_read_bitpack(), and streamer_read_hwi().
Referenced by input_refs().
|
static |
Input ipa_refs.
References count, dyn_cast(), input_ref(), omp_lto_input_declare_variant_alt(), and streamer_read_uhwi().
Referenced by input_symtab().
void input_symtab | ( | void | ) |
Input and merge the symtab from each of the .o files passed to lto1.
References symtab_node::aux, fatal_error(), lto_input_block::file_data, lto_file_decl_data::file_name, FOR_EACH_FUNCTION, input_cgraph_1(), input_cgraph_opt_summary(), input_location, input_profile_summary(), input_refs(), lto_input_block::len, lto_create_simple_input_block(), lto_destroy_simple_input_block(), symtab_node::lto_file_data, lto_get_file_decl_data(), LTO_section_refs, LTO_section_symtab_nodes, lto_symtab_encoder_new(), merge_profile_summaries(), NULL, and lto_file_decl_data::symtab_node_encoder.
|
static |
Read a node from input_block IB. TAG is the node's tag just read. Return the node read or overwriten.
References symtab_node::alias, symtab_node::alias_target, symtab_node::analyzed, symtab_node::body_removed, bp_unpack_value(), varpool_node::create_empty(), symtab_node::decl, DECL_EXTERNAL, symtab_node::definition, varpool_node::dynamically_initialized, symtab_node::externally_visible, symtab_node::force_output, symtab_node::forced_by_abi, get_alias_symbol(), symtab_node::implicit_section, symtab_node::in_other_partition, LCC_NOT_FOUND, LDPR_NUM_KNOWN, symtab_node::lto_file_data, lto_input_var_decl_ref(), symtab_node::no_reorder, symbol_table::order, symtab_node::order, lto_file_decl_data::order_base, read_identifier(), read_string(), symtab_node::register_symbol(), symtab_node::resolution, symtab_node::same_comdat_group, symtab_node::semantic_interposition, symtab_node::set_comdat_group(), symtab_node::set_section_for_node(), streamer_read_bitpack(), streamer_read_enum, streamer_read_hwi(), symtab, symtab_node::symver, varpool_node::tls_model, symtab_node::transparent_alias, TREE_STATIC, symtab_node::unique_name, varpool_node::used_by_single_function, symtab_node::used_from_other_partition, verify_node_partition(), symtab_node::weakref, and symtab_node::writeonly.
Referenced by input_cgraph_1().
|
static |
Output the cgraph EDGE to OB using ENCODER.
References bitpack_create(), bp_pack_enum, bp_pack_value(), bp_pack_var_len_unsigned(), ECF_CONST, ECF_LEAF, ECF_LOOPING_CONST_OR_PURE, ECF_MALLOC, ECF_MAY_BE_ALLOCA, ECF_NORETURN, ECF_NOTHROW, ECF_NOVOPS, ECF_PURE, ECF_RETURNS_TWICE, ECF_SIBCALL, gcc_assert, gcc_checking_assert, gimple_uid(), LCC_NOT_FOUND, LTO_symtab_edge, lto_symtab_encoder_lookup(), LTO_symtab_indirect_edge, LTO_symtab_last_tag, lto_simple_output_block::main_stream, streamer_write_bitpack(), streamer_write_enum, and streamer_write_hwi_stream().
Referenced by output_outgoing_cgraph_edges().
|
static |
Output the cgraph NODE to OB. ENCODER is used to find the reference number of NODE->inlined_to. SET is the set of nodes we are writing to the current file. If NODE is not in SET, then NODE is a boundary of a cgraph_node_set and we pretend NODE just has a decl and no callees. WRITTEN_DECLS is the set of FUNCTION_DECLs that have had their callgraph node written so far. This is used to determine if NODE is a clone of a previously written node.
References symtab_node::address_taken, symtab_node::alias, symtab_node::analyzed, bitpack_create(), symtab_node::body_removed, bp_pack_enum, bp_pack_value(), cgraph_node::calls_comdat_local, cgraph_node::calls_declare_variant_alt, cgraph_node::can_change_signature, cgraph_node::clone_of, cgraph_node::count, cgraph_node::count_materialization_scale, symtab_node::decl, DECL_ATTRIBUTES, lto_simple_output_block::decl_state, DECL_STATIC_CONSTRUCTOR, DECL_STATIC_DESTRUCTOR, cgraph_node::declare_variant_alt, symtab_node::definition, symtab_node::externally_visible, FOR_EACH_VEC_ELT, symtab_node::force_output, symtab_node::forced_by_abi, cgraph_node::frequency, gcc_assert, hash_map< KeyId, Value, Traits >::get(), thunk_info::get(), symtab_node::get_comdat_group(), cgraph_node::get_fini_priority(), symtab_node::get_init_priority(), symtab_node::get_partitioning_class(), symtab_node::get_section(), i, cgraph_node::icf_merged, IDENTIFIER_POINTER, symtab_node::implicit_section, symtab_node::in_other_partition, INCREMENTAL_LINK_LTO, cgraph_node::inlined_to, cgraph_node::ipa_transforms_to_apply, LCC_NOT_FOUND, LDPR_NUM_KNOWN, cgraph_node::local, lookup_attribute(), cgraph_node::lowered, lto_output_fn_decl_ref(), lto_stream_offload_p, LTO_symtab_analyzed_node, lto_symtab_encoder_encode_body_p(), lto_symtab_encoder_in_partition_p(), lto_symtab_encoder_lookup(), LTO_symtab_last_tag, LTO_symtab_unavail_node, lto_simple_output_block::main_stream, cgraph_node::merged_comdat, cgraph_node::merged_extern_inline, symtab_node::no_reorder, cgraph_node::nonfreeing_fn, NULL, cgraph_node::only_called_at_exit, cgraph_node::only_called_at_startup, symtab_node::order, lto_symtab_encoder_d::order_remap, cgraph_node::parallelized_function, cgraph_node::prev_sibling_clone, cgraph_node::profile_id, reachable_from_other_partition_p(), cgraph_node::redefined_extern_inline, referenced_from_other_partition_p(), symtab_node::resolution, symtab_node::same_comdat_group, symtab_node::semantic_interposition, cgraph_node::split_part, opt_pass::static_pass_number, profile_count::stream_out(), thunk_info::stream_out(), streamer_write_bitpack(), streamer_write_data_stream(), streamer_write_enum, streamer_write_hwi_stream(), SYMBOL_PARTITION, symtab_node::symver, cgraph_node::thunk, cgraph_node::tm_clone, cgraph_node::tp_first_run, symtab_node::transparent_alias, symtab_node::unique_name, cgraph_node::unit_id, UNLIKELY, cgraph_node::versionable, and symtab_node::weakref.
Referenced by output_symtab().
|
static |
Output the varpool NODE to OB. If NODE is not in SET, then NODE is a boundary.
References bitpack_create(), bp_pack_value(), dyn_cast(), gcc_assert, gimple_uid(), LCC_NOT_FOUND, ipa_ref::lto_stmt_uid, lto_symtab_encoder_lookup(), lto_simple_output_block::main_stream, ipa_ref::referred, ipa_ref::referring, ipa_ref::speculative, ipa_ref::speculative_id, ipa_ref::stmt, streamer_write_bitpack(), streamer_write_hwi_stream(), and ipa_ref::use.
Referenced by output_refs().
|
static |
Output the varpool NODE to OB. If NODE is not in SET, then NODE is a boundary.
References symtab_node::alias, symtab_node::analyzed, bitpack_create(), symtab_node::body_removed, bp_pack_value(), symtab_node::decl, DECL_EXTERNAL, lto_simple_output_block::decl_state, symtab_node::definition, varpool_node::dynamically_initialized, symtab_node::externally_visible, symtab_node::force_output, symtab_node::forced_by_abi, gcc_assert, hash_map< KeyId, Value, Traits >::get(), symtab_node::get_comdat_group(), symtab_node::get_partitioning_class(), symtab_node::get_section(), IDENTIFIER_POINTER, symtab_node::implicit_section, LCC_NOT_FOUND, LDPR_NUM_KNOWN, lto_output_var_decl_ref(), lto_symtab_encoder_encode_initializer_p(), lto_symtab_encoder_in_partition_p(), lto_symtab_encoder_lookup(), LTO_symtab_last_tag, LTO_symtab_variable, lto_simple_output_block::main_stream, symtab_node::no_reorder, symtab_node::order, lto_symtab_encoder_d::order_remap, referenced_from_other_partition_p(), symtab_node::resolution, symtab_node::same_comdat_group, symtab_node::semantic_interposition, streamer_write_bitpack(), streamer_write_data_stream(), streamer_write_enum, streamer_write_hwi_stream(), SYMBOL_PARTITION, symtab_node::symver, varpool_node::tls_model, symtab_node::transparent_alias, symtab_node::unique_name, varpool_node::used_by_single_function, symtab_node::weakref, and symtab_node::writeonly.
Referenced by output_symtab().
|
static |
Specify that we should encode initializer of NODE (if any).
References lto_symtab_encoder_lookup(), and lto_symtab_encoder_d::nodes.
Referenced by compute_ltrans_boundary().
void lto_set_symtab_encoder_in_partition | ( | lto_symtab_encoder_t | encoder, |
symtab_node * | node ) |
Specify that NODE is in this partition.
References lto_symtab_encoder_encode(), and lto_symtab_encoder_d::nodes.
Referenced by compute_ltrans_boundary(), and ipa_write_summaries().
void lto_symtab_encoder_delete | ( | lto_symtab_encoder_t | encoder | ) |
Delete ENCODER and its components.
References free(), lto_symtab_encoder_d::map, lto_symtab_encoder_d::nodes, and lto_symtab_encoder_d::order_remap.
Referenced by compute_ltrans_boundary(), and produce_asm_for_decls().
bool lto_symtab_encoder_delete_node | ( | lto_symtab_encoder_t | encoder, |
symtab_node * | node ) |
Remove NODE from encoder.
References gcc_assert, gcc_checking_assert, hash_map< KeyId, Value, Traits >::get(), lto_symtab_encoder_d::map, lto_encoder_entry::node, lto_symtab_encoder_d::nodes, NULL, hash_map< KeyId, Value, Traits >::put(), and hash_map< KeyId, Value, Traits >::remove().
int lto_symtab_encoder_encode | ( | lto_symtab_encoder_t | encoder, |
symtab_node * | node ) |
Return the existing reference number of NODE in the symtab encoder in output block OB. Assign a new reference if this is the first time NODE is encoded.
References hash_map< KeyId, Value, Traits >::get(), lto_symtab_encoder_d::map, lto_symtab_encoder_d::nodes, and hash_map< KeyId, Value, Traits >::put().
Referenced by add_node_to(), compute_ltrans_boundary(), create_references(), input_cgraph_1(), ipa_fn_summary_write(), ipa_profile_write_summary(), ipa_reference_write_optimization_summary(), ipa_write_node_info(), lto_set_symtab_encoder_in_partition(), pure_const_write_summary(), write_ipcp_transformation_info(), and ipa_icf::sem_item_optimizer::write_summary().
bool lto_symtab_encoder_encode_body_p | ( | lto_symtab_encoder_t | encoder, |
struct cgraph_node * | node ) |
Return TRUE if we should encode the body of NODE (if any).
References lto_symtab_encoder_lookup(), and lto_symtab_encoder_d::nodes.
Referenced by ipcp_write_transformation_summaries(), lto_output(), and lto_output_node().
bool lto_symtab_encoder_encode_initializer_p | ( | lto_symtab_encoder_t | encoder, |
varpool_node * | node ) |
Return TRUE if we should encode initializer of NODE (if any).
References LCC_NOT_FOUND, lto_symtab_encoder_lookup(), and lto_symtab_encoder_d::nodes.
Referenced by compute_ltrans_boundary(), get_symbol_initial_value(), lto_output(), and lto_output_varpool_node().
bool lto_symtab_encoder_in_partition_p | ( | lto_symtab_encoder_t | encoder, |
symtab_node * | node ) |
Return TRUE if NODE is in this partition.
References LCC_NOT_FOUND, lto_symtab_encoder_lookup(), and lto_symtab_encoder_d::nodes.
Referenced by compute_ltrans_boundary(), lsei_next_function_in_partition(), lsei_next_in_partition(), lsei_next_variable_in_partition(), lsei_start_function_in_partition(), lsei_start_in_partition(), lsei_start_variable_in_partition(), lto_output_node(), lto_output_varpool_node(), output_node_opt_summary(), output_refs(), output_symtab(), reachable_from_other_partition_p(), reachable_from_this_partition_p(), referenced_from_other_partition_p(), and referenced_from_this_partition_p().
lto_symtab_encoder_t lto_symtab_encoder_new | ( | bool | for_input | ) |
Create a new symtab encoder. if FOR_INPUT, the encoder allocate only datastructures needed to read the symtab.
References lto_symtab_encoder_d::map, and lto_symtab_encoder_d::nodes.
Referenced by compute_ltrans_boundary(), input_symtab(), and ipa_write_summaries().
bool lto_symtab_encoder_only_for_inlining_p | ( | lto_symtab_encoder_t | encoder, |
struct cgraph_node * | node ) |
Return TRUE if the NODE and its clones are always inlined.
References lto_symtab_encoder_lookup(), and lto_symtab_encoder_d::nodes.
Referenced by write_ipcp_transformation_info().
|
static |
Rescale profile summaries to the same number of runs in the whole unit.
References profile_count::apply_scale(), cgraph_node::callees, cgraph_node::count, cgraph_node::count_materialization_scale, fatal_error(), lto_file_decl_data::file_name, FOR_EACH_FUNCTION, cgraph_node::indirect_calls, input_location, INT_MAX, profile_count::ipa(), symtab_node::lto_file_data, cgraph_edge::next_callee, profile_count::nonzero_p(), NULL, lto_file_decl_data::profile_info, profile_info, RDIV, REG_BR_PROB_BASE, gcov_summary::runs, and sorry().
Referenced by input_symtab().
|
static |
References end(), and lto_input_block::p.
Referenced by input_offload_tables().
|
static |
Output optimization summaries stored in callgraph. At the moment it is the clone info structure.
References count, create_output_block(), output_block::decl_state, destroy_output_block(), dyn_cast(), i, LTO_section_cgraph_opt_sum, lto_symtab_encoder_deref(), lto_symtab_encoder_size(), NULL, output_cgraph_opt_summary_p(), output_node_opt_summary(), produce_asm(), streamer_write_uhwi(), output_block::symbol, and lto_out_decl_state::symtab_node_encoder.
Referenced by output_symtab().
|
static |
True when we need optimization summary for NODE.
References cgraph_node::clone_of, cgraph_node::former_clone_of, clone_info::get(), clone_info::param_adjustments, and clone_info::tree_map.
Referenced by output_cgraph_opt_summary().
|
static |
Output optimization summary for EDGE to OB.
Referenced by output_node_opt_summary().
|
static |
Output optimization summary for NODE to OB.
References ipa_adjusted_param::alias_ptr_type, ipa_adjusted_param::base_index, bitpack_create(), bp_pack_value(), cgraph_node::callees, EXPR_LOCATION, FOR_EACH_VEC_SAFE_ELT, gcc_assert, clone_info::get(), i, cgraph_node::indirect_calls, IPA_PARAM_MAX_INDEX_BITS, IPA_PARAM_OP_NEW, IPA_PARAM_OP_SPLIT, lto_symtab_encoder_in_partition_p(), ipa_param_adjustments::m_skip_return, output_block::main_stream, map, cgraph_edge::next_callee, NULL, ipa_adjusted_param::op, output_edge_opt_summary(), clone_info::param_adjustments, ipa_adjusted_param::param_prefix_index, ipa_adjusted_param::prev_clone_adjustment, ipa_adjusted_param::prev_clone_index, ipa_adjusted_param::reverse, stream_write_tree, streamer_write_bitpack(), streamer_write_hwi(), streamer_write_uhwi(), clone_info::tree_map, ipa_adjusted_param::type, ipa_adjusted_param::unit_offset, UNKNOWN_LOCATION, ipa_adjusted_param::user_flag, and vec_safe_length().
Referenced by output_cgraph_opt_summary().
void output_offload_tables | ( | void | ) |
Output function/variable tables that will allow libgomp to look up offload target code. OFFLOAD_FUNCS is filled in expand_omp_target, OFFLOAD_VARS is filled in varpool_node::get_create. In WHOPR (partitioned) mode during the WPA stage both OFFLOAD_FUNCS and OFFLOAD_VARS are filled by input_offload_tables.
References lto_simple_output_block::decl_state, symtab_node::force_output, symtab_node::get(), i, lto_create_simple_output_block(), lto_destroy_simple_output_block(), lto_output_fn_decl_ref(), lto_output_var_decl_ref(), LTO_section_offload_table, LTO_symtab_edge, LTO_symtab_indirect_function, LTO_symtab_last_tag, LTO_symtab_unavail_node, LTO_symtab_variable, lto_simple_output_block::main_stream, offload_funcs, offload_ind_funcs, offload_vars, omp_requires_mask, OMP_REQUIRES_REVERSE_OFFLOAD, OMP_REQUIRES_SELF_MAPS, OMP_REQUIRES_TARGET_USED, OMP_REQUIRES_UNIFIED_ADDRESS, OMP_REQUIRES_UNIFIED_SHARED_MEMORY, streamer_write_enum, streamer_write_hwi_stream(), streamer_write_uhwi_stream(), vec_safe_is_empty(), and vec_safe_length().
Referenced by lto_output().
|
static |
Output all callees or indirect outgoing edges. EDGE must be the first such edge.
References lto_output_edge().
Referenced by output_symtab().
|
static |
Stream out profile_summary to OB.
References get_hot_bb_threshold(), lto_simple_output_block::main_stream, profile_info, gcov_summary::runs, streamer_write_gcov_count_stream(), and streamer_write_uhwi_stream().
Referenced by output_symtab().
|
static |
Output the part of the cgraph in SET.
References symtab_node::alias, count, dyn_cast(), i, symtab_node::iterate_reference(), lto_create_simple_output_block(), lto_destroy_simple_output_block(), lto_output_ref(), LTO_section_refs, lto_symtab_encoder_deref(), lto_symtab_encoder_in_partition_p(), lto_symtab_encoder_lookup(), lto_symtab_encoder_size(), lto_simple_output_block::main_stream, ipa_ref_list::nreferences(), omp_lto_output_declare_variant_alt(), symtab_node::ref_list, streamer_write_gcov_count_stream(), and streamer_write_uhwi_stream().
Referenced by output_symtab().
void output_symtab | ( | void | ) |
Output the part of the symtab in SET and VSET.
References asm_nodes_output, cgraph_node::callees, lto_simple_output_block::decl_state, dyn_cast(), gcc_assert, i, cgraph_node::indirect_calls, cgraph_node::inlined_to, lto_create_simple_output_block(), lto_destroy_simple_output_block(), lto_output_node(), lto_output_toplevel_asms(), lto_output_varpool_node(), LTO_section_symtab_nodes, lto_stream_offload_p, lto_symtab_encoder_deref(), lto_symtab_encoder_in_partition_p(), lto_symtab_encoder_size(), lto_simple_output_block::main_stream, output_cgraph_opt_summary(), output_outgoing_cgraph_edges(), output_profile_summary(), output_refs(), streamer_write_uhwi_stream(), lto_out_decl_state::symtab_node_encoder, and cgraph_node::thunk.
Referenced by lto_output().
bool reachable_from_other_partition_p | ( | struct cgraph_node * | node, |
lto_symtab_encoder_t | encoder ) |
Return true when node is reachable from other partition.
References cgraph_edge::caller, cgraph_node::callers, symtab_node::definition, symtab_node::in_other_partition, cgraph_node::inlined_to, lto_symtab_encoder_in_partition_p(), symtab_node::need_lto_streaming, and cgraph_edge::next_caller.
Referenced by lto_output_node().
bool reachable_from_this_partition_p | ( | struct cgraph_node * | node, |
lto_symtab_encoder_t | encoder ) |
Return true when node is reachable from other partition.
References cgraph_edge::caller, cgraph_node::callers, lto_symtab_encoder_in_partition_p(), and cgraph_edge::next_caller.
Referenced by write_node_summary_p().
|
static |
Return identifier encoded in IB as a plain string.
References lto_input_block::data, get_identifier(), lto_input_block::len, lto_section_overrun(), NULL, and lto_input_block::p.
Referenced by input_node(), and input_varpool_node().
|
static |
Return string encoded in IB, NULL if string is empty.
References lto_input_block::data, lto_input_block::len, lto_section_overrun(), NULL, and lto_input_block::p.
Referenced by input_node(), and input_varpool_node().
bool referenced_from_other_partition_p | ( | symtab_node * | node, |
lto_symtab_encoder_t | encoder ) |
Return if NODE contain references from other partitions.
References i, symtab_node::in_other_partition, symtab_node::iterate_referring(), lto_symtab_encoder_in_partition_p(), symtab_node::need_lto_streaming, NULL, and ipa_ref::referring.
Referenced by lto_output_node(), and lto_output_varpool_node().
bool referenced_from_this_partition_p | ( | symtab_node * | node, |
lto_symtab_encoder_t | encoder ) |
Return if NODE contain references from other partitions.
References i, symtab_node::iterate_referring(), lto_symtab_encoder_in_partition_p(), NULL, and ipa_ref::referring.
Referenced by ipa_reference_write_optimization_summary(), and write_node_summary_p().
void select_what_to_stream | ( | void | ) |
Select what needs to be streamed out. In regular lto mode stream everything. In offload lto mode stream only nodes marked as offloadable.
References FOR_EACH_SYMBOL, lto_stream_offload_p, symtab_node::need_lto_streaming, and symtab_node::offloadable.
Referenced by ipa_write_summaries().
|
inlinestatic |
Verify the partitioning of NODE.
References symtab_node::decl, DECL_ATTRIBUTES, DECL_SOURCE_LOCATION, error_at(), gcc_assert, gcc_unreachable, symtab_node::in_other_partition, lookup_attribute(), symtab_node::name(), NULL, TREE_CODE, symtab_node::used_from_other_partition, and VAR_P.
Referenced by input_overwrite_node(), and input_varpool_node().
Write and read the cgraph to the memory mapped representation of a .o file. Copyright (C) 2009-2024 Free Software Foundation, Inc. Contributed by Kenneth Zadeck <zadeck@naturalbridge.com> This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GCC; see the file COPYING3. If not see <http://www.gnu.org/licenses/>.
True when asm nodes has been output.
Referenced by create_order_remap(), and output_symtab().