GCC Middle and Back End API Reference
|
Data Structures | |
struct | tree_int_map_hasher |
Variables | |
static bitmap | usedvars |
static bitmap_obstack | liveness_bitmap_obstack |
void calculate_live_on_exit | ( | ) |
Calculate the live on exit vectors based on the entry info in LIVEINFO.
References bitmap_clear(), bitmap_ior_into(), bitmap_set_bit(), edge_def::dest, gimple_phi_arg_edge(), gimple_phi_num_args(), gsi_end_p(), gsi_next(), gsi_start_phis(), gsi_stmt(), basic_block_def::index, live_on_entry(), tree_live_info_d::liveout, tree_live_info_d::map, edge_def::src, basic_block_def::succs, and var_to_partition().
Referenced by calculate_live_ranges().
tree_live_info_p calculate_live_ranges | ( | ) |
Given partition map MAP, calculate all the live on entry bitmaps for each partition. Return a new live info object.
References bitmap_obstack_initialize(), calculate_live_on_exit(), live, live_worklist(), new_tree_live_info(), num_var_partitions(), partition_to_var(), set_var_live_on_entry(), and verify_live_on_entry().
Referenced by coalesce_ssa_name().
|
static |
Set all block pointer in debug or clobber stmt to NULL if the block is unused, so that they will not be streamed out.
References clear_unused_block_pointer_1(), gimple_block(), gimple_clobber_p(), gimple_num_ops(), gimple_op_ptr(), gimple_set_block(), gsi_end_p(), gsi_next(), gsi_start_bb(), gsi_stmt(), and is_gimple_debug().
Referenced by remove_unused_locals().
|
static |
Helper function for clear_unused_block_pointer, called via walk_tree.
Referenced by clear_unused_block_pointer().
DEBUG_FUNCTION void debug | ( | ) |
Generic dump for the above.
References dump_var_map().
DEBUG_FUNCTION void debug_scope_block | ( | ) |
Dump the tree of lexical scopes starting at SCOPE to stderr. FLAGS is as in print_generic_expr.
References dump_scope_block().
DEBUG_FUNCTION void debug_scope_blocks | ( | ) |
Dump the tree of lexical scopes of current_function_decl to stderr. FLAGS is as in print_generic_expr.
References dump_scope_blocks().
void delete_tree_live_info | ( | ) |
Free storage for live range info object LIVE.
References bitmap_obstack_release(), free(), tree_live_info_d::livein, tree_live_info_d::liveout, and tree_live_info_d::work_stack.
Referenced by coalesce_ssa_name().
void delete_var_map | ( | ) |
Free memory associated with MAP.
References free(), _var_map::partition_to_view, var_map_base_fini(), _var_map::var_partition, and _var_map::view_to_partition.
Referenced by finish_out_of_ssa(), and rename_ssa_copies().
void dump_live_info | ( | ) |
Output live range info LIVE to file F, controlled by FLAG.
References basic_block_def::index, tree_live_info_d::livein, tree_live_info_d::liveout, map, tree_live_info_d::map, partition_to_var(), and print_generic_expr().
Referenced by coalesce_ssa_name().
|
static |
Dump scope blocks starting at SCOPE to FILE. INDENT is the indentation level and FLAGS is as in print_generic_expr.
References block_ultimate_origin(), expand_location(), and print_generic_decl().
Referenced by debug_scope_block(), and dump_scope_blocks().
void dump_scope_blocks | ( | ) |
Dump the tree of lexical scopes of current_function_decl to FILE. FLAGS is as in print_generic_expr.
References current_function_decl, and dump_scope_block().
void dump_var_map | ( | ) |
Output partition map MAP to file F.
References _var_map::num_partitions, partition_to_var(), _var_map::partition_to_view, print_generic_expr(), _var_map::var_partition, _var_map::view_to_partition, and virtual_operand_p().
Referenced by coalesce_ssa_name(), debug(), remove_ssa_form(), and rename_ssa_copies().
var_map init_var_map | ( | ) |
Create a variable partition map of SIZE, initialize and return it.
References map, _var_map::num_basevars, _var_map::num_partitions, _var_map::partition_size, _var_map::partition_to_base_index, _var_map::partition_to_view, _var_map::var_partition, and _var_map::view_to_partition.
Referenced by create_outofssa_var_map(), and rename_ssa_copies().
|
inlinestatic |
Return true if VAR is marked as used.
References bitmap_bit_p().
Referenced by remove_unused_locals(), and remove_unused_scope_block_p().
|
static |
Using LIVE, fill in all the live-on-entry blocks between the defs and uses of all the variables.
References bitmap_clear(), loe_visit_block(), sbitmap_alloc(), sbitmap_free(), tree_live_info_d::stack_top, visited, and tree_live_info_d::work_stack.
Referenced by calculate_live_ranges().
|
static |
Visit basic block BB and propagate any required live on entry bits from LIVE into the predecessors. VISITED is the bitmap of visited blocks. TMP is a temporary work bitmap which is passed in to avoid reallocating it each time.
References bitmap_and_compl(), bitmap_bit_p(), bitmap_clear_bit(), bitmap_ior_into(), bitmap_set_bit(), basic_block_def::index, live_on_entry(), tree_live_info_d::liveout, basic_block_def::preds, edge_def::src, and tree_live_info_d::stack_top.
Referenced by live_worklist().
|
inlinestatic |
Referenced by mark_all_vars_used_1(), and remove_unused_locals().
|
inlinestatic |
Mark all VAR_DECLS under *EXPR_P as used, so that they won't be eliminated during the tree->rtl conversion process.
References mark_all_vars_used_1().
|
static |
Helper function for mark_all_vars_used, called via walk_tree.
References is_global_var(), mark_all_vars_used(), and set_is_used().
Referenced by mark_all_vars_used().
|
static |
Mark the scope block SCOPE and its subblocks unused when they can be possibly eliminated if dead.
References debug_hooks, and gcc_debug_hooks::ignore_block.
Referenced by remove_unused_locals().
|
static |
Allocate and return a new live range information object base on MAP.
References tree_live_info_d::global, basic_block_def::index, live, tree_live_info_d::livein, tree_live_info_d::liveout, map, tree_live_info_d::map, tree_live_info_d::num_blocks, tree_live_info_d::stack_top, and tree_live_info_d::work_stack.
Referenced by calculate_live_ranges().
void partition_view_bitmap | ( | ) |
Create a partition view in MAP which includes just partitions which occur in the bitmap ONLY. If WANT_BASES is true, create the base variable map as well.
References bitmap_bit_p(), bitmap_set_bit(), partition_view_fini(), partition_view_init(), var_map_base_fini(), var_map_base_init(), and _var_map::var_partition.
Referenced by coalesce_ssa_name().
|
static |
This routine will finalize the view data for MAP based on the partitions set in SELECTED. This is either the same bitmap returned from partition_view_init, or a trimmed down version if some of those partitions were not desired in this view. SELECTED is freed before returning.
References bitmap_count_bits(), count, limit, memset(), _var_map::num_partitions, _var_map::partition_size, _var_map::partition_to_view, and _var_map::view_to_partition.
Referenced by partition_view_bitmap(), and partition_view_normal().
|
static |
Compress the partition numbers in MAP such that they fall in the range 0..(num_partitions-1) instead of wherever they turned out during the partitioning exercise. This removes any references to unused partitions, thereby allowing bitmaps and other vectors to be much denser. This is implemented such that compaction doesn't affect partitioning. Ie., once partitions are created and possibly merged, running one or more different kind of compaction will not affect the partitions themselves. Their index might change, but all the same variables will still be members of the same partition group. This allows work on reduced sets, and no loss of information when a larger set is later desired. In particular, coalescing can work on partitions which have 2 or more definitions, and then 'recompact' later to include all the single definitions for assignment to program variables.
Set MAP back to the initial state of having no partition view. Return a bitmap which has a bit set for each partition number which is in use in the varmap.
References bitmap_set_bit(), free(), has_zero_uses(), _var_map::num_partitions, _var_map::partition_size, _var_map::partition_to_view, _var_map::var_partition, _var_map::view_to_partition, and virtual_operand_p().
Referenced by partition_view_bitmap(), and partition_view_normal().
void partition_view_normal | ( | ) |
Create a partition view which includes all the used partitions in MAP. If WANT_BASES is true, create the base variable map as well.
References partition_view_fini(), partition_view_init(), var_map_base_fini(), and var_map_base_init().
Referenced by remove_ssa_form().
void register_ssa_partition_check | ( | ) |
Verify that SSA_VAR is a non-virtual SSA_NAME.
References internal_error(), print_generic_expr(), and virtual_operand_p().
Referenced by register_ssa_partition().
void remove_unused_locals | ( | void | ) |
Remove local variables that are not referenced in the IL.
References tree_int_map::base, cfun, clear_unused_block_pointer(), current_function_decl, dump_file, dump_flags, dump_scope_blocks(), get_base_address(), gimple_assign_lhs(), gimple_block(), gimple_clobber_p(), gimple_num_ops(), gimple_op_ptr(), gimple_phi_arg_location(), gimple_phi_result(), edge_def::goto_locus, gsi_end_p(), gsi_next(), gsi_remove(), gsi_start_bb(), gsi_start_phis(), gsi_stmt(), function::has_local_explicit_reg_vars, is_gimple_debug(), is_global_var(), is_used_p(), function::local_decls, mark_all_vars_used(), mark_scope_block_unused(), function::nonlocal_goto_save_area, release_defs(), release_ssa_name(), remove_unused_scope_block_p(), set_ssa_default_def(), ssa_default_def(), statistics_counter_event(), basic_block_def::succs, timevar_pop(), timevar_push(), unlink_stmt_vdef(), vec_safe_length(), and virtual_operand_p().
Referenced by execute_function_todo().
|
static |
Look if the block is dead (by possibly eliminating its dead subblocks) and return true if so. Block is declared dead if: 1) No statements are associated with it. 2) Declares no live variables 3) All subblocks are dead or there is precisely one subblocks and the block has same abstract origin as outer block and declares no variables, so it is pure wrapper. When we are not outputting full debug info, we also eliminate dead variables out of scope blocks to let them to be recycled by GGC and to save copying work done by the inliner.
References DINFO_LEVEL_NONE, DINFO_LEVEL_NORMAL, DINFO_LEVEL_TERSE, DINFO_LEVEL_VERBOSE, inlined_function_outer_scope_p(), is_used_p(), and lookup_attribute().
Referenced by remove_unused_locals().
|
inlinestatic |
Mark VAR as used, so that it'll be preserved during rtl expansion. Returns true if VAR wasn't marked before.
References bitmap_set_bit().
Referenced by mark_all_vars_used_1().
|
static |
Calculate the initial live on entry vector for SSA_NAME using immediate_use links. Set the live on entry fields in LIVE. Def's are marked temporarily in the liveout vector.
References add_block(), bitmap_set_bit(), gimple_bb(), gimple_phi_arg_edge(), tree_live_info_d::global, basic_block_def::index, is_gimple_debug(), tree_live_info_d::livein, tree_live_info_d::liveout, tree_live_info_d::map, edge_def::src, and var_to_partition().
Referenced by calculate_live_ranges().
|
static |
Remove the base table in MAP.
References free(), _var_map::num_basevars, and _var_map::partition_to_base_index.
Referenced by delete_var_map(), partition_view_bitmap(), and partition_view_normal().
|
static |
This routine will initialize the basevar fields of MAP.
References tree_int_map::base, hash_table< Descriptor, Allocator >::create(), hash_table< Descriptor, Allocator >::find_slot(), free(), tree_map_base::from, _var_map::num_basevars, num_var_partitions(), _var_map::partition_to_base_index, partition_to_var(), and tree_int_map::to.
Referenced by partition_view_bitmap(), and partition_view_normal().
int var_union | ( | ) |
This function will combine the partitions in MAP for VAR1 and VAR2. It Returns the partition which represents the new partition. If the two partitions cannot be combined, NO_PARTITION is returned.
References _var_map::partition_to_view, and _var_map::var_partition.
Referenced by attempt_coalesce().
|
static |
@verbatim Liveness for SSA trees.
Copyright (C) 2003-2013 Free Software Foundation, Inc. Contributed by Andrew MacLeod amacl eod@ redha t.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/.
Referenced by calculate_live_ranges().
|
static |
Verify that the info in LIVE matches the current cfg.
References bitmap_bit_p(), cfun, edge_def::dest, gimple_bb(), gimple_nop_p(), gimple_phi_arg_def(), gimple_phi_num_args(), gsi_end_p(), gsi_next(), gsi_start_phis(), gsi_stmt(), basic_block_def::index, live_on_entry(), map, tree_live_info_d::map, num_var_partitions(), partition_to_var(), print_generic_expr(), print_gimple_stmt(), ssa_default_def(), and basic_block_def::succs.
|
static |
Obstack for globale liveness info bitmaps. We don't want to put these on the default obstack because these bitmaps can grow quite large and we'll hold on to all that memory until the end of the compiler run. As a bonus, delete_tree_live_info can destroy all the bitmaps by just releasing the whole obstack.
|
static |