GCC Middle and Back End API Reference
|
Data Structures | |
struct | ipa_reference_local_vars_info_d |
struct | ipa_reference_global_vars_info_d |
struct | ipa_reference_optimization_summary_d |
struct | ipa_reference_vars_info_d |
Typedefs | |
typedef struct ipa_reference_local_vars_info_d * | ipa_reference_local_vars_info_t |
typedef struct ipa_reference_global_vars_info_d * | ipa_reference_global_vars_info_t |
typedef struct ipa_reference_optimization_summary_d * | ipa_reference_optimization_summary_t |
typedef struct ipa_reference_vars_info_d * | ipa_reference_vars_info_t |
Variables | |
static splay_tree | reference_vars_to_consider |
static bitmap | all_module_statics |
static bitmap_obstack | local_info_obstack |
static bitmap_obstack | optimization_summary_obstack |
static struct cgraph_2node_hook_list * | node_duplication_hook_holder |
static struct cgraph_node_hook_list * | node_removal_hook_holder |
static vec < ipa_reference_vars_info_t > | ipa_reference_vars_vector |
static vec < ipa_reference_optimization_summary_t > | ipa_reference_opt_sum_vector |
typedef struct ipa_reference_global_vars_info_d* ipa_reference_global_vars_info_t |
typedef struct ipa_reference_local_vars_info_d* ipa_reference_local_vars_info_t |
typedef struct ipa_reference_vars_info_d* ipa_reference_vars_info_t |
|
inlinestatic |
Add VAR to all_module_statics and the two reference_vars_to_consider* sets.
References bitmap_set_bit(), dump_file, and reference_vars_to_consider.
Referenced by is_proper_for_analysis().
|
static |
This is the main routine for finding the reference patterns for global variables within a function FN.
References bitmap_clear(), bitmap_set_bit(), cgraph_node_cannot_return(), symtab_node_base::decl, init_function_info(), IPA_REF_ADDR, ipa_ref_cannot_lead_to_return(), IPA_REF_LOAD, IPA_REF_STORE, ipa_ref_varpool_node(), is_proper_for_analysis(), cgraph_node::local, symtab_node_base::ref_list, ipa_ref::referred, ipa_reference_local_vars_info_d::statics_read, ipa_reference_local_vars_info_d::statics_written, cgraph_node::symbol, and varpool_node::symbol.
Referenced by generate_summary().
|
static |
Return a copy of SET on the bitmap obstack containing SET. But if SET is NULL or the maximum set, return that instead.
References bitmap_copy(), copy(), and bitmap_obstack::obstack.
Referenced by duplicate_node_data(), and propagate().
|
static |
|
static |
Called when new clone is inserted to callgraph late.
References copy_static_var_set(), get_reference_optimization_summary(), set_reference_optimization_summary(), ipa_reference_optimization_summary_d::statics_not_read, and ipa_reference_optimization_summary_d::statics_not_written.
Referenced by ipa_init(), and ipa_reference_read_optimization_summary().
|
static |
References seen_error().
|
static |
Analyze each function in the cgraph to see which global or statics are read or written.
References analyze_function(), AVAIL_OVERWRITABLE, cgraph_function_body_availability(), cgraph_node_asm_name(), dump_file, get_reference_vars_info(), get_static_name(), ipa_init(), ipa_reference_vars_info_d::local, symtab_node_base::order, ipa_reference_local_vars_info_d::statics_read, ipa_reference_local_vars_info_d::statics_written, and cgraph_node::symbol.
Referenced by propagate().
|
static |
Set READ_ALL/WRITE_ALL based on decl flags of NODE or any member in the cycle of NODE.
References AVAIL_OVERWRITABLE, cgraph_edge::callee, cgraph_node::callees, cgraph_edge_cannot_lead_to_return(), cgraph_function_body_availability(), cgraph_function_node(), dump_file, dump_flags, cgraph_indirect_call_info::ecf_flags, cgraph_node::indirect_calls, cgraph_edge::indirect_info, cgraph_edge::next_callee, and read_write_all_from_decl().
Referenced by propagate().
|
inlinestatic |
Return the ipa_reference_vars structure starting from the cgraph NODE.
References cgraph_node::uid.
Referenced by duplicate_node_data(), ipa_reference_get_not_read_global(), ipa_reference_get_not_written_global(), ipa_reference_write_optimization_summary(), remove_node_data(), and write_node_summary_p().
|
inlinestatic |
Return the ipa_reference_vars structure starting from the cgraph NODE.
References cgraph_node::uid.
Referenced by generate_summary(), propagate(), and propagate_bits().
|
static |
Lookup the tree node for the static variable that has UID and convert the name to a string for debugging.
References fndecl_name(), and reference_vars_to_consider.
Referenced by dump_static_vars_set_to_file(), and generate_summary().
|
static |
Set up the persistent info for FN.
References ipa_reference_vars_info_d::local, set_reference_vars_info(), ipa_reference_local_vars_info_d::statics_read, and ipa_reference_local_vars_info_d::statics_written.
Referenced by analyze_function().
|
static |
Compute X &= Y, taking into account the possibility that X may become the maximum set.
References all_module_statics, bitmap_and_into(), and bitmap_equal_p().
Referenced by propagate().
|
static |
The init routine for analyzing global static variable usage. See comments at top for description.
References bitmap_obstack_initialize(), cgraph_add_node_duplication_hook(), cgraph_add_node_removal_hook(), dump_file, duplicate_node_data(), reference_vars_to_consider, and remove_node_data().
Referenced by generate_summary().
bitmap ipa_reference_get_not_read_global | ( | ) |
Return a bitmap indexed by DECL_UID for the static variables that are *not* read during the execution of the function FN. Returns NULL if no data is available.
References all_module_statics, cgraph_function_node(), symtab_node_base::decl, flags_from_decl_or_type(), get_reference_optimization_summary(), ipa_reference_optimization_summary_d::statics_not_read, and cgraph_node::symbol.
Referenced by ref_maybe_used_by_call_p_1().
bitmap ipa_reference_get_not_written_global | ( | ) |
Return a bitmap indexed by DECL_UID for the static variables that are *not* written during the execution of the function FN. Note that variables written may or may not be read during the function call. Returns NULL if no data is available.
References all_module_statics, symtab_node_base::decl, flags_from_decl_or_type(), get_reference_optimization_summary(), ipa_reference_optimization_summary_d::statics_not_written, and cgraph_node::symbol.
Referenced by call_may_clobber_ref_p_1().
|
static |
Deserialize the ipa info for lto.
References all_module_statics, bitmap_obstack_initialize(), bitmap_set_bit(), cgraph(), cgraph_add_node_duplication_hook(), cgraph_add_node_removal_hook(), cgraph_node_asm_name(), dump_file, duplicate_node_data(), fatal_error(), fndecl_name(), len, lto_create_simple_input_block(), lto_destroy_simple_input_block(), lto_get_file_decl_data(), LTO_section_ipa_reference, lto_symtab_encoder_deref(), symtab_node_base::order, remove_node_data(), set_reference_optimization_summary(), ipa_reference_optimization_summary_d::statics_not_read, ipa_reference_optimization_summary_d::statics_not_written, streamer_read_hwi(), streamer_read_uhwi(), cgraph_node::symbol, and lto_file_decl_data::symtab_node_encoder.
|
static |
Serialize the ipa info for lto.
References bitmap_bit_p(), bitmap_set_bit(), count, symtab_node_base::decl, lto_simple_output_block::decl_state, dyn_cast(), get_reference_optimization_summary(), lto_create_simple_output_block(), lto_destroy_simple_output_block(), LTO_section_ipa_reference, lto_symtab_encoder_deref(), lto_symtab_encoder_encode(), lto_symtab_encoder_size(), lto_simple_output_block::main_stream, symtab_node_base::ref_list, reference_vars_to_consider, referenced_from_this_partition_p(), ipa_reference_optimization_summary_d::statics_not_read, ipa_reference_optimization_summary_d::statics_not_written, stream_out_bitmap(), streamer_write_uhwi_stream(), varpool_node::symbol, lto_out_decl_state::symtab_node_encoder, and write_node_summary_p().
|
inlinestatic |
Return true if the variable T is the right kind of static variable to perform compilation unit scope escape analysis.
References add_static_var(), and bitmap_bit_p().
Referenced by analyze_function(), and propagate().
ipa_opt_pass_d* make_pass_ipa_reference | ( | ) |
|
static |
Produce the global information by preforming a transitive closure on the local information that was produced by ipa_analyze_function.
References symtab_node_base::alias, all_module_statics, AVAIL_OVERWRITABLE, bitmap_and_compl(), bitmap_clear_bit(), bitmap_empty_p(), bitmap_obstack_release(), cgraph_function_body_availability(), cgraph_n_nodes, cgraph_node_asm_name(), cgraph_node_cannot_return(), copy_static_var_set(), symtab_node_base::decl, symtab_node_base::definition, dump_cgraph(), dump_file, dump_flags, dump_static_vars_set_to_file(), symtab_node_base::externally_visible, flags_from_decl_or_type(), free(), generate_summary(), get_read_write_all_from_node(), get_reference_vars_info(), ipa_reference_vars_info_d::global, intersect_static_var_sets(), ipa_discover_readonly_nonaddressable_vars(), ipa_free_postorder_info(), ipa_get_nodes_in_cycle(), ipa_print_order(), ipa_reduced_postorder(), is_proper_for_analysis(), ipa_reference_vars_info_d::local, symtab_node_base::order, order, propagate_bits(), reference_vars_to_consider, set_reference_optimization_summary(), ipa_reference_optimization_summary_d::statics_not_read, ipa_reference_optimization_summary_d::statics_not_written, ipa_reference_local_vars_info_d::statics_read, ipa_reference_global_vars_info_d::statics_read, ipa_reference_local_vars_info_d::statics_written, ipa_reference_global_vars_info_d::statics_written, cgraph_node::symbol, varpool_node::symbol, and union_static_var_sets().
|
static |
Compute the union all of the statics read and written by every callee of X into X_GLOBAL->statics_read and X_GLOBAL->statics_written. X_GLOBAL is actually the set representing the cycle containing X. If the read and written sets of X_GLOBAL has been reduced to the maximum set, we don't have to look at the remaining callees.
References all_module_statics, AVAIL_OVERWRITABLE, cgraph_edge::callee, cgraph_node::callees, cgraph_edge_cannot_lead_to_return(), cgraph_function_node(), symtab_node_base::decl, flags_from_decl_or_type(), get_reference_vars_info(), ipa_reference_vars_info_d::global, cgraph_edge::next_callee, ipa_reference_global_vars_info_d::statics_read, ipa_reference_global_vars_info_d::statics_written, cgraph_node::symbol, and union_static_var_sets().
Referenced by propagate().
|
static |
Set READ_ALL/WRITE_ALL based on decl flags of NODE.
References AVAIL_OVERWRITABLE, cgraph_function_body_availability(), cgraph_node_asm_name(), cgraph_node_cannot_return(), symtab_node_base::decl, dump_file, dump_flags, flags_from_decl_or_type(), symtab_node_base::order, and cgraph_node::symbol.
Referenced by get_read_write_all_from_node().
|
static |
@verbatim Callgraph based analysis of static variables.
Copyright (C) 2004-2013 Free Software Foundation, Inc. Contributed by Kenneth Zadeck zadec k@na tural brid ge.co m
This file is part of GCC.
GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version.
GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with GCC; see the file COPYING3. If not see http://www.gnu.org/licenses/.
This file gathers information about how variables whose scope is confined to the compilation unit are used. The transitive call site specific clobber effects are computed for the variables whose scope is contained within this compilation unit. First each function and static variable initialization is analyzed to determine which local static variables are either read, written, or have their address taken. Any local static that has its address taken is removed from consideration. Once the local read and writes are determined, a transitive closure of this information is performed over the call graph to determine the worst case set of side effects of each call. In later parts of the compiler, these local and global sets are examined to make the call clobbering less traumatic, promote some statics to registers, and improve aliasing information.
|
static |
Called when node is removed.
References free(), get_reference_optimization_summary(), set_reference_optimization_summary(), ipa_reference_optimization_summary_d::statics_not_read, and ipa_reference_optimization_summary_d::statics_not_written.
|
inlinestatic |
Return the ipa_reference_vars structure starting from the cgraph NODE.
References cgraph_node::uid.
Referenced by duplicate_node_data(), ipa_reference_read_optimization_summary(), propagate(), and remove_node_data().
|
inlinestatic |
Return the ipa_reference_vars structure starting from the cgraph NODE.
References cgraph_node::uid.
Referenced by init_function_info().
|
static |
Stream out BITS<RANS_STATICS as list of decls to OB. LTRANS_STATICS_BITCOUNT specify number of bits in LTRANS_STATICS or -1. When it is positive, just output -1 when BITS<RANS_STATICS == BITS<RANS_STATICS.
References count, lto_simple_output_block::decl_state, lto_output_var_decl_index(), lto_simple_output_block::main_stream, reference_vars_to_consider, and streamer_write_hwi_stream().
Referenced by ipa_reference_write_optimization_summary().
|
static |
Compute X |= Y, taking into account the possibility that either X or Y is already the maximum set. Return true if X is the maximum set after taking the union with Y.
References all_module_statics, bitmap_equal_p(), and bitmap_ior_into().
Referenced by propagate(), and propagate_bits().
|
static |
Return true if we need to write summary of NODE.
References bitmap_empty_p(), bitmap_intersect_p(), symtab_node_base::definition, get_reference_optimization_summary(), cgraph_node::global, cgraph_global_info::inlined_to, reachable_from_this_partition_p(), symtab_node_base::ref_list, referenced_from_this_partition_p(), ipa_reference_optimization_summary_d::statics_not_read, ipa_reference_optimization_summary_d::statics_not_written, and cgraph_node::symbol.
Referenced by ipa_reference_write_optimization_summary().
|
static |
Set of all interesting module statics. A bit is set for every module static we are considering. This is added to the local info when asm code is found that clobbers all memory.
Referenced by intersect_static_var_sets(), ipa_reference_get_not_read_global(), ipa_reference_get_not_written_global(), ipa_reference_read_optimization_summary(), propagate(), propagate_bits(), and union_static_var_sets().
|
static |
|
static |
Vector where the reference var infos are actually stored. Indexed by UID of call graph nodes.
|
static |
Obstack holding bitmaps of local analysis (live from analysis to propagation)
|
static |
Holders of ipa cgraph hooks:
|
static |
|
static |
Obstack holding global analysis live forever.
|
static |
This splay tree contains all of the static variables that are being considered by the compilation level alias analysis.
Referenced by add_static_var(), get_static_name(), ipa_init(), ipa_reference_write_optimization_summary(), propagate(), and stream_out_bitmap().