GCC Middle and Back End API Reference
|
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_last_tag } |
Variables | |
static int | order_base |
static struct gcov_ctr_summary | lto_gcov_summary |
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 cgraph_node::clone_of, lto_set_symtab_encoder_encode_body(), and lto_symtab_encoder_encode().
Referenced by add_references(), and compute_ltrans_boundary().
|
static |
Add all references in LIST to encoders.
References add_node_to(), ipa_ref_node(), lto_symtab_encoder_encode(), and ipa_ref::referred.
Referenced by compute_ltrans_boundary().
lto_symtab_encoder_t compute_ltrans_boundary | ( | ) |
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 add_node_to(), add_references(), cgraph_edge::callee, cgraph_node::callees, cgraph_get_node(), ctor_for_folding(), symtab_node_base::decl, 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_initializer_p(), lto_symtab_encoder_in_partition_p(), lto_symtab_encoder_new(), lto_symtab_encoder_size(), cgraph_edge::next_callee, cgraph_node::symbol, and varpool_get_node().
Referenced by ipa_write_summaries().
|
static |
Return string alias is alias of.
References get_identifier(), and lookup_attribute().
Referenced by input_node(), and input_varpool_node().
|
static |
Read a cgraph from IB using the info in FILE_DATA.
References cgraph(), cgraph_node::global, cgraph_global_info::inlined_to, input_edge(), input_node(), input_varpool_node(), internal_error(), lto_input_toplevel_asms(), LTO_symtab_edge, lto_symtab_encoder_encode(), LTO_symtab_indirect_edge, LTO_symtab_last_tag, LTO_symtab_variable, order_base, lto_file_decl_data::symtab_node_encoder, symtab_order, and vNULL.
Referenced by input_symtab().
|
static |
Read section in file FILE_DATA of length LEN with data DATA.
References lto_function_header::cfg_size, cgraph(), count, input_node_opt_summary(), lto_data_in_create(), lto_data_in_delete(), lto_free_section_data(), LTO_section_cgraph_opt_sum, lto_function_header::main_size, streamer_read_uhwi(), lto_function_header::string_size, and vNULL.
Referenced by input_cgraph_opt_summary().
|
static |
Referenced by input_symtab().
|
static |
Input optimization summary of cgraph.
References input_cgraph_opt_section(), len, lto_get_file_decl_data(), lto_get_section_data(), and LTO_section_cgraph_opt_sum.
|
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_value(), bp_unpack_var_len_unsigned(), cgraph_edge::call_stmt_cannot_inline_p, cgraph_edge::can_throw_external, cgraph(), cgraph_create_edge(), cgraph_create_indirect_edge(), CIF_N_REASONS, cgraph_indirect_call_info::common_target_id, cgraph_indirect_call_info::common_target_probability, count, symtab_node_base::decl, cgraph_indirect_call_info::ecf_flags, cgraph_edge::indirect_info, cgraph_edge::indirect_inlining_edge, cgraph_edge::inline_failed, internal_error(), cgraph_edge::lto_stmt_uid, cgraph_edge::speculative, streamer_read_bitpack(), streamer_read_gcov_count(), streamer_read_hwi(), and cgraph_node::symbol.
Referenced by input_cgraph_1().
|
static |
Input optimisation summary of EDGE.
Referenced by input_node_opt_summary().
|
staticread |
Read a node from input_block IB. TAG is the node's tag just read. Return the node read or overwriten.
References symtab_node_base::alias, symtab_node_base::alias_target, symtab_node_base::analyzed, symtab_node_base::aux, cgraph(), cgraph_clone_node(), cgraph_create_empty_node(), count, cgraph_node::count, cgraph_node::count_materialization_scale, symtab_node_base::decl, cgraph_thunk_info::fixed_offset, g, get_alias_symbol(), gcc::context::get_passes(), cgraph_node::global, HOST_WIDE_INT, cgraph_global_info::inlined_to, input_overwrite_node(), internal_error(), cgraph_node::ipa_transforms_to_apply, LTO_symtab_analyzed_node, symtab_node_base::order, order, order_base, gcc::pass_manager::passes_by_id, cgraph_node::profile_id, symtab_node_base::same_comdat_group, streamer_read_bitpack(), streamer_read_gcov_count(), streamer_read_hwi(), streamer_read_uhwi(), cgraph_node::symbol, symtab_order, symtab_register_node(), cgraph_thunk_info::this_adjusting, cgraph_node::thunk, cgraph_thunk_info::thunk_p, cgraph_node::uid, cgraph_thunk_info::virtual_offset_p, cgraph_thunk_info::virtual_value, vNULL, and symtab_node_base::weakref.
Referenced by input_cgraph_1().
|
static |
Input optimisation summary of NODE.
References cgraph_clone_info::args_to_skip, bitmap_set_bit(), bp_unpack_value(), cgraph_node::callees, cgraph_node::clone, cgraph_clone_info::combined_args_to_skip, count, cgraph_node::indirect_calls, input_edge_opt_summary(), map, ipa_replace_map::new_tree, cgraph_edge::next_callee, ipa_replace_map::old_tree, ipa_replace_map::parm_num, ipa_replace_map::ref_p, ipa_replace_map::replace_p, streamer_read_bitpack(), streamer_read_uhwi(), cgraph_clone_info::tree_map, and vec_safe_push().
Referenced by input_cgraph_opt_section().
|
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.
References symtab_node_base::address_taken, symtab_node_base::alias, symtab_node_base::analyzed, symtab_node_base::aux, bp_unpack_value(), cgraph_local_info::can_change_signature, cgraph_node::clone_of, symtab_node_base::decl, symtab_node_base::definition, symtab_node_base::externally_visible, symtab_node_base::force_output, symtab_node_base::forced_by_abi, symtab_node_base::in_other_partition, cgraph_local_info::local, cgraph_node::local, cgraph_node::lowered, symtab_node_base::lto_file_data, LTO_symtab_analyzed_node, cgraph_node::only_called_at_exit, cgraph_node::only_called_at_startup, cgraph_local_info::redefined_extern_inline, cgraph_node::symbol, cgraph_node::thunk, cgraph_thunk_info::thunk_p, cgraph_node::tm_clone, symtab_node_base::unique_name, symtab_node_base::used_from_other_partition, cgraph_local_info::versionable, and symtab_node_base::weakref.
Referenced by input_node().
|
static |
Input profile_info from IB.
References bp_unpack_value(), gcov_bucket_type::cum_value, gcov_ctr_summary::histogram, memset(), gcov_bucket_type::min_value, gcov_bucket_type::num_counters, lto_file_decl_data::profile_info, gcov_ctr_summary::runs, set_hot_bb_threshold(), streamer_read_bitpack(), streamer_read_gcov_count(), streamer_read_uhwi(), gcov_ctr_summary::sum_all, and gcov_ctr_summary::sum_max.
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(), ipa_record_reference(), ipa_ref::lto_stmt_uid, ipa_ref::speculative, streamer_read_bitpack(), and streamer_read_hwi().
Referenced by input_refs().
|
static |
Input ipa_refs.
References count, input_ref(), 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_base::aux, fatal_error(), lto_file_decl_data::file_name, get_working_sets(), input_cgraph_1(), input_cgraph_opt_summary(), input_profile_summary(), input_refs(), len, lto_create_simple_input_block(), lto_destroy_simple_input_block(), symtab_node_base::lto_file_data, lto_get_file_decl_data(), LTO_section_refs, LTO_section_symtab_nodes, lto_symtab_encoder_new(), merge_profile_summaries(), cgraph_node::symbol, and lto_file_decl_data::symtab_node_encoder.
|
staticread |
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_base::decl, get_alias_symbol(), order, order_base, streamer_read_bitpack(), streamer_read_hwi(), streamer_read_uhwi(), varpool_node::symbol, symtab_order, symtab_register_node(), and varpool_create_empty_node().
Referenced by input_cgraph_1().
|
static |
Output the cgraph EDGE to OB using ENCODER.
References bitpack_create(), bp_pack_value(), bp_pack_var_len_unsigned(), cgraph_edge::call_stmt, cgraph_edge::call_stmt_cannot_inline_p, cgraph_edge::callee, cgraph_edge::caller, cgraph_edge::can_throw_external, CIF_N_REASONS, cgraph_indirect_call_info::common_target_id, cgraph_indirect_call_info::common_target_probability, cgraph_edge::count, symtab_node_base::decl, cgraph_indirect_call_info::ecf_flags, cgraph_edge::frequency, gimple_has_body_p(), gimple_uid(), cgraph_edge::indirect_info, cgraph_edge::indirect_inlining_edge, cgraph_edge::indirect_unknown_callee, cgraph_edge::inline_failed, cgraph_edge::lto_stmt_uid, LTO_symtab_edge, lto_symtab_encoder_lookup(), LTO_symtab_indirect_edge, LTO_symtab_last_tag, lto_simple_output_block::main_stream, cgraph_edge::speculative, streamer_write_bitpack(), streamer_write_gcov_count_stream(), streamer_write_hwi_stream(), and cgraph_node::symbol.
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 bitpack_create(), bp_pack_value(), cgraph_node::clone_of, lto_simple_output_block::decl_state, lto_output_fn_decl_index(), 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::prev_sibling_clone, reachable_from_other_partition_p(), referenced_from_other_partition_p(), opt_pass::static_pass_number, streamer_write_bitpack(), streamer_write_gcov_count_stream(), streamer_write_hwi_stream(), and streamer_write_uhwi_stream().
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(), gimple_uid(), 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::stmt, streamer_write_bitpack(), and streamer_write_hwi_stream().
Referenced by output_refs().
|
static |
Output the varpool NODE to OB. If NODE is not in SET, then NODE is a boundary.
References bitpack_create(), bp_pack_value(), lto_simple_output_block::decl_state, lto_output_var_decl_index(), lto_symtab_encoder_in_partition_p(), lto_symtab_encoder_lookup(), LTO_symtab_last_tag, LTO_symtab_variable, lto_simple_output_block::main_stream, referenced_from_other_partition_p(), streamer_write_bitpack(), and streamer_write_hwi_stream().
Referenced by output_symtab().
|
static |
Return TRUE if we should encode body of NODE (if any).
References lto_symtab_encoder_encode(), and lto_symtab_encoder_d::nodes.
Referenced by add_node_to().
|
static |
Return TRUE if 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 | ||
) |
Return TRUE if we should encode body of NODE (if any).
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 | ( | ) |
Delete ENCODER and its components.
References free(), lto_symtab_encoder_d::map, lto_symtab_encoder_d::nodes, and pointer_map_destroy().
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 lto_symtab_encoder_d::map, lto_encoder_entry::node, lto_symtab_encoder_d::nodes, and pointer_map_contains().
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 lto_symtab_encoder_d::map, lto_symtab_encoder_d::nodes, pointer_map_contains(), and pointer_map_insert().
Referenced by add_node_to(), add_references(), inline_write_summary(), input_cgraph_1(), ipa_reference_write_optimization_summary(), ipa_write_node_info(), lto_set_symtab_encoder_encode_body(), lto_set_symtab_encoder_in_partition(), pure_const_write_summary(), and write_agg_replacement_chain().
bool lto_symtab_encoder_encode_body_p | ( | lto_symtab_encoder_t | encoder, |
struct cgraph_node * | node | ||
) |
Return TRUE if we should encode initializer of NODE (if any).
References lto_symtab_encoder_lookup(), and lto_symtab_encoder_d::nodes.
Referenced by lto_output(), and lto_output_node().
bool lto_symtab_encoder_encode_initializer_p | ( | lto_symtab_encoder_t | encoder, |
struct varpool_node * | node | ||
) |
Return TRUE if we should encode initializer of NODE (if any).
References lto_symtab_encoder_lookup(), and lto_symtab_encoder_d::nodes.
Referenced by compute_ltrans_boundary(), and get_symbol_initial_value().
bool lto_symtab_encoder_in_partition_p | ( | lto_symtab_encoder_t | encoder, |
symtab_node | node | ||
) |
Return TRUE if we should encode initializer of NODE (if any).
References 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(), 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 | ( | ) |
Create a new symtab encoder. if FOR_INPUT, the encoder allocate only datastructures needed to read the symtab.
References lto_symtab_encoder_d::map, lto_symtab_encoder_d::nodes, and pointer_map_create().
Referenced by compute_ltrans_boundary(), input_symtab(), and ipa_write_summaries().
|
static |
Rescale profile summaries to the same number of runs in the whole unit.
References apply_scale(), cgraph_node::callees, cgraph_node::count, cgraph_edge::count, cgraph_node::count_materialization_scale, gcov_bucket_type::cum_value, fatal_error(), lto_file_decl_data::file_name, gcov_histo_index(), gcov_ctr_summary::histogram, symtab_node_base::lto_file_data, lto_gcov_summary, memset(), gcov_bucket_type::min_value, cgraph_edge::next_callee, gcov_bucket_type::num_counters, profile_info, lto_file_decl_data::profile_info, gcov_ctr_summary::runs, sorry(), gcov_ctr_summary::sum_all, gcov_ctr_summary::sum_max, and cgraph_node::symbol.
Referenced by input_symtab().
|
static |
@verbatim Write and read the cgraph to the memory mapped representation of a
.o file.
Copyright (C) 2009-2013 Free Software Foundation, Inc. Contributed by Kenneth Zadeck zadec k@na tural brid ge.co m
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/.
Output optimization summaries stored in callgraph. At the moment it is the clone info structure.
References output_block::cgraph_node, count, create_output_block(), output_block::decl_state, destroy_output_block(), dyn_cast(), LTO_section_cgraph_opt_sum, lto_symtab_encoder_deref(), lto_symtab_encoder_size(), output_cgraph_opt_summary_p(), output_node_opt_summary(), produce_asm(), streamer_write_uhwi(), and lto_out_decl_state::symtab_node_encoder.
Referenced by output_symtab().
|
static |
True when we need optimization summary for NODE.
References cgraph_clone_info::args_to_skip, cgraph_node::clone, cgraph_node::clone_of, cgraph_clone_info::combined_args_to_skip, and cgraph_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 cgraph_clone_info::args_to_skip, bitmap_count_bits(), bitpack_create(), bp_pack_value(), cgraph_node::clone, cgraph_clone_info::combined_args_to_skip, lto_symtab_encoder_in_partition_p(), output_block::main_stream, map, ipa_replace_map::new_tree, cgraph_edge::next_callee, ipa_replace_map::old_tree, output_edge_opt_summary(), ipa_replace_map::parm_num, ipa_replace_map::ref_p, ipa_replace_map::replace_p, streamer_write_bitpack(), streamer_write_uhwi(), cgraph_clone_info::tree_map, and vec_safe_length().
Referenced by output_cgraph_opt_summary().
|
static |
Output all callees or indirect outgoing edges. EDGE must be the first such edge.
References lto_output_edge(), cgraph_edge::next_callee, and cgraph_edge::prev_callee.
Referenced by output_symtab().
|
static |
Stream out profile_summary to OB.
References bitpack_create(), bp_pack_value(), gcov_bucket_type::cum_value, get_hot_bb_threshold(), gcov_ctr_summary::histogram, lto_simple_output_block::main_stream, gcov_bucket_type::min_value, gcov_bucket_type::num_counters, profile_info, gcov_ctr_summary::runs, streamer_write_bitpack(), streamer_write_gcov_count_stream(), streamer_write_uhwi_stream(), gcov_ctr_summary::sum_all, and gcov_ctr_summary::sum_max.
Referenced by output_symtab().
|
static |
Output the part of the cgraph in SET.
References count, ipa_ref_list_nreferences(), lsei_end_p(), lsei_next_in_partition(), lsei_node(), lsei_start_in_partition(), lto_create_simple_output_block(), lto_destroy_simple_output_block(), lto_output_ref(), LTO_section_refs, lto_symtab_encoder_lookup(), lto_simple_output_block::main_stream, 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 cgraph_node::callees, lto_simple_output_block::decl_state, cgraph_node::indirect_calls, lsei_cgraph_node(), lsei_end_p(), lsei_next_function_in_partition(), lsei_start_function_in_partition(), 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_symtab_encoder_deref(), 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 varpool().
Referenced by lto_output().
bool reachable_from_other_partition_p | ( | ) |
Return true when node is reachable from other partition.
References cgraph_edge::caller, cgraph_node::callers, symtab_node_base::definition, cgraph_node::global, symtab_node_base::in_other_partition, cgraph_global_info::inlined_to, lto_symtab_encoder_in_partition_p(), cgraph_edge::next_caller, and cgraph_node::symbol.
Referenced by lto_output_node().
bool reachable_from_this_partition_p | ( | ) |
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().
bool referenced_from_other_partition_p | ( | ) |
Return if LIST contain references from other partitions.
References lto_symtab_encoder_in_partition_p(), and ipa_ref::referring.
Referenced by lto_output_node(), and lto_output_varpool_node().
bool referenced_from_this_partition_p | ( | struct ipa_ref_list * | list, |
lto_symtab_encoder_t | encoder | ||
) |
Return if LIST contain references from other partitions.
References lto_symtab_encoder_in_partition_p(), and ipa_ref::referring.
Referenced by ipa_reference_write_optimization_summary(), and write_node_summary_p().
|
static |
Referenced by merge_profile_summaries().
|
static |
All node orders are ofsetted by ORDER_BASE.
Referenced by input_cgraph_1(), input_node(), input_varpool_node(), and lto_input_toplevel_asms().