GCC Middle and Back End API Reference
|
Go to the source code of this file.
Data Structures | |
class | lto_location_cache |
struct | lto_location_cache::cached_location |
class | lto_input_block |
struct | lto_section |
struct | lto_simple_header |
struct | lto_simple_header_with_strings |
struct | lto_function_header |
struct | lto_decl_header |
struct | lto_stats_d |
struct | lto_encoder_entry |
struct | lto_symtab_encoder_d |
struct | lto_symtab_encoder_iterator |
struct | lto_tree_ref_encoder |
struct | lto_in_decl_state |
struct | decl_state_hasher |
struct | lto_out_decl_state |
struct | res_pair |
struct | lto_file_decl_data |
struct | lto_char_ptr_base |
struct | lto_output_stream |
struct | lto_simple_output_block |
struct | string_slot |
struct | string_slot_hasher |
struct | output_block |
class | data_in |
struct | dref_entry |
Macros | |
#define | LTO_major_version GCC_major_version |
#define | LTO_minor_version 0 |
#define | LCC_NOT_FOUND (-1) |
Typedefs | |
typedef unsigned char | lto_decl_flags_t |
typedef enum ld_plugin_symbol_resolution | ld_plugin_symbol_resolution_t |
typedef const char * | lto_get_section_data_f(struct lto_file_decl_data *, enum lto_section_type, const char *, int, size_t *) |
typedef void | lto_free_section_data_f(struct lto_file_decl_data *, enum lto_section_type, const char *, const char *, size_t) |
typedef struct lto_symtab_encoder_d * | lto_symtab_encoder_t |
typedef struct lto_in_decl_state * | lto_in_decl_state_ptr |
typedef struct lto_out_decl_state * | lto_out_decl_state_ptr |
typedef struct lto_file_decl_data * | lto_file_decl_data_ptr |
Variables | |
bool | lto_stream_offload_p |
bool | asm_nodes_output |
struct lto_stats_d | lto_stats |
const char * | lto_section_name [] |
vec< lto_out_decl_state_ptr > | lto_function_decl_states |
vec< dref_entry > | dref_queue |
FILE * | streamer_dump_file |
#define LCC_NOT_FOUND (-1) |
Value used to represent failure of lto_symtab_encoder_lookup.
Referenced by input_cgraph_1(), input_node(), input_varpool_node(), lto_output_edge(), lto_output_node(), lto_output_ref(), lto_output_varpool_node(), lto_symtab_encoder_deref(), lto_symtab_encoder_encode_initializer_p(), lto_symtab_encoder_in_partition_p(), lto_symtab_encoder_lookup(), and omp_lto_output_declare_variant_alt().
#define LTO_major_version GCC_major_version |
Data structures and declarations used for reading and writing GIMPLE to a file stream. Copyright (C) 2009-2024 Free Software Foundation, Inc. Contributed by Doug Kwan <dougkwan@google.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/>.
The encoding for a function consists of the following sections: 1) The header. 2) FIELD_DECLS. 3) FUNCTION_DECLS. 4) global VAR_DECLS. 5) type_decls 6) types. 7) Names for the labels that have names 8) The SSA names. 9) The control flow graph. 10-11)Gimple for local decls. 12) Gimple for the function. 13) Strings. 1) THE HEADER. 2-6) THE GLOBAL DECLS AND TYPES. The global decls and types are encoded in the same way. For each entry, there is word with the offset within the section to the entry. 7) THE LABEL NAMES. Since most labels do not have names, this section my be of zero length. It consists of an array of string table references, one per label. In the lto code, the labels are given either positive or negative indexes. the positive ones have names and the negative ones do not. The positive index can be used to find the name in this array. 9) THE CFG. 10) Index into the local decls. Since local decls can have local decls inside them, they must be read in randomly in order to properly restore them. 11-12) GIMPLE FOR THE LOCAL DECLS AND THE FUNCTION BODY. The gimple consists of a set of records. THE FUNCTION At the top level of (8) is the function. It consists of five pieces: LTO_function - The tag. eh tree - This is all of the exception handling regions put out in a post order traversial of the tree. Siblings are output as lists terminated by a 0. The set of fields matches the fields defined in except.cc. last_basic_block - in uleb128 form. basic blocks - This is the set of basic blocks. zero - The termination of the basic blocks. BASIC BLOCKS There are two forms of basic blocks depending on if they are empty or not. The basic block consists of: LTO_bb1 or LTO_bb0 - The tag. bb->index - the index in uleb128 form. #succs - The number of successors un uleb128 form. the successors - For each edge, a pair. The first of the pair is the index of the successor in uleb128 form and the second are the flags in uleb128 form. the statements - A gimple tree, as described above. These are only present for LTO_BB1. Following each statement is an optional exception handling record LTO_eh_region which contains the region number (for regions >= 0). zero - This is only present for LTO_BB1 and is used to terminate the statements and exception regions within this block. 12) STRINGS String are represented in the table as pairs, a length in ULEB128 form followed by the data for the string.
Referenced by lto_check_version(), and produce_lto_section().
#define LTO_minor_version 0 |
Referenced by lto_check_version(), and produce_lto_section().
typedef enum ld_plugin_symbol_resolution ld_plugin_symbol_resolution_t |
typedef unsigned char lto_decl_flags_t |
typedef struct lto_file_decl_data* lto_file_decl_data_ptr |
typedef void lto_free_section_data_f(struct lto_file_decl_data *, enum lto_section_type, const char *, const char *, size_t) |
Return the data found from the above call. The first three parameters are the same as above. The fourth parameter is the data itself and the fifth is the length of the data.
typedef const char * lto_get_section_data_f(struct lto_file_decl_data *, enum lto_section_type, const char *, int, size_t *) |
Return a char pointer to the start of a data stream for an lto pass or function. The first parameter is the file data that contains the information. The second parameter is the type of information to be obtained. The third parameter is the name of the function and is only used when finding a function body; otherwise it is NULL. The fourth parameter is the length of the data returned.
typedef struct lto_in_decl_state* lto_in_decl_state_ptr |
typedef struct lto_out_decl_state* lto_out_decl_state_ptr |
typedef struct lto_symtab_encoder_d* lto_symtab_encoder_t |
enum lto_compression |
enum lto_decl_stream_e_t |
enum lto_section_type |
Set of section types that are in an LTO file. This list will grow as the number of IPA passes grows since each IPA pass will need its own section type to store its summary information. When adding a new section type, you must also extend the LTO_SECTION_NAME array in lto-section-in.cc.
enum LTO_tags |
Tags representing the various IL objects written to the bytecode file (GIMPLE statements, basic blocks, EH regions, tree nodes, etc). NOTE, when adding new LTO tags, also update lto_tag_name.
Referenced by streamer_read_tree_bitfields().
void cl_optimization_stream_out | ( | struct output_block * | , |
struct bitpack_d * | , | ||
struct cl_optimization * | ) |
Referenced by streamer_write_tree_bitfields().
void cl_target_option_stream_in | ( | class data_in * | , |
struct bitpack_d * | , | ||
struct cl_target_option * | ) |
Referenced by streamer_read_tree_bitfields().
void cl_target_option_stream_out | ( | struct output_block * | , |
struct bitpack_d * | , | ||
struct cl_target_option * | ) |
In options-save.cc.
Referenced by streamer_write_tree_bitfields().
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().
|
extern |
Create the output block and return it. SECTION_TYPE is LTO_section_function_body or LTO_static_initializer.
References output_block::cfg_stream, clear_line_info(), output_block::decl_state, gcc_obstack_init, output_block::local_trees, lto_get_out_decl_state(), LTO_section_decls, LTO_section_function_body, lto_section_name, output_block::main_stream, output_block::obstack, output_block::section_type, streamer_dump_file, streamer_tree_cache_create(), output_block::string_hash_table, output_block::string_stream, and output_block::writer_cache.
Referenced by ipa_fn_summary_write(), ipa_odr_summary_write(), ipa_prop_write_jump_functions(), ipcp_write_transformation_summaries(), lto_output_toplevel_asms(), lto_write_mode_table(), output_cgraph_opt_summary(), output_constructor(), output_function(), produce_asm_for_decls(), produce_lto_section(), and ipa_icf::sem_item_optimizer::write_summary().
|
extern |
Destroy the output block OB.
References output_block::cfg_stream, free(), output_block::local_trees, LTO_section_function_body, output_block::main_stream, NULL, output_block::obstack, output_block::section_type, streamer_tree_cache_delete(), output_block::string_hash_table, output_block::string_stream, and output_block::writer_cache.
Referenced by ipa_fn_summary_write(), ipa_odr_summary_write(), ipa_prop_write_jump_functions(), ipcp_write_transformation_summaries(), lto_output_toplevel_asms(), lto_write_mode_table(), output_cgraph_opt_summary(), output_constructor(), output_function(), produce_asm_for_decls(), produce_lto_section(), and ipa_icf::sem_item_optimizer::write_summary().
|
extern |
Gate function for all LTO streaming passes.
References seen_error().
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().
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.
|
inline |
Return the node pointed to by LSI.
References dyn_cast(), lto_symtab_encoder_iterator::encoder, lto_symtab_encoder_iterator::index, and lto_symtab_encoder_d::nodes.
Referenced by compute_ltrans_boundary(), ipa_fn_summary_write(), ipa_profile_write_summary(), ipa_prop_write_jump_functions(), and pure_const_write_summary().
|
inline |
Return true if iterator LSE points to nothing.
References lto_symtab_encoder_iterator::encoder, lto_symtab_encoder_iterator::index, and lto_symtab_encoder_size().
Referenced by compute_ltrans_boundary(), ipa_fn_summary_write(), ipa_profile_write_summary(), ipa_prop_write_jump_functions(), 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(), produce_symtab(), produce_symtab_extension(), pure_const_write_summary(), and ipa_icf::sem_item_optimizer::write_summary().
|
inline |
Advance iterator LSE.
References lto_symtab_encoder_iterator::index.
Referenced by lsei_next_function_in_partition(), lsei_next_in_partition(), lsei_next_variable_in_partition(), produce_symtab(), and produce_symtab_extension().
|
inline |
Advance iterator LSE.
References lto_symtab_encoder_iterator::encoder, is_a(), lsei_end_p(), lsei_next(), lsei_node(), and lto_symtab_encoder_in_partition_p().
Referenced by compute_ltrans_boundary(), ipa_fn_summary_write(), ipa_profile_write_summary(), ipa_prop_write_jump_functions(), lsei_start_function_in_partition(), and pure_const_write_summary().
|
inline |
Advance iterator LSE.
References lto_symtab_encoder_iterator::encoder, lsei_end_p(), lsei_next(), lsei_node(), and lto_symtab_encoder_in_partition_p().
Referenced by lsei_start_in_partition(), and ipa_icf::sem_item_optimizer::write_summary().
|
inline |
Advance iterator LSE.
References lto_symtab_encoder_iterator::encoder, is_a(), lsei_end_p(), lsei_next(), lsei_node(), and lto_symtab_encoder_in_partition_p().
Referenced by compute_ltrans_boundary(), and lsei_start_variable_in_partition().
|
inline |
Return the node pointed to by LSI.
References lto_symtab_encoder_iterator::encoder, lto_symtab_encoder_iterator::index, and lto_symtab_encoder_d::nodes.
Referenced by 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(), produce_symtab(), produce_symtab_extension(), and ipa_icf::sem_item_optimizer::write_summary().
|
inline |
Return an iterator to the first node in LSI.
References lto_symtab_encoder_iterator::encoder, and lto_symtab_encoder_iterator::index.
Referenced by lsei_start_function_in_partition(), lsei_start_in_partition(), lsei_start_variable_in_partition(), produce_symtab(), and produce_symtab_extension().
|
inline |
Return an iterator to the first node in LSI.
References is_a(), lsei_end_p(), lsei_next_function_in_partition(), lsei_node(), lsei_start(), and lto_symtab_encoder_in_partition_p().
Referenced by compute_ltrans_boundary(), ipa_fn_summary_write(), ipa_profile_write_summary(), ipa_prop_write_jump_functions(), and pure_const_write_summary().
|
inline |
Return an iterator to the first node in LSI.
References lsei_end_p(), lsei_next_in_partition(), lsei_node(), lsei_start(), and lto_symtab_encoder_in_partition_p().
Referenced by ipa_icf::sem_item_optimizer::write_summary().
|
inline |
Return an iterator to the first node in LSI.
References is_a(), lsei_end_p(), lsei_next_variable_in_partition(), lsei_node(), lsei_start(), and lto_symtab_encoder_in_partition_p().
Referenced by compute_ltrans_boundary().
|
inline |
Return the node pointed to by LSI.
References dyn_cast(), lto_symtab_encoder_iterator::encoder, lto_symtab_encoder_iterator::index, and lto_symtab_encoder_d::nodes.
Referenced by compute_ltrans_boundary().
|
extern |
Routines for saving various data types to a file stream. This deals with various data types like strings, integers, enums, etc. Copyright (C) 2011-2024 Free Software Foundation, Inc. Contributed by Diego Novillo <dnovillo@google.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/>.
Adds a new block to output stream OBS.
References lto_output_stream::block_size, lto_output_stream::current_block, lto_output_stream::current_pointer, lto_output_stream::first_block, gcc_assert, lto_output_stream::left_in_block, NULL, and lto_char_ptr_base::ptr.
Referenced by streamer_write_char_stream(), streamer_write_data_stream(), streamer_write_hwi_stream(), and streamer_write_uhwi_stream().
|
extern |
In lto-section-out.cc
Begin a new output section named NAME. If COMPRESS is true, zlib compress the section.
References lang_hooks_for_lto::begin_section, compression_stream, gcc_assert, lang_hooks::lto, lto_append_data(), lto_start_compression(), NULL, and streamer_dump_file.
Referenced by copy_function_or_variable(), lto_destroy_simple_output_block(), lto_output_toplevel_asms(), lto_write_mode_table(), lto_write_options(), produce_asm(), produce_asm_for_decls(), produce_lto_section(), produce_symtab(), and produce_symtab_extension().
|
extern |
Check that the version MAJOR.MINOR is the correct version number.
References fatal_error(), input_location, LTO_major_version, and LTO_minor_version.
|
extern |
Create an empty hash table for recording declaration renamings.
References eq_name(), hash_name(), and renaming_slot_free().
|
extern |
In lto-section-in.cc
Load a section of type SECTION_TYPE from FILE_DATA, parse the header and then return an input block pointing to the section. The raw pointer to the section is returned in DATAR and LEN. These are used to free the section. Return NULL if the section is not present.
References lto_input_block::file_data, lto_input_block::len, lto_get_section_data(), lto_simple_header::main_size, and NULL.
Referenced by input_offload_tables(), input_symtab(), ipa_profile_read_summary(), ipa_reference_read_optimization_summary(), and pure_const_read_summary().
|
extern |
Create the output block and return it.
References lto_simple_output_block::decl_state, lto_get_out_decl_state(), lto_simple_output_block::main_stream, and lto_simple_output_block::section_type.
Referenced by ipa_profile_write_summary(), ipa_reference_write_optimization_summary(), output_offload_tables(), output_refs(), output_symtab(), and pure_const_write_summary().
|
extern |
Create a new data_in object for FILE_DATA. STRINGS is the string table to use with LEN strings. RESOLUTIONS is the vector of linker resolutions (NULL if not using a linker plugin).
References data_in::file_data, data_in::globals_resolution, data_in::reader_cache, streamer_tree_cache_create(), data_in::strings, and data_in::strings_len.
Referenced by inline_read_section(), input_cgraph_opt_section(), ipa_odr_read_section(), ipa_prop_read_section(), lto_input_mode_table(), lto_input_toplevel_asms(), lto_read_body_or_constructor(), read_replacements_section(), and ipa_icf::sem_item_optimizer::read_section().
|
extern |
Remove DATA_IN.
References data_in::globals_resolution, data_in::reader_cache, and streamer_tree_cache_delete().
Referenced by inline_read_section(), input_cgraph_opt_section(), ipa_odr_read_section(), ipa_prop_read_section(), lto_input_mode_table(), lto_input_toplevel_asms(), lto_read_body_or_constructor(), read_replacements_section(), and ipa_icf::sem_item_optimizer::read_section().
|
extern |
Delete STATE and its components.
References ggc_free(), i, LTO_N_DECL_STREAMS, and vec_free().
|
extern |
Delete STATE and components.
References free(), i, lto_destroy_tree_ref_encoder(), and LTO_N_DECL_STREAMS.
Referenced by ipa_write_optimization_summaries(), ipa_write_summaries_1(), and produce_asm_for_decls().
|
extern |
Close the section returned from a call to LTO_CREATE_SIMPLE_INPUT_BLOCK. IB is the input block returned from that call. The FILE_DATA and SECTION_TYPE are the same as what was passed to that call and the DATA and LEN are what was returned from that call.
References lto_free_section_data(), and NULL.
Referenced by input_offload_tables(), input_symtab(), ipa_profile_read_summary(), ipa_reference_read_optimization_summary(), and pure_const_read_summary().
|
extern |
Produce a simple section for one of the ipa passes.
References free(), lto_begin_section(), lto_end_section(), lto_get_section_name(), lto_write_data(), lto_write_stream(), lto_simple_header::main_size, lto_simple_output_block::main_stream, NULL, lto_simple_output_block::section_type, and lto_output_stream::total_size.
Referenced by ipa_profile_write_summary(), ipa_reference_write_optimization_summary(), output_offload_tables(), output_refs(), output_symtab(), and pure_const_write_summary().
|
inline |
Destroy an lto_tree_ref_encoder ENCODER by freeing its contents. The memory used by ENCODER is not freed by this function.
References NULL, lto_tree_ref_encoder::tree_hash_table, and lto_tree_ref_encoder::trees.
Referenced by lto_delete_out_decl_state().
|
extern |
End the current output section.
References compression_stream, lang_hooks_for_lto::end_section, lang_hooks::lto, lto_end_compression(), and NULL.
Referenced by copy_function_or_variable(), lto_destroy_simple_output_block(), lto_output_toplevel_asms(), lto_write_mode_table(), lto_write_options(), produce_asm(), produce_asm_for_decls(), produce_lto_section(), produce_symtab(), and produce_symtab_extension().
|
extern |
Free hash table used to stream in location file names.
References file_name_hash_table, NULL, path_name_pair_hash_table, string_pair_map_allocator, and string_slot_allocator.
|
extern |
Free decl_states.
References ggc_free(), i, LTO_N_DECL_STREAMS, and vec_free().
Referenced by lto_free_function_in_decl_state_for_node().
|
extern |
Free decl_states associated with NODE. This makes it possible to furhter release trees needed by the NODE's body.
References hash_table< Descriptor, Lazy, Allocator >::clear_slot(), symtab_node::decl, hash_table< Descriptor, Lazy, Allocator >::find_slot(), lto_in_decl_state::fn_decl, lto_file_decl_data::function_decl_states, symtab_node::lto_file_data, lto_free_function_in_decl_state(), and NULL.
Referenced by varpool_node::get_constructor(), cgraph_node::get_untransformed_body(), cgraph_node::release_body(), cgraph_node::remove(), and varpool_node::remove().
|
extern |
Free data allocated by lto_get_raw_section_data.
References free_section_f, and lto_data_header::len.
Referenced by copy_function_or_variable().
|
extern |
Free the data found from the above call. The first three parameters are the same as above. DATA is the data to be freed and LEN is the length of that data.
References CONST_CAST, lto_data_header::data, free(), free_section_f, gcc_assert, and lto_data_header::len.
Referenced by varpool_node::get_constructor(), cgraph_node::get_untransformed_body(), inline_read_section(), input_cgraph_opt_section(), ipa_odr_read_section(), ipa_prop_read_section(), lto_destroy_simple_input_block(), lto_input_mode_table(), lto_input_toplevel_asms(), read_replacements_section(), and ipa_icf::sem_item_optimizer::read_section().
|
extern |
Given a string NAME, return the string that it has been mapped to by lto_record_renamed_decl. If NAME was not renamed, it is returned unchanged. DECL_DATA holds the renaming hash table to use.
References lto_renaming_slot::new_name, and lto_file_decl_data::renaming_hash_table.
Referenced by copy_function_or_variable(), varpool_node::get_constructor(), and cgraph_node::get_untransformed_body().
|
extern |
Return an array of file decl datas for all of the files passed to this compilation.
References file_decl_data, and gcc_assert.
Referenced by input_cgraph_opt_summary(), input_offload_tables(), input_symtab(), ipa_fn_summary_read(), ipa_odr_summary_read(), ipa_profile_read_summary(), ipa_prop_read_jump_functions(), ipa_reference_read_optimization_summary(), ipcp_read_transformation_summaries(), pure_const_read_summary(), and ipa_icf::sem_item_optimizer::read_summary().
|
extern |
Search the in-decl state of a function FUNC contained in the file associated with FILE_DATA. Return NULL if not found.
References hash_table< Descriptor, Lazy, Allocator >::find_slot(), lto_in_decl_state::fn_decl, lto_file_decl_data::function_decl_states, and NULL.
Referenced by copy_function_or_variable(), varpool_node::get_constructor(), cgraph_node::get_untransformed_body(), and lto_read_body_or_constructor().
|
extern |
Get the currently used lto_out_decl_state structure.
References decl_state_stack.
Referenced by copy_function_or_variable(), create_output_block(), ipa_write_optimization_summaries(), ipa_write_summaries_1(), lto_create_simple_output_block(), lto_output(), produce_asm_for_decls(), and pure_const_write_summary().
|
extern |
Get the section data without any header parsing or uncompression.
References get_section_f, and lto_data_header::len.
Referenced by copy_function_or_variable().
|
extern |
Return a char pointer to the start of a data stream for an LTO pass or function. FILE_DATA indicates where to obtain the data. SECTION_TYPE is the type of information to be obtained. NAME is the name of the function and is only used when finding a function body; otherwise it is NULL. LEN is the size of the data returned.
References lto_buffer::data, lto_data_header::data, lto_section::get_compression(), get_section_f, lto_data_header::len, lto_buffer::length, lto_append_data(), lto_end_uncompression(), lto_file_decl_data::lto_section_header, LTO_section_lto, lto_start_uncompression(), lto_stats, lto_uncompress_block(), NULL, and lto_stats_d::section_size.
Referenced by varpool_node::get_constructor(), cgraph_node::get_untransformed_body(), lto_create_simple_input_block(), and lto_get_summary_section_data().
|
extern |
Get a section name for a particular type or name. The NAME field is only used if SECTION_TYPE is LTO_section_function_body. For all others it is ignored. The callee of this function is responsible to free the returned name.
References free(), gcc_assert, get_random_seed(), HOST_WIDE_INT_PRINT_HEX_PURE, lto_file_decl_data::id, internal_error(), LTO_N_SECTION_TYPES, LTO_section_function_body, lto_section_name, LTO_section_opts, NULL, and section_name_prefix.
Referenced by copy_function_or_variable(), lto_destroy_simple_output_block(), lto_output_toplevel_asms(), lto_write_mode_table(), lto_write_options(), produce_asm(), produce_asm_for_decls(), produce_lto_section(), produce_symtab(), and produce_symtab_extension().
|
extern |
Return a char pointer to the start of a data stream for an LTO pass. FILE_DATA indicates where to obtain the data. SECTION_TYPE is the type of information to be obtained. LEN is the size of the data returned.
References lto_data_header::len, lto_get_section_data(), and NULL.
Referenced by input_cgraph_opt_summary(), ipa_fn_summary_read(), ipa_odr_summary_read(), ipa_prop_read_jump_functions(), ipcp_read_transformation_summaries(), lto_input_mode_table(), lto_input_toplevel_asms(), and ipa_icf::sem_item_optimizer::read_summary().
|
inline |
Return the LTO tag corresponding to gimple code CODE. See enum LTO_tags for details on the conversion.
References LTO_first_gimple_tag.
Referenced by output_gimple_stmt(), and output_phi().
void lto_init_eh | ( | void | ) |
Initialize EH support.
References init_eh().
|
inline |
Initialize an lto_out_decl_buffer ENCODER.
References lto_tree_ref_encoder::tree_hash_table, and lto_tree_ref_encoder::trees.
Referenced by lto_new_out_decl_state().
|
extern |
In lto-streamer-in.cc
|
extern |
|
extern |
Read LENGTH bytes from STREAM to ADDR.
References i, and streamer_read_uchar().
|
extern |
Read VAR_DECL reference to DATA from IB.
References lto_file_decl_data::current_decl_state, gcc_assert, LTO_DECL_STREAM, streamer_read_uhwi(), lto_in_decl_state::streams, and TREE_CODE.
Referenced by input_node(), and input_offload_tables().
|
extern |
Read the body of NODE using DATA. FILE_DATA holds the global decls and types.
References lto_read_body_or_constructor(), and LTO_section_function_body.
Referenced by cgraph_node::get_untransformed_body().
Read a location bitpack from input block IB and either update *LOC directly or add it to the location cache. It is neccesary to call apply_location_cache to get *LOC updated.
References lto_location_cache::input_location(), and data_in::location_cache.
Referenced by lto_streamer_hooks_init().
|
extern |
Input mode table.
References bp_unpack_enum, bp_unpack_indexed_string(), bp_unpack_poly_value(), bp_unpack_value(), fatal_error(), data_in::file_data, lto_file_decl_data::file_name, GET_CLASS_NARROWEST_MODE, GET_MODE_CLASS, GET_MODE_FBIT, GET_MODE_IBIT, GET_MODE_INNER, GET_MODE_NUNITS(), GET_MODE_PRECISION(), GET_MODE_SIZE(), GET_MODE_WIDER_MODE(), ggc_cleared_vec_alloc(), host_num_poly_int_coeffs, internal_error(), lto_data_in_create(), lto_data_in_delete(), lto_free_section_data(), lto_get_summary_section_data(), LTO_section_mode_table, lto_simple_header::main_size, MAX_MODE_CLASS, MAX_NUM_POLY_INT_COEFFS_BITS, lto_file_decl_data::mode_bits, lto_file_decl_data::mode_table, NULL, REAL_MODE_FORMAT, streamer_read_bitpack(), lto_simple_header_with_strings::string_size, table, poly_int< N, C >::to_constant(), UNKNOWN_LOCATION, and vNULL.
hashval_t lto_input_scc | ( | class lto_input_block * | ib, |
class data_in * | data_in, | ||
unsigned * | len, | ||
unsigned * | entry_len, | ||
bool | shared_scc ) |
Populate the reader cache with trees materialized from the SCC following in the IB, DATA_IN stream. If SHARED_SCC is true we input LTO_tree_scc.
References gcc_unreachable, i, LTO_global_stream_ref, lto_input_tree_1(), LTO_integer_cst, LTO_null, lto_read_tree_1(), LTO_tree_pickle_reference, LTO_tree_scc, LTO_trees, streamer_tree_cache_d::nodes, data_in::reader_cache, streamer_alloc_tree(), streamer_read_record_start(), streamer_read_uhwi(), streamer_tree_cache_append(), and streamer_tree_cache_get_tree().
Referenced by lto_input_tree().
|
extern |
Input toplevel asms.
References data_in::file_data, symbol_table::finalize_toplevel_asm(), lto_data_in_create(), lto_data_in_delete(), lto_free_section_data(), lto_get_summary_section_data(), LTO_section_asm, lto_simple_header::main_size, NULL, asm_node::order, symbol_table::order, streamer_read_hwi(), streamer_read_string_cst(), lto_simple_header_with_strings::string_size, symtab, and vNULL.
Referenced by input_cgraph_1().
tree lto_input_tree | ( | class lto_input_block * | ib, |
class data_in * | data_in ) |
tree lto_input_tree_1 | ( | class lto_input_block * | ib, |
class data_in * | data_in, | ||
enum LTO_tags | tag, | ||
hashval_t | hash ) |
Read a tree from input block IB using the per-file context in DATA_IN. This context is used, for example, to resolve references to previously read nodes.
References a, cfun, wide_int_storage::from_array(), gcc_assert, gcc_unreachable, i, LTO_global_stream_ref, lto_input_tree_ref(), LTO_integer_cst, LTO_null, LTO_NUM_TAGS, lto_read_tree(), LTO_ssa_name_ref, LTO_tree_pickle_reference, LTO_tree_scc, LTO_trees, NULL_TREE, data_in::reader_cache, stream_read_tree_ref(), streamer_get_pickled_tree(), streamer_read_hwi(), streamer_read_uhwi(), streamer_tree_cache_append(), TYPE_PRECISION, UNLIKELY, WIDE_INT_MAX_INL_ELTS, WIDE_INT_MAX_PRECISION, and wide_int_to_tree().
Referenced by lto_input_scc(), lto_input_tree(), and lto_read_tree_1().
tree lto_input_tree_ref | ( | class lto_input_block * | ib, |
class data_in * | data_in, | ||
struct function * | fn, | ||
enum LTO_tags | tag ) |
Read a reference to a tree node from DATA_IN using input block IB. TAG is the expected node that should be found in IB, if TAG belongs to one of the indexable trees, expect to read a reference index to be looked up in one of the symbol tables, otherwise read the pysical representation of the tree using stream_read_tree. FN is the function scope for the read tree.
References lto_file_decl_data::current_decl_state, data_in::file_data, gcc_assert, gcc_checking_assert, LTO_DECL_STREAM, LTO_global_stream_ref, LTO_ssa_name_ref, NULL_TREE, SSANAMES, streamer_read_uhwi(), and lto_in_decl_state::streams.
Referenced by lto_input_tree_1().
|
extern |
Read VAR_DECL reference to DATA from IB.
References lto_file_decl_data::current_decl_state, gcc_assert, LTO_DECL_STREAM, streamer_read_uhwi(), lto_in_decl_state::streams, and VAR_P.
Referenced by input_offload_tables(), input_varpool_node(), and ipa_reference_read_optimization_summary().
|
extern |
Read the body of NODE using DATA. FILE_DATA holds the global decls and types.
References lto_read_body_or_constructor(), and LTO_section_function_body.
Referenced by varpool_node::get_constructor().
|
extern |
Input decl state object.
Return a newly created in-decl state object.
References ggc_cleared_alloc().
|
extern |
Return a new lto_out_decl_state.
References i, lto_init_tree_ref_encoder(), and LTO_N_DECL_STREAMS.
Referenced by ipa_write_optimization_summaries(), ipa_write_summaries_1(), and lto_output().
|
extern |
Main entry point from the pass manager.
References symtab_node::alias, BITMAP_ALLOC, BITMAP_FREE, bitmap_obstack_initialize(), bitmap_obstack_release(), bitmap_set_bit, cmp_symbol_files(), copy_function_or_variable(), symtab_node::decl, DECL_ARGUMENTS, DECL_INITIAL, DECL_UID, cgraph_node::declare_variant_alt, dyn_cast(), error_mark_node, gcc_assert, hash_map< KeyId, Value, Traits >::get_or_insert(), get_symbol_initial_value(), gimple_has_body_p(), i, INCREMENTAL_LINK_LTO, symtab_node::lto_file_data, lto_get_out_decl_state(), lto_new_out_decl_state(), lto_pop_out_decl_state(), lto_push_out_decl_state(), lto_record_function_out_decl_state(), lto_streamer_init(), lto_symtab_encoder_deref(), lto_symtab_encoder_encode_body_p(), lto_symtab_encoder_encode_initializer_p(), lto_symtab_encoder_size(), NULL, output_constructor(), output_function(), output_offload_tables(), lto_out_decl_state::output_offload_tables_p, output_symtab(), produce_lto_section(), prune_offload_funcs(), lto_out_decl_state::symtab_node_encoder, walk_tree, and wrap_refs().
Referenced by write_lto().
void lto_output_decl_state_refs | ( | struct output_block * | , |
struct lto_output_stream * | , | ||
struct lto_out_decl_state * | ) |
void lto_output_decl_state_streams | ( | struct output_block * | ob, |
struct lto_out_decl_state * | state ) |
Write all the streams in an lto_out_decl_state STATE using output block OB and output stream OUT_STREAM.
References i, LTO_N_DECL_STREAMS, and write_global_stream().
Referenced by produce_asm_for_decls().
|
extern |
Output a static or extern var DECL to OBS.
References output_block::decl_state, gcc_checking_assert, LTO_DECL_STREAM, lto_get_index(), streamer_write_uhwi_stream(), lto_out_decl_state::streams, and TREE_CODE.
Referenced by lto_output_node(), and output_offload_tables().
void lto_output_init_mode_table | ( | void | ) |
Init the streamer_mode_table for output, where we collect info on what machine_mode values have been streamed.
References streamer_mode_table.
Referenced by ipa_write_optimization_summaries(), and ipa_write_summaries_1().
void lto_output_location | ( | struct output_block * | ob, |
struct bitpack_d * | bp, | ||
location_t | loc ) |
Output info about new location into bitpack BP. After outputting bitpack, lto_output_location_data has to be done to output actual data.
References lto_output_location_1().
Referenced by ipa_odr_summary_write(), and lto_streamer_hooks_init().
void lto_output_location_and_block | ( | struct output_block * | ob, |
struct bitpack_d * | bp, | ||
location_t | loc ) |
Output info about new location into bitpack BP. After outputting bitpack, lto_output_location_data has to be done to output actual data. Like lto_output_location, but additionally output LOCATION_BLOCK info too and write the BP bitpack.
References lto_output_location_1().
Referenced by lto_streamer_hooks_init().
|
extern |
Emit toplevel asms.
References asm_node::asm_str, create_output_block(), destroy_output_block(), symbol_table::first_asm_symbol(), free(), lto_begin_section(), lto_end_section(), lto_get_section_name(), LTO_section_asm, lto_write_data(), lto_write_stream(), lto_simple_header::main_size, output_block::main_stream, asm_node::next, NULL, NULL_TREE, asm_node::order, streamer_write_char_stream(), streamer_write_hwi(), streamer_write_string_cst(), lto_simple_header_with_strings::string_size, output_block::string_stream, symtab, and lto_output_stream::total_size.
Referenced by output_symtab().
|
extern |
Emit the physical representation of tree node EXPR to output block OB. If THIS_REF_P is true, the leaves of EXPR are emitted as references via lto_output_tree_ref. REF_P is used for streaming siblings of EXPR.
References gcc_assert, lto_indexable_tree_ref(), LTO_null, lto_output_tree_1(), lto_stats, LTO_tree_pickle_reference, output_block::main_stream, NULL_TREE, lto_stats_d::num_pickle_refs_output, print_node_brief(), streamer_dump_file, streamer_tree_cache_lookup(), streamer_write_record_start(), streamer_write_uhwi(), lto_output_stream::total_size, tree_is_indexable(), and output_block::writer_cache.
Referenced by lto_output_location_1(), and lto_streamer_hooks_init().
|
extern |
Output a static or extern var DECL to OBS.
References output_block::decl_state, gcc_checking_assert, LTO_DECL_STREAM, lto_get_index(), streamer_write_uhwi_stream(), lto_out_decl_state::streams, and VAR_P.
Referenced by lto_output_varpool_node(), output_offload_tables(), and stream_out_bitmap().
|
extern |
Pop the currently used out-decl state from top of stack.
References decl_state_stack.
Referenced by ipa_write_optimization_summaries(), ipa_write_summaries_1(), and lto_output().
void lto_prepare_function_for_streaming | ( | struct cgraph_node * | node | ) |
This performs function body modifications that are needed for streaming to work.
References AVOID_CFG_MODIFICATIONS, symtab_node::decl, DECL_STRUCT_FUNCTION, FOR_ALL_BB_FN, gimple_phi_result(), gimple_set_uid(), gsi_end_p(), gsi_next(), gsi_start_bb(), gsi_start_phis(), gsi_stmt(), inc_gimple_stmt_max_uid(), loop_optimizer_finalize(), loop_optimizer_init(), number_of_loops(), pop_cfun(), push_cfun(), set_gimple_stmt_max_uid(), and virtual_operand_p().
Referenced by ipa_write_summaries().
|
extern |
Push STATE to top of out decl stack.
References decl_state_stack.
Referenced by ipa_write_optimization_summaries(), ipa_write_summaries_1(), and lto_output().
|
extern |
Initialization for the LTO reader.
References file_name_hash_table, file_name_obstack, gcc_obstack_init, lto_streamer_init(), and string_slot_allocator.
|
extern |
Record STATE after it has been used in serializing the body of FN_DECL. STATE should no longer be used by the caller. The ownership of it is taken over from this point.
References lto_out_decl_state::fn_decl, i, lto_function_decl_states, LTO_N_DECL_STREAMS, and NULL.
Referenced by lto_output().
|
extern |
Record a declaration name mapping OLD_NAME -> NEW_NAME. DECL_DATA holds the renaming hash table to use.
References gcc_unreachable, lto_renaming_slot::new_name, NULL, lto_renaming_slot::old_name, and lto_file_decl_data::renaming_hash_table.
|
extern |
In lto-streamer-out.cc
|
extern |
Report read pass end of the section.
References fatal_error(), input_location, lto_input_block::len, and lto_input_block::p.
Referenced by read_identifier(), read_string(), streamer_read_uchar(), and streamer_read_uhwi().
|
extern |
This is called from the lto front end to set up the hooks that are used by the ipa passes to get the data that they will deserialize.
References file_decl_data, free_section_f, and get_section_f.
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().
|
extern |
Initialize all the streamer hooks used for streaming GIMPLE.
References streamer_hooks::input_location, lto_input_location(), lto_input_tree(), lto_output_location(), lto_output_location_and_block(), lto_output_tree(), streamer_hooks::output_location, streamer_hooks::output_location_and_block, streamer_hooks::read_tree, streamer_hooks_init(), and streamer_hooks::write_tree.
Referenced by symbol_table::compile().
|
extern |
Initialization common to the LTO reader and writer.
References streamer_check_handled_ts_structures().
Referenced by lto_output(), and lto_reader_init().
void lto_symtab_encoder_delete | ( | lto_symtab_encoder_t | encoder | ) |
Delete ENCODER and its components.
References free(), lto_symtab_encoder_d::map, and lto_symtab_encoder_d::nodes.
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().
|
inline |
Return the cgraph node corresponding to REF using ENCODER.
References LCC_NOT_FOUND, lto_symtab_encoder_d::nodes, and NULL.
Referenced by compute_ltrans_boundary(), inline_read_section(), ipa_profile_read_summary_section(), ipa_prop_read_section(), ipa_reference_read_optimization_summary(), ipa_reference_write_optimization_summary(), ipcp_write_transformation_summaries(), lto_output(), output_cgraph_opt_summary(), output_refs(), output_symtab(), pure_const_read_summary(), read_replacements_section(), and ipa_icf::sem_item_optimizer::read_section().
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_encode_body(), 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().
|
inline |
Look up NODE in encoder. Return NODE's reference if it has been encoded or LCC_NOT_FOUND if it is not there.
References hash_map< KeyId, Value, Traits >::get(), LCC_NOT_FOUND, and lto_symtab_encoder_d::map.
Referenced by lto_output_edge(), lto_output_node(), lto_output_ref(), lto_output_varpool_node(), lto_set_symtab_encoder_encode_initializer(), lto_symtab_encoder_encode_body_p(), lto_symtab_encoder_encode_initializer_p(), lto_symtab_encoder_in_partition_p(), omp_lto_output_declare_variant_alt(), and output_refs().
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().
|
inline |
Return number of encoded nodes in ENCODER.
References lto_symtab_encoder_d::nodes.
Referenced by compute_ltrans_boundary(), ipa_reference_write_optimization_summary(), ipcp_write_transformation_summaries(), lsei_end_p(), lto_output(), output_cgraph_opt_summary(), output_refs(), and output_symtab().
Check that tag ACTUAL == EXPECTED.
References internal_error(), and lto_tag_name().
Referenced by input_function().
Check that tag ACTUAL is in the range [TAG1, TAG2].
References internal_error(), and lto_tag_name().
Referenced by input_eh_lp(), input_eh_regions(), and lto_input_eh_catch_list().
void lto_tag_check_set | ( | enum LTO_tags | actual, |
int | ntags, | ||
... ) |
Check that tag ACTUAL has one of the given values. NUM_TAGS is the number of valid tag values to check.
References ap, i, internal_error(), and lto_tag_name().
Referenced by input_bb().
Return true if LTO tag TAG corresponds to a gimple code.
References LTO_first_gimple_tag.
Referenced by lto_tag_name(), and lto_tag_to_gimple_code().
Return true if LTO tag TAG corresponds to a tree code.
References LTO_first_tree_tag, and MAX_TREE_CODES.
Referenced by lto_tag_name(), and lto_tag_to_tree_code().
|
extern |
Return a string representing LTO tag TAG.
References get_tree_code_name(), gimple_code_name, LTO_bb0, LTO_bb1, LTO_eh_region, LTO_eh_table, LTO_ert_allowed_exceptions, LTO_ert_cleanup, LTO_ert_must_not_throw, LTO_ert_try, LTO_function, LTO_global_stream_ref, LTO_null, LTO_ssa_name_ref, lto_tag_is_gimple_code_p(), lto_tag_is_tree_code_p(), lto_tag_to_gimple_code(), lto_tag_to_tree_code(), and LTO_tree_pickle_reference.
Referenced by input_gimple_stmt(), lto_tag_check(), lto_tag_check_range(), and lto_tag_check_set().
|
inline |
Return the GIMPLE code corresponding to TAG. See enum LTO_tags for details on the conversion.
References gcc_assert, LTO_first_gimple_tag, and lto_tag_is_gimple_code_p().
Referenced by input_gimple_stmt(), and lto_tag_name().
Return the tree code corresponding to TAG. See enum LTO_tags for details on the conversion.
References gcc_assert, LTO_first_tree_tag, and lto_tag_is_tree_code_p().
Referenced by lto_tag_name(), and streamer_alloc_tree().
Return the LTO tag corresponding to tree code CODE. See enum LTO_tags for details on the conversion.
References LTO_first_tree_tag.
Referenced by streamer_write_tree_header().
|
inline |
Return the IDX-th tree in ENCODER.
References lto_tree_ref_encoder::trees.
Referenced by write_global_references(), and write_global_stream().
|
inline |
Return the number of trees encoded in ENCODER.
References lto_tree_ref_encoder::trees.
Referenced by copy_function_or_variable(), lto_out_decl_state_written_size(), write_global_references(), and write_global_stream().
|
extern |
Report out of range value.
References fatal_error(), and input_location.
Referenced by bp_unpack_int_in_range(), and streamer_read_hwi_in_range().
|
extern |
Write SIZE bytes starting at DATA to the assembler.
References lang_hooks_for_lto::append_data, compression_stream, lang_hooks::lto, lto_compress_block(), and NULL.
Referenced by lto_destroy_simple_output_block(), lto_output_decl_state_refs(), lto_output_toplevel_asms(), lto_write_mode_table(), lto_write_options(), produce_asm(), produce_asm_for_decls(), produce_lto_section(), produce_symtab_extension(), write_global_references(), write_symbol(), and write_symbol_extension_info().
|
extern |
In lto-opts.cc.
Write currently held options to an LTO IL section.
References append_to_collect_gcc_options(), CF_BRANCH, CF_FULL, CF_NONE, CF_RETURN, CL_COMMON, CL_DRIVER, cl_options, cl_option::cl_reject_driver, CL_TARGET, CL_WARNING, DINFO_LEVEL_NONE, cl_option::flags, free(), global_options, i, lto_begin_section(), lto_end_section(), lto_get_section_name(), LTO_section_opts, lto_stream_offload_p, lto_write_data(), NULL, obstack, option(), OPTION_SET_P, prepend_xassembler_to_collect_as_options(), save_decoded_options, save_decoded_options_count, targetm, and temporary_obstack.
Referenced by produce_asm_for_decls().
|
extern |
Write SIZE bytes starting at DATA to the assembler.
References lang_hooks_for_lto::append_data, lang_hooks::lto, and NULL.
Referenced by copy_function_or_variable().
|
extern |
Write all of the chars in OBS to the assembler. Recycle the blocks in obs as this is being done.
References lang_hooks_for_lto::append_data, compression_stream, lto_output_stream::first_block, free(), if(), lto_output_stream::left_in_block, lang_hooks::lto, lto_compress_block(), and lto_char_ptr_base::ptr.
Referenced by lto_destroy_simple_output_block(), lto_output_toplevel_asms(), lto_write_mode_table(), produce_asm(), and produce_asm_for_decls().
void omp_lto_input_declare_variant_alt | ( | lto_input_block * | ib, |
cgraph_node * | node, | ||
vec< symtab_node * > | nodes ) |
References omp_declare_variant_base_entry::base, hash_table< Descriptor, Lazy, Allocator >::create_ggc(), omp_declare_variant_entry::ctx, symtab_node::decl, DECL_ATTRIBUTES, DECL_UID, cgraph_node::declare_variant_alt, dyn_cast(), gcc_assert, ggc_cleared_alloc(), i, lookup_attribute(), omp_declare_variant_entry::matches, omp_declare_variant_base_entry::node, NULL, NULL_TREE, omp_declare_variant_alt, omp_declare_variant_entry::score, omp_declare_variant_entry::score_in_declare_simd_clone, streamer_read_hwi(), TREE_CHAIN, TREE_VALUE, omp_declare_variant_entry::variant, omp_declare_variant_base_entry::variants, vec_alloc(), and WIDE_INT_MAX_HWIS.
Referenced by input_refs().
void omp_lto_output_declare_variant_alt | ( | lto_simple_output_block * | ob, |
cgraph_node * | node, | ||
lto_symtab_encoder_t | encoder ) |
In omp-general.cc.
References omp_declare_variant_base_entry::base, omp_declare_variant_entry::ctx, symtab_node::decl, DECL_ATTRIBUTES, DECL_UID, cgraph_node::declare_variant_alt, FOR_EACH_VEC_SAFE_ELT, gcc_assert, i, LCC_NOT_FOUND, lookup_attribute(), lto_symtab_encoder_lookup(), lto_simple_output_block::main_stream, omp_declare_variant_entry::matches, omp_declare_variant_base_entry::node, NULL, NULL_TREE, omp_declare_variant_alt, omp_declare_variant_entry::score, omp_declare_variant_entry::score_in_declare_simd_clone, streamer_write_hwi_stream(), TREE_CHAIN, TREE_VALUE, omp_declare_variant_entry::variant, and omp_declare_variant_base_entry::variants.
Referenced by output_refs().
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_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().
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().
|
extern |
Show various memory usage statistics related to LTO.
References get_tree_code_name(), HOST_WIDE_INT_PRINT_UNSIGNED, i, LTO_N_SECTION_TYPES, lto_section_name, lto_stats, lto_stats_d::num_cgraph_partitions, lto_stats_d::num_compressed_il_bytes, lto_stats_d::num_function_bodies, lto_stats_d::num_input_cgraph_nodes, lto_stats_d::num_input_files, lto_stats_d::num_input_il_bytes, lto_stats_d::num_output_files, lto_stats_d::num_output_il_bytes, lto_stats_d::num_output_symtab_nodes, lto_stats_d::num_pickle_refs_output, lto_stats_d::num_tree_bodies_output, NUM_TREE_CODES, lto_stats_d::num_trees, lto_stats_d::num_uncompressed_il_bytes, and lto_stats_d::section_size.
|
extern |
Create the header in the file using OB. If the section type is for a function, set FN to the decl for that function.
References lto_function_header::cfg_size, output_block::cfg_stream, DECL_ASSEMBLER_NAME, free(), symtab_node::get(), IDENTIFIER_POINTER, lto_begin_section(), lto_end_section(), lto_get_section_name(), LTO_section_function_body, lto_write_data(), lto_write_stream(), lto_simple_header::main_size, output_block::main_stream, NULL, output_block::section_type, lto_simple_header_with_strings::string_size, output_block::string_stream, and lto_output_stream::total_size.
Referenced by ipa_fn_summary_write(), ipa_odr_summary_write(), ipa_prop_write_jump_functions(), ipcp_write_transformation_summaries(), output_cgraph_opt_summary(), output_constructor(), output_function(), and ipa_icf::sem_item_optimizer::write_summary().
|
extern |
This pass is run after all of the functions are serialized and all of the IPA passes have written their serialized forms. This pass causes the vector of all of the global decls and types used from this file to be written in to a section that can then be read in to recover these on other side.
References alias_pairs, create_output_block(), DECL_ASSEMBLER_NAME, output_block::decl_state, lto_decl_header::decl_state_size, destroy_output_block(), lto_out_decl_state::fn_decl, free(), gcc_assert, i, IDENTIFIER_POINTER, lto_begin_section(), lto_delete_out_decl_state(), lto_end_section(), lto_function_decl_states, lto_get_out_decl_state(), lto_get_section_name(), LTO_N_DECL_STREAMS, lto_out_decl_state_written_size(), lto_output_decl_state_refs(), lto_output_decl_state_streams(), LTO_section_decls, lto_stream_offload_p, lto_symtab_encoder_delete(), lto_write_data(), lto_write_mode_table(), lto_write_options(), lto_write_stream(), lto_simple_header::main_size, output_block::main_stream, NULL, lto_decl_header::num_nodes, produce_symtab(), produce_symtab_extension(), streamer_dump_file, streamer_write_char_stream(), lto_out_decl_state::streams, lto_simple_header_with_strings::string_size, output_block::string_stream, lto_out_decl_state::symtab_node_encoder, lto_output_stream::total_size, and lto_tree_ref_encoder::tree_hash_table.
Referenced by write_lto().
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().
bool referenced_from_other_partition_p | ( | struct ipa_ref_list * | , |
lto_symtab_encoder_t | ) |
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().
STATIC_ASSERT | ( | sizeof(lto_section) | = =8 | ) |
tree stream_read_tree_ref | ( | lto_input_block * | ib, |
data_in * | data_in ) |
Read reference to tree from IB and DATA_IN. This is used for streaming tree bodies where we know that the tree is already in cache or is indexable and must be matched with stream_write_tree_ref.
References cfun, lto_file_decl_data::current_decl_state, data_in::file_data, LTO_DECL_STREAM, NULL_TREE, data_in::reader_cache, SSANAMES, streamer_read_hwi(), streamer_tree_cache_get_tree(), and lto_in_decl_state::streams.
Referenced by lto_input_tree_1(), lto_input_ts_binfo_tree_pointers(), lto_input_ts_block_tree_pointers(), lto_input_ts_common_tree_pointers(), lto_input_ts_complex_tree_pointers(), lto_input_ts_constructor_tree_pointers(), lto_input_ts_decl_common_tree_pointers(), lto_input_ts_decl_minimal_tree_pointers(), lto_input_ts_decl_with_vis_tree_pointers(), lto_input_ts_exp_tree_pointers(), lto_input_ts_field_decl_tree_pointers(), lto_input_ts_function_decl_tree_pointers(), lto_input_ts_list_tree_pointers(), lto_input_ts_omp_clause_tree_pointers(), lto_input_ts_poly_tree_pointers(), lto_input_ts_type_common_tree_pointers(), lto_input_ts_type_non_common_tree_pointers(), lto_input_ts_vec_tree_pointers(), lto_input_ts_vector_tree_pointers(), and streamer_read_chain().
|
extern |
Output reference to tree T to the stream. Assume that T is already in encoder cache. This is used to stream tree bodies where we know the DFS walk arranged everything to cache. Must be matched with stream_read_tree_ref.
References gcc_checking_assert, LTO_global_stream_ref, lto_indexable_tree_ref(), LTO_ssa_name_ref, streamer_tree_cache_lookup(), streamer_write_hwi(), streamer_write_zero(), and output_block::writer_cache.
Referenced by streamer_write_chain(), streamer_write_integer_cst(), write_ts_binfo_tree_pointers(), write_ts_block_tree_pointers(), write_ts_common_tree_pointers(), write_ts_complex_tree_pointers(), write_ts_constructor_tree_pointers(), write_ts_decl_common_tree_pointers(), write_ts_decl_minimal_tree_pointers(), write_ts_decl_with_vis_tree_pointers(), write_ts_exp_tree_pointers(), write_ts_field_decl_tree_pointers(), write_ts_function_decl_tree_pointers(), write_ts_list_tree_pointers(), write_ts_omp_clause_tree_pointers(), write_ts_poly_tree_pointers(), write_ts_type_common_tree_pointers(), write_ts_type_non_common_tree_pointers(), write_ts_vec_tree_pointers(), and write_ts_vector_tree_pointers().
|
extern |
In lto-cgraph.cc
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 output_symtab().
|
extern |
Queue of acummulated decl -> DIE mappings. Similar to locations those are only applied to prevailing tree nodes during tree merging.
Referenced by lto_input_tree(), and lto_read_tree_1().
|
extern |
Holds all the out decl states of functions output so far in the current output file.
List of out decl states used by functions. We use this to generate the decl directory later.
Referenced by lto_record_function_out_decl_state(), and produce_asm_for_decls().
|
extern |
Section names corresponding to the values of enum lto_section_type.
Input functions for reading LTO sections. 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/>.
Section names. These must correspond to the values of enum lto_section_type.
Referenced by create_output_block(), lto_get_section_name(), lto_write_tree_1(), print_lto_report(), and streamer_write_tree_header().
|
extern |
Statistics gathered during LTO, WPA and LTRANS.
Miscellaneous utilities for GIMPLE streaming. Things that are used in both input and output are here. Copyright (C) 2009-2024 Free Software Foundation, Inc. Contributed by Doug Kwan <dougkwan@google.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/>.
Statistics gathered during LTO, WPA and LTRANS.
Referenced by varpool_node::get_constructor(), cgraph_node::get_untransformed_body(), lto_compress_block(), lto_compression_zlib(), lto_get_section_data(), lto_output_tree(), lto_uncompress_block(), lto_uncompression_zlib(), print_lto_report(), and streamer_write_tree_body().
|
extern |
In lto-streamer.cc.
Set when streaming LTO for offloading compiler.
Set when streaming LTO for offloading compiler.
Referenced by hash_tree(), inline_read_section(), ipa_fn_summary_write(), ipa_passes(), lto_output_node(), lto_write_mode_table(), lto_write_options(), output_symtab(), pack_ts_base_value_fields(), pack_ts_decl_common_value_fields(), pack_ts_type_common_value_fields(), preload_common_nodes(), produce_asm_for_decls(), select_what_to_stream(), streamer_write_tree_bitfields(), and write_ts_function_decl_tree_pointers().
|
extern |
Referenced by copy_function_or_variable(), create_output_block(), DFS::DFS(), ipa_write_summaries(), lto_begin_section(), lto_get_index(), lto_output_tree(), lto_write_tree_1(), output_bb(), output_constructor(), output_function(), produce_asm_for_decls(), streamer_write_integer_cst(), streamer_write_tree_header(), and write_global_stream().