GCC Middle and Back End API Reference
|
#include "config.h"
#include "system.h"
#include "coretypes.h"
#include "backend.h"
#include "target.h"
#include "rtl.h"
#include "tree.h"
#include "gimple.h"
#include "tree-pass.h"
#include "ssa.h"
#include "gimple-streamer.h"
#include "alias.h"
#include "stor-layout.h"
#include "gimple-iterator.h"
#include "except.h"
#include "lto-symtab.h"
#include "cgraph.h"
#include "cfgloop.h"
#include "builtins.h"
#include "gomp-constants.h"
#include "debug.h"
#include "omp-offload.h"
#include "print-tree.h"
#include "tree-dfa.h"
#include "file-prefix-map.h"
#include "output.h"
#include "ipa-utils.h"
#include "toplev.h"
Data Structures | |
class | DFS |
struct | DFS::scc_entry |
struct | DFS::sccs |
struct | DFS::worklist |
Macros | |
#define | DFS_follow_tree_edge(DEST) |
#define | visit(SIBLING) |
#define | LTO_SYMTAB_EXTENSION_VERSION 1 |
#define DFS_follow_tree_edge | ( | DEST | ) |
Referenced by DFS::DFS_write_tree_body().
#define LTO_SYMTAB_EXTENSION_VERSION 1 |
Symtab extension version.
Referenced by produce_symtab_extension().
#define visit | ( | SIBLING | ) |
Referenced by add_scope_conflicts_1(), add_scope_conflicts_2(), compute_live_vars_1(), evaluate_bbs(), hash_tree(), and propagate_freq().
|
static |
Clear the line info stored in DATA_IN.
References output_block::current_block, output_block::current_col, output_block::current_discr, output_block::current_file, output_block::current_line, output_block::current_sysp, output_block::emit_pwd, NULL, output_block::reset_locus, UINT_MAX, and void_node.
Referenced by create_output_block().
|
static |
Compare symbols to get them sorted by filename (to optimize streaming)
References hash_map< KeyId, Value, Traits >::get(), lto_file_decl_data::id, symtab_node::lto_file_data, lto_file_decl_data::order, and symtab_node::order.
Referenced by lto_output().
Collect all leaf BLOCKs beyond ROOT into LEAFS.
References BLOCK_CHAIN, BLOCK_SUBBLOCKS, and collect_block_tree_leafs().
Referenced by collect_block_tree_leafs(), and output_function().
|
static |
Copy the function body or variable constructor of NODE without deserializing.
References lto_in_decl_state::compressed, lto_out_decl_state::compressed, symtab_node::decl, DECL_ASSEMBLER_NAME, free(), gcc_assert, i, IDENTIFIER_POINTER, lto_begin_section(), lto_end_section(), symtab_node::lto_file_data, lto_free_raw_section_data(), lto_get_decl_name_mapping(), lto_get_function_in_decl_state(), lto_get_out_decl_state(), lto_get_raw_section_data(), lto_get_section_name(), LTO_N_DECL_STREAMS, LTO_section_function_body, lto_tree_ref_encoder_size(), lto_write_raw_data(), NULL, symtab_node::order, lto_file_decl_data::order_base, streamer_dump_file, lto_in_decl_state::streams, lto_out_decl_state::streams, lto_tree_ref_encoder::trees, and vec_safe_length().
Referenced by lto_output().
struct output_block * create_output_block | ( | enum lto_section_type | section_type | ) |
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().
void destroy_output_block | ( | struct output_block * | ob | ) |
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().
|
static |
For EXPR lookup and return what we want to stream to OB as DECL_INITIAL.
References DECL_EXTERNAL, DECL_IN_CONSTANT_POOL, DECL_INITIAL, DECL_P, error_mark_node, gcc_checking_assert, varpool_node::get(), lto_symtab_encoder_encode_initializer_p(), NULL, subtract_estimated_size(), TREE_CODE, TREE_STATIC, VAR_P, and walk_tree.
Referenced by DFS::DFS(), lto_output(), and lto_write_tree_1().
|
static |
Return a hash value for the tree T. CACHE holds hash values of trees outside current SCC. MAP, if non-NULL, may hold hash values if trees inside current SCC.
References inchash::hash::add(), inchash::hash::add_flag(), inchash::hash::add_hwi(), inchash::hash::add_int(), inchash::hash::add_wide_int(), AGGREGATE_TYPE_P, b, BINFO_BASE_BINFOS, BINFO_OFFSET, BINFO_VTABLE, CODE_CONTAINS_STRUCT, inchash::hash::commit_flag(), CONSTRUCTOR_ELTS, CONSTRUCTOR_NELTS, count, DECL_ABSTRACT_P, DECL_ALIGN, DECL_ARTIFICIAL, DECL_ASSEMBLER_NAME, DECL_ASSEMBLER_NAME_SET_P, DECL_ATTRIBUTES, DECL_BIT_FIELD, DECL_BIT_FIELD_REPRESENTATIVE, DECL_BIT_FIELD_TYPE, DECL_BUILT_IN_CLASS, DECL_BY_REFERENCE, DECL_COMDAT, DECL_COMMON, DECL_CONTEXT, DECL_CXX_CONSTRUCTOR_P, DECL_CXX_DESTRUCTOR_P, DECL_DEBUG_EXPR, DECL_DECLARED_INLINE_P, DECL_DISREGARD_INLINE_LIMITS, DECL_DLLIMPORT_P, DECL_EXTERNAL, DECL_FIELD_ABI_IGNORED, DECL_FIELD_BIT_OFFSET, DECL_FIELD_CXX_ZERO_WIDTH_BIT_FIELD, DECL_FIELD_OFFSET, DECL_FILE_SCOPE_P, DECL_FINAL_P, DECL_FUNCTION_PERSONALITY, DECL_FUNCTION_SPECIFIC_OPTIMIZATION, DECL_FUNCTION_SPECIFIC_TARGET, DECL_HARD_REGISTER, DECL_HAS_DEBUG_EXPR_P, DECL_HAS_VALUE_EXPR_P, DECL_IGNORED_P, DECL_IN_CONSTANT_POOL, DECL_IS_MALLOC, DECL_IS_NOVOPS, DECL_IS_RETURNS_TWICE, DECL_LOOPING_CONST_OR_PURE_P, DECL_MODE, DECL_NAME, DECL_NO_INLINE_WARNING_P, DECL_NO_INSTRUMENT_FUNCTION_ENTRY_EXIT, DECL_NO_LIMIT_STACK, DECL_NONADDRESSABLE_P, DECL_NONLOCAL, DECL_NONLOCAL_FRAME, DECL_NOT_GIMPLE_REG_P, DECL_OFFSET_ALIGN, DECL_P, DECL_PACKED, DECL_PADDING_P, DECL_POSSIBLY_INLINED, DECL_PRESERVE_P, DECL_PURE_P, DECL_REGISTER, DECL_SEEN_IN_BIND_EXPR_P, DECL_SIZE, DECL_SIZE_UNIT, DECL_STATIC_CHAIN, DECL_STATIC_CONSTRUCTOR, DECL_STATIC_DESTRUCTOR, DECL_UNCHECKED_FUNCTION_CODE, DECL_UNINLINABLE, DECL_UNSIGNED, DECL_USER_ALIGN, DECL_VALUE_EXPR, DECL_VIRTUAL_P, DECL_VISIBILITY, DECL_VISIBILITY_SPECIFIED, DECL_WEAK, EH_LANDING_PAD_NR, inchash::hash::end(), FIXED_VALUE_TYPE, FOR_EACH_CONSTRUCTOR_ELT, FOR_EACH_VEC_ELT, FUNCTION_DECL_DECL_TYPE, i, IDENTIFIER_ANON_P, IDENTIFIER_HASH_VALUE, LABEL_DECL_UID, lto_stream_offload_p, inchash::hash::merge_hash(), NOT_BUILT_IN, NUM_POLY_INT_COEFFS, OMP_CLAUSE_CHAIN, OMP_CLAUSE_CODE, OMP_CLAUSE_DEFAULT, OMP_CLAUSE_DEFAULT_KIND, OMP_CLAUSE_DEPEND, OMP_CLAUSE_DEPEND_KIND, OMP_CLAUSE_DOACROSS, OMP_CLAUSE_DOACROSS_KIND, OMP_CLAUSE_IN_REDUCTION, OMP_CLAUSE_MAP, OMP_CLAUSE_MAP_KIND, omp_clause_num_ops, OMP_CLAUSE_OPERAND, OMP_CLAUSE_PROC_BIND, OMP_CLAUSE_PROC_BIND_KIND, OMP_CLAUSE_REDUCTION, OMP_CLAUSE_REDUCTION_CODE, OMP_CLAUSE_SCHEDULE, OMP_CLAUSE_SCHEDULE_KIND, OMP_CLAUSE_TASK_REDUCTION, POINTER_TYPE_P, POLY_INT_CST_COEFF, r, REAL_VALUE_TYPE, RECORD_OR_UNION_TYPE_P, SSA_NAME_IS_DEFAULT_DEF, wi::to_widest(), TRANSLATION_UNIT_LANGUAGE, TREE_ADDRESSABLE, TREE_CHAIN, TREE_CODE, TREE_CONSTANT, TREE_DEPRECATED, TREE_FIXED_CST, TREE_IMAGPART, TREE_NO_WARNING, TREE_NOTHROW, TREE_OPERAND, TREE_OPERAND_LENGTH, TREE_OPTIMIZATION, TREE_PRIVATE, TREE_PROTECTED, TREE_PUBLIC, TREE_PURPOSE, TREE_READONLY, TREE_REAL_CST, TREE_REALPART, TREE_SIDE_EFFECTS, TREE_STATIC, TREE_STRING_LENGTH, TREE_STRING_POINTER, TREE_TARGET_OPTION, TREE_THIS_VOLATILE, TREE_TYPE, TREE_VALUE, TREE_VEC_ELT, TREE_VEC_LENGTH, TYPE_ADDR_SPACE, TYPE_ALIGN, TYPE_ARG_TYPES, TYPE_ARTIFICIAL, TYPE_ATTRIBUTES, TYPE_CONTEXT, TYPE_CXX_ODR_P, TYPE_DOMAIN, TYPE_EMPTY_P, TYPE_FIELDS, TYPE_FILE_SCOPE_P, TYPE_FINAL_P, TYPE_MAIN_VARIANT, TYPE_MAX_VALUE_RAW, TYPE_MIN_VALUE_RAW, TYPE_MODE, TYPE_NAME, TYPE_NONALIASED_COMPONENT, TYPE_P, TYPE_PACKED, TYPE_PRECISION_RAW, TYPE_READONLY, TYPE_RESTRICT, TYPE_REVERSE_STORAGE_ORDER, TYPE_SATURATING, TYPE_SIZE, TYPE_SIZE_UNIT, TYPE_STRING_FLAG, TYPE_TRANSPARENT_AGGR, TYPE_TYPELESS_STORAGE, TYPE_UNSIGNED, TYPE_USER_ALIGN, VECTOR_CST_ENCODED_ELT, vector_cst_encoded_nelts(), and visit.
Referenced by DFS::hash_scc().
Return true if type can not be merged with structurally same tree in other translation unit. During stream out this information is propagated to all trees referring to T and they are not streamed with additional information needed by the tree merging in lto-common.cc (in particular, scc hash codes are not streamed). TRANSLATION_UNIT_DECL is handled specially since references to it does not make other trees local as well.
References DECL_EXTERNAL, DECL_NAME, odr_type_p(), TREE_CODE, TREE_PUBLIC, type_in_anonymous_namespace_p(), TYPE_MAIN_VARIANT, and type_with_linkage_p().
Referenced by DFS::DFS().
|
static |
Lookup NAME in ENCODER. If NAME is not found, create a new entry in ENCODER for NAME with the next available index of ENCODER, then print the index to OBS. Return the index.
References hash_map< KeyId, Value, Traits >::get_or_insert(), print_node_brief(), streamer_dump_file, lto_tree_ref_encoder::tree_hash_table, and lto_tree_ref_encoder::trees.
Referenced by lto_indexable_tree_ref(), lto_output_fn_decl_ref(), and lto_output_var_decl_ref().
|
static |
If EXPR is an indexable tree node, output a reference to it to output block OB. Otherwise, output the physical representation of EXPR to OB.
References output_block::decl_state, gcc_checking_assert, LTO_DECL_STREAM, lto_get_index(), LTO_global_stream_ref, LTO_ssa_name_ref, SSA_NAME_VERSION, lto_out_decl_state::streams, TREE_CODE, and tree_is_indexable().
Referenced by lto_output_tree(), and stream_write_tree_ref().
Return true if EXPR is a tree node that can be written to disk.
References is_lang_specific(), tcc_statement, TREE_CODE, and TREE_CODE_CLASS.
Referenced by DFS::DFS(), and lto_write_tree().
|
static |
Return the written size of STATE.
References i, LTO_N_DECL_STREAMS, and lto_tree_ref_encoder_size().
Referenced by produce_asm_for_decls().
void lto_output | ( | void | ) |
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 * | ob, |
struct lto_out_decl_state * | state ) |
Write all the references in an lto_out_decl_state STATE using output block OB and output stream OUT_STREAM.
References gcc_assert, i, LTO_N_DECL_STREAMS, lto_write_data(), streamer_tree_cache_lookup(), void_type_node, write_global_references(), and output_block::writer_cache.
Referenced by produce_asm_for_decls().
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().
void lto_output_fn_decl_ref | ( | struct lto_out_decl_state * | decl_state, |
struct lto_output_stream * | obs, | ||
tree | decl ) |
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().
|
static |
Output info about new location into bitpack BP. After outputting bitpack, lto_output_location_data has to be done to output actual data.
References bp_pack_int_in_range(), bp_pack_string(), bp_pack_value(), bp_pack_var_len_unsigned(), output_block::current_block, output_block::current_col, output_block::current_discr, output_block::current_file, output_block::current_line, output_block::current_sysp, output_block::emit_pwd, expand_location(), gcc_checking_assert, get_discriminator_from_loc(), get_src_pwd(), LOCATION_BLOCK, LOCATION_LOCUS, lto_output_tree(), NULL, remap_debug_filename(), output_block::reset_locus, and streamer_write_bitpack().
Referenced by lto_output_location(), and lto_output_location_and_block().
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().
void lto_output_toplevel_asms | ( | void | ) |
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().
void lto_output_tree | ( | struct output_block * | ob, |
tree | expr, | ||
bool | ref_p, | ||
bool | this_ref_p ) |
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().
|
static |
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, gcc_checking_assert, lto_write_tree(), NULL_TREE, streamer_tree_cache_insert(), streamer_write_integer_cst(), TREE_CODE, tree_is_indexable(), TREE_OVERFLOW, and output_block::writer_cache.
Referenced by DFS::DFS(), and lto_output_tree().
void lto_output_var_decl_ref | ( | struct lto_out_decl_state * | decl_state, |
struct lto_output_stream * | obs, | ||
tree | decl ) |
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().
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().
Wrapper around variably_modified_type_p avoiding type modification during WPA streaming.
References NULL_TREE, TYPE_LANG_FLAG_0, TYPE_MAIN_VARIANT, and variably_modified_type_p().
Referenced by tree_is_indexable().
|
static |
Write the mode table.
References bitpack_create(), bp_pack_enum, bp_pack_poly_value(), bp_pack_string(), bp_pack_value(), ceil_log2(), create_output_block(), destroy_output_block(), free(), GET_MODE_CLASS, GET_MODE_FBIT, GET_MODE_IBIT, GET_MODE_INNER, GET_MODE_NAME, GET_MODE_NUNITS(), GET_MODE_PRECISION(), GET_MODE_SIZE(), i, lto_begin_section(), lto_end_section(), lto_get_section_name(), LTO_section_mode_table, lto_stream_offload_p, lto_write_data(), lto_write_stream(), lto_simple_header::main_size, output_block::main_stream, MAX_MODE_CLASS, MAX_NUM_POLY_INT_COEFFS_BITS, NULL, NUM_POLY_INT_COEFFS, REAL_MODE_FORMAT, streamer_mode_table, streamer_write_bitpack(), lto_simple_header_with_strings::string_size, output_block::string_stream, and lto_output_stream::total_size.
Referenced by produce_asm_for_decls().
|
static |
Write the GIMPLE representation to a file stream. Copyright (C) 2009-2024 Free Software Foundation, Inc. Contributed by Kenneth Zadeck <zadeck@naturalbridge.com> Re-implemented 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/>.
Write a physical representation of tree node EXPR to output block OB. If REF_P is true, the leaves of EXPR are emitted as references via lto_output_tree_ref. IX is the index into the streamer cache where EXPR is stored.
References get_tree_code_name(), internal_error(), lto_is_streamable(), lto_write_tree_1(), streamer_write_tree_header(), and TREE_CODE.
Referenced by lto_output_tree_1().
|
static |
Write a physical representation of tree node EXPR to output block OB. If REF_P is true, the leaves of EXPR are emitted as references via lto_output_tree_ref. IX is the index into the streamer cache where EXPR is stored.
References debug_hooks, DECL_P, output_block::decl_state, gcc_debug_hooks::die_ref_for_decl, DINFO_LEVEL_NONE, get_symbol_initial_value(), lto_section_name, output_block::main_stream, NULL, print_node_brief(), output_block::section_type, stream_write_tree, streamer_dump_file, streamer_write_string(), streamer_write_tree_bitfields(), streamer_write_tree_body(), streamer_write_uhwi(), lto_out_decl_state::symtab_node_encoder, and TREE_CODE.
Referenced by DFS::DFS(), and lto_write_tree().
|
static |
Output the cfg.
References loop::any_estimate, loop::any_likely_upper_bound, loop::any_upper_bound, bitpack_create(), bp_pack_var_len_unsigned(), output_block::cfg_stream, loop::dont_vectorize, EDGE_COUNT, ENTRY_BLOCK_PTR_FOR_FN, EST_LAST, loop::estimate_state, loop::finite_p, FOR_ALL_BB_FN, FOR_EACH_EDGE, loop::force_vectorize, get_loop(), loop::header, i, basic_block_def::index, last_basic_block_for_fn, output_block::main_stream, loop::nb_iterations_estimate, loop::nb_iterations_likely_upper_bound, loop::nb_iterations_upper_bound, basic_block_def::next_bb, number_of_loops(), loop::owned_clique, PROFILE_LAST, profile_status_for_fn, loop::safelen, SIGNED, loop::simduid, stream_output_location_and_block, stream_write_tree, streamer_write_enum, streamer_write_hwi(), streamer_write_uhwi(), streamer_write_widest_int(), basic_block_def::succs, and loop::unroll.
Referenced by output_function().
|
static |
Output the body of function NODE->DECL.
References create_output_block(), symtab_node::decl, DECL_INITIAL, destroy_output_block(), symtab_node::dump_name(), LTO_section_function_body, produce_asm(), stream_write_tree, streamer_dump_file, streamer_write_char_stream(), output_block::string_stream, output_block::symbol, timevar_pop(), and timevar_push().
Referenced by lto_output().
|
static |
Output landing pad LP to OB.
References eh_landing_pad_d::index, eh_region_d::index, LTO_eh_landing_pad, LTO_null, eh_landing_pad_d::next_lp, NULL, eh_landing_pad_d::post_landing_pad, eh_landing_pad_d::region, stream_write_tree, streamer_write_hwi(), streamer_write_record_start(), and streamer_write_zero().
Referenced by output_eh_regions().
|
static |
Output EH region R in function FN to OB. CURR_RN is the slot index that is being emitted in FN->EH->REGION_ARRAY. This is used to detect EH region sharing.
References bitpack_create(), ERT_ALLOWED_EXCEPTIONS, ERT_CLEANUP, ERT_MUST_NOT_THROW, ERT_TRY, gcc_unreachable, LTO_ert_allowed_exceptions, LTO_ert_cleanup, LTO_ert_must_not_throw, LTO_ert_try, LTO_null, output_block::main_stream, NULL, output_eh_try_list(), r, stream_output_location, stream_write_tree, streamer_write_bitpack(), streamer_write_hwi(), streamer_write_record_start(), streamer_write_uhwi(), and streamer_write_zero().
Referenced by output_eh_regions().
|
static |
Output the existing eh_table to OB.
References eh_status::eh_status_u::arm_eabi, function::eh, eh_status::ehspec_data, FOR_EACH_VEC_SAFE_ELT, i, eh_region_d::index, eh_status::lp_array, LTO_eh_table, LTO_null, output_block::main_stream, eh_status::eh_status_u::other, output_eh_lp(), output_eh_region(), eh_status::region_array, eh_status::region_tree, stream_write_tree, streamer_write_char_stream(), streamer_write_hwi(), streamer_write_record_start(), targetm, eh_status::ttype_data, and vec_safe_length().
Referenced by output_function().
|
static |
Output to OB a list of try/catch handlers starting with FIRST.
References eh_catch_d::filter_list, eh_catch_d::label, LTO_eh_catch, LTO_null, eh_catch_d::next_catch, stream_write_tree, streamer_write_record_start(), and eh_catch_d::type_list.
Referenced by output_eh_region().
|
static |
Output the body of function NODE->DECL.
References cfun, collect_block_tree_leafs(), create_output_block(), current_function_decl, symtab_node::decl, DECL_ARGUMENTS, decl_debug_args_lookup(), DECL_INITIAL, DECL_RESULT, DECL_STRUCT_FUNCTION, destroy_output_block(), symtab_node::dump_name(), error_mark_node, FOR_ALL_BB_FN, gcc_assert, gimple_has_body_p(), i, LTO_function, LTO_null, LTO_section_function_body, NULL, NULL_TREE, output_bb(), output_cfg(), output_eh_regions(), output_ssa_names(), output_struct_function_base(), produce_asm(), stream_write_tree, streamer_dump_file, streamer_write_chain(), streamer_write_char_stream(), streamer_write_record_start(), streamer_write_uhwi(), output_block::string_stream, and output_block::symbol.
Referenced by lto_output().
|
static |
Output all of the active ssa names to the ssa_names stream.
References gimple_bb(), i, output_block::main_stream, NULL_TREE, SSA_NAME_DEF_STMT, SSA_NAME_IN_FREE_LIST, SSA_NAME_IS_DEFAULT_DEF, SSA_NAME_VAR, SSANAMES, stream_write_tree, streamer_write_char_stream(), streamer_write_uhwi(), streamer_write_zero(), TREE_TYPE, vec_safe_length(), and virtual_operand_p().
Referenced by output_function().
|
static |
Output the base body of struct function FN using output block OB.
References function::after_inlining, function::always_inline_functions_inlined, function::assume_function, bitpack_create(), bp_pack_value(), function::calls_alloca, function::calls_eh_return, function::calls_setjmp, function::can_delete_dead_exceptions, function::can_throw_non_call_exceptions, CHAR_BIT, function::curr_properties, function::decl, decl_to_instance_map, FOR_EACH_VEC_SAFE_ELT, function::function_end_locus, function::function_start_locus, hash_map< KeyId, Value, Traits >::get(), function::has_force_vectorize_loops, function::has_forced_label_in_static, function::has_local_explicit_reg_vars, function::has_musttail, function::has_nonlocal_label, function::has_simduid_loops, function::has_unroll, i, function::is_thunk, function::last_clique, function::local_decls, output_block::main_stream, function::nonlocal_goto_save_area, NULL, function::returns_pcc_struct, function::returns_struct, function::static_chain_decl, function::stdarg, stream_output_location, stream_write_tree, streamer_write_bitpack(), streamer_write_hwi(), streamer_write_uhwi(), function::va_list_fpr_size, function::va_list_gpr_size, and vec_safe_length().
Referenced by output_function().
void produce_asm | ( | struct output_block * | ob, |
tree | fn ) |
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().
void produce_asm_for_decls | ( | void | ) |
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().
|
static |
Produce LTO section that contains global information about LTO bytecode.
References create_output_block(), destroy_output_block(), free(), lto_begin_section(), lto_end_section(), lto_get_section_name(), LTO_major_version, LTO_minor_version, LTO_section_lto, lto_write_data(), NULL, lto_section::set_compression(), ZLIB, and ZSTD.
Referenced by lto_output().
|
static |
Write an IL symbol table to OB. SET and VSET are cgraph/varpool node sets we are outputting.
References cache, symtab_node::decl, DECL_EXTERNAL, output_block::decl_state, free(), lsei_end_p(), lsei_next(), lsei_node(), lsei_start(), lto_begin_section(), lto_end_section(), lto_get_section_name(), LTO_section_symtab, NULL, symtab_node::output_to_lto_symbol_table_p(), lto_out_decl_state::symtab_node_encoder, write_symbol(), and output_block::writer_cache.
Referenced by produce_asm_for_decls().
|
static |
Write an IL symbol table extension to OB. SET and VSET are cgraph/varpool node sets we are outputting.
References symtab_node::decl, DECL_EXTERNAL, output_block::decl_state, free(), gcc_assert, lsei_end_p(), lsei_next(), lsei_node(), lsei_start(), lto_begin_section(), lto_end_section(), lto_get_section_name(), LTO_section_symtab_extension, LTO_SYMTAB_EXTENSION_VERSION, lto_write_data(), NULL, symtab_node::output_to_lto_symbol_table_p(), lto_out_decl_state::symtab_node_encoder, and write_symbol_extension_info().
Referenced by produce_asm_for_decls().
|
static |
Remove functions that are no longer used from offload_funcs, and mark the remaining ones with DECL_PRESERVE_P.
References DECL_PRESERVE_P, FOR_EACH_VEC_ELT, cgraph_node::get(), NULL, offload_funcs, and VEC_ORDERED_REMOVE_IF.
Referenced by lto_output().
void stream_write_tree_ref | ( | struct output_block * | ob, |
tree | t ) |
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().
|
static |
Emit the chain of tree nodes starting at T. OB is the output block to write to. REF_P is true if chain elements should be emitted as references.
References DECL_EXTERNAL, gcc_assert, NULL_TREE, stream_write_tree, TREE_CHAIN, and VAR_OR_FUNCTION_DECL_P.
Referenced by output_function().
Very rough estimate of streaming size of the initializer. If we ignored presence of strings, we could simply just count number of non-indexable tree nodes and number of references to indexable nodes. Strings however may be very large and we do not want to dump them int othe global stream. Count the size of initializer until the size in DATA is positive.
References gcc_checking_assert, NULL_TREE, TREE_CODE, tree_is_indexable(), and TREE_STRING_LENGTH.
Referenced by get_symbol_initial_value().
Return true if tree node T is written to various tables. For these nodes, we sometimes want to write their phyiscal representation (via lto_output_tree), and sometimes we need to emit an index reference into a table (via lto_output_tree_ref).
References DECL_CONTEXT, decl_function_context(), DECL_NONLOCAL, FORCED_LABEL, gcc_unreachable, IS_TYPE_OR_DECL_P, lto_variably_modified_type_p(), TREE_CODE, TREE_STATIC, TREE_TYPE, TYPE_P, and VAR_P.
Referenced by DFS::DFS_write_tree(), lto_indexable_tree_ref(), lto_output_tree(), lto_output_tree_1(), and subtract_estimated_size().
Wrap symbol references in *TP inside a type-preserving MEM_REF.
References build1(), build2(), build_int_cst(), build_pointer_type(), EXPR_P, handled_component_p(), NULL_TREE, TREE_CODE, TREE_OPERAND, TREE_PUBLIC, TREE_THIS_VOLATILE, TREE_TYPE, and VAR_P.
Referenced by lto_output().
|
static |
Write a sequence of indices into the globals vector corresponding to the trees in ENCODER. These are used by the reader to map the indices used to refer to global entities within function bodies to their referents.
References free(), gcc_assert, lto_tree_ref_encoder_get_tree(), lto_tree_ref_encoder_size(), lto_write_data(), streamer_tree_cache_lookup(), and output_block::writer_cache.
Referenced by lto_output_decl_state_refs().
|
static |
Write each node in encoded by ENCODER to OB, as well as those reachable from it and required for correct representation of its semantics. Each node in ENCODER must be a global declaration or a type. A node is written only once, even if it appears multiple times in the vector. Certain transitively-reachable nodes, such as those representing expressions, may be duplicated, but such nodes must not appear in ENCODER itself.
References lto_tree_ref_encoder_get_tree(), lto_tree_ref_encoder_size(), NULL, print_node_brief(), stream_write_tree, streamer_dump_file, streamer_tree_cache_lookup(), and output_block::writer_cache.
Referenced by lto_output_decl_state_streams().
|
static |
Write symbol T into STREAM in CACHE. SEEN specifies symbols we wrote so far.
References hash_set< KeyId, Lazy, Traits >::add(), cache, DECL_ASSEMBLER_NAME, decl_comdat_group_id(), DECL_COMMON, DECL_EXTERNAL, DECL_ONE_ONLY, DECL_SIZE_UNIT, DECL_VISIBILITY, DECL_WEAK, gcc_assert, cgraph_node::get(), varpool_node::get(), IDENTIFIER_POINTER, lto_write_data(), streamer_tree_cache_lookup(), targetm, TREE_CODE, TREE_INT_CST_LOW, VAR_OR_FUNCTION_DECL_P, VAR_P, VISIBILITY_DEFAULT, VISIBILITY_HIDDEN, VISIBILITY_INTERNAL, and VISIBILITY_PROTECTED.
Referenced by produce_symtab().
|
static |
Write extension information for symbols (symbol type, section flags).
References section::common, section_common::flags, get_variable_section(), lto_write_data(), SECTION_BSS, TREE_CODE, and VAR_P.
Referenced by produce_symtab_extension().