GCC Middle and Back End API Reference
|
Go to the source code of this file.
Functions | |
tree | get_current_def (tree) |
void | set_current_def (tree, tree) |
void | delete_update_ssa (void) |
tree | create_new_def_for (tree, gimple *, def_operand_p) |
void | mark_virtual_operands_for_renaming (struct function *) |
void | mark_virtual_operand_for_renaming (tree) |
void | mark_virtual_phi_result_for_renaming (gphi *) |
bool | need_ssa_update_p (struct function *) |
bool | name_registered_for_update_p (tree) |
void | release_ssa_name_after_update_ssa (tree) |
void | update_ssa (unsigned) |
void | debug_decl_set (bitmap set) |
void | dump_defs_stack (FILE *, int) |
void | debug_defs_stack (int) |
void | dump_currdefs (FILE *) |
void | debug_currdefs (void) |
void | dump_tree_ssa (FILE *) |
void | debug_tree_ssa (void) |
void | dump_tree_ssa_stats (FILE *) |
void | debug_tree_ssa_stats (void) |
void | dump_var_infos (FILE *) |
void | debug_var_infos (void) |
void | dump_names_replaced_by (FILE *, tree) |
void | debug_names_replaced_by (tree) |
void | dump_update_ssa (FILE *) |
void | debug_update_ssa (void) |
Variables | |
bitmap | names_to_release |
tree create_new_def_for | ( | tree | old_name, |
gimple * | stmt, | ||
def_operand_p | def ) |
Create a new name for OLD_NAME in statement STMT and replace the operand pointed to by DEF_P with the newly created name. If DEF_P is NULL then STMT should be a GIMPLE assignment. Return the new name and register the replacement mapping <NEW, OLD> in update_ssa's tables.
References add_new_name_mapping(), bb_has_abnormal_pred(), cfun, common_info::current_def, duplicate_ssa_name(), gcc_assert, get_ssa_name_ann(), gimple_assign_set_lhs(), gimple_bb(), ssa_name_info::info, init_update_ssa(), SET_DEF, SSA_NAME_OCCURS_IN_ABNORMAL_PHI, timevar_pop(), timevar_push(), and update_ssa_initialized_fn.
Referenced by add_exit_phi(), gimple_duplicate_bb(), sese_add_exit_phis_edge(), worker_single_copy(), and worker_single_simple().
|
extern |
Dump the current reaching definition of every symbol to stderr.
References dump_currdefs().
|
extern |
Prototypes for debugging functions.
Dump bitmap SET (assumed to contain VAR_DECLs) to FILE.
References dump_decl_set().
|
extern |
Dump the renaming stack (block_defs_stack) to stderr. Traverse the stack up to a maximum of N levels. If N is -1, the whole stack is dumped. New levels are created when the dominator tree traversal used for renaming enters a new sub-tree.
References dump_defs_stack().
|
extern |
Dump all the names replaced by NAME to stderr.
References dump_names_replaced_by().
|
extern |
Dump SSA information to stderr.
References dump_tree_ssa().
|
extern |
Dump SSA statistics on stderr.
References dump_tree_ssa_stats().
|
extern |
Dump SSA update information to stderr.
References dump_update_ssa().
|
extern |
Dump the VAR_INFOS hash table on stderr.
References dump_var_infos().
void delete_update_ssa | ( | void | ) |
Deallocate data structures used for incremental SSA updates.
References BITMAP_FREE, blocks_to_update, blocks_with_phis_to_rewrite, clear_ssa_name_info(), EXECUTE_IF_SET_IN_BITMAP, fini_ssa_renamer(), i, names_to_release, new_ssa_names, NULL, old_ssa_names, release_ssa_name(), sbitmap_free(), ssa_name, symbols_to_rename, symbols_to_rename_set, and update_ssa_initialized_fn.
Referenced by copy_loop_before(), update_ssa(), and vect_do_peeling().
|
extern |
Dump the current reaching definition of every symbol to FILE.
References common_info::current_def, get_common_info(), print_generic_expr(), and symbols_to_rename.
Referenced by debug_currdefs(), and dump_tree_ssa().
|
extern |
Dump the renaming stack (block_defs_stack) to FILE. Traverse the stack up to a maximum of N levels. If N is -1, the whole stack is dumped. New levels are created when the dominator tree traversal used for renaming enters a new sub-tree.
References block_defs_stack, DECL_P, i, is_gimple_reg(), NULL_TREE, print_generic_expr(), and SSA_NAME_VAR.
Referenced by debug_defs_stack(), and dump_tree_ssa().
|
extern |
Dump all the names replaced by NAME to FILE.
References EXECUTE_IF_SET_IN_BITMAP, i, names_replaced_by(), print_generic_expr(), and ssa_name.
Referenced by debug_names_replaced_by(), and dump_update_ssa().
|
extern |
Dump SSA information to FILE.
References current_function_decl, lang_hooks::decl_printable_name, dump_currdefs(), dump_defs_stack(), dump_tree_ssa_stats(), and dump_var_infos().
Referenced by debug_tree_ssa().
|
extern |
Dump SSA statistics on FILE.
References htab_statistics(), and var_infos.
Referenced by debug_tree_ssa_stats(), dump_tree_ssa(), and rewrite_blocks().
|
extern |
Dump SSA update information to FILE.
References bitmap_empty_p(), cfun, dump_decl_set(), dump_names_replaced_by(), EXECUTE_IF_SET_IN_BITMAP, i, names_to_release, need_ssa_update_p(), new_ssa_names, print_generic_expr(), ssa_name, and symbols_to_rename_set.
Referenced by debug_update_ssa(), and update_ssa().
|
extern |
Dump the VAR_INFOS hash table on FILE.
References debug_var_infos_r(), and var_infos.
Referenced by debug_var_infos(), and dump_tree_ssa().
Header file for normal form into SSA. Copyright (C) 2013-2024 Free Software Foundation, Inc. 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/>.
Return the current definition for VAR.
References common_info::current_def, and get_common_info().
Referenced by copy_loop_before(), maybe_add_asan_poison_write(), rename_use_op(), and vect_loop_versioning().
void mark_virtual_operand_for_renaming | ( | tree | name | ) |
Replace all uses of NAME by underlying variable and mark it for renaming. This assumes the defining statement of NAME is going to be removed.
References cfun, FOR_EACH_IMM_USE_ON_STMT, FOR_EACH_IMM_USE_STMT, gcc_assert, mark_virtual_operands_for_renaming(), SET_USE, SSA_NAME_VAR, and VAR_DECL_IS_VIRTUAL_OPERAND.
Referenced by destroy_loop(), mark_virtual_phi_result_for_renaming(), release_last_vdef(), and sink_clobbers().
void mark_virtual_operands_for_renaming | ( | struct function * | fn | ) |
Mark virtual operands of FN for renaming by update_ssa.
References function::gimple_df, gimple_df::rename_vops, and gimple_df::ssa_renaming_needed.
Referenced by loop_distribution::execute(), execute_oacc_device_lower(), gimple_lower_bitint(), mark_virtual_operand_for_renaming(), tail_merge_optimize(), and tree_optimize_tail_calls_1().
void mark_virtual_phi_result_for_renaming | ( | gphi * | phi | ) |
Replace all uses of the virtual PHI result by its underlying variable and mark it for renaming. This assumes the PHI node is going to be removed.
References dump_file, dump_flags, gimple_phi_result(), mark_virtual_operand_for_renaming(), print_gimple_stmt(), TDF_DETAILS, and TDF_SLIM.
Referenced by destroy_loop(), eliminate_unnecessary_stmts(), release_last_vdef(), and split_function().
Return true if name N has been registered in the replacement table.
References cfun, gcc_assert, is_new_name(), is_old_name(), and update_ssa_initialized_fn.
Referenced by follow_copies_to_constant(), get_range_strlen(), gimple_can_merge_blocks_p(), insert_debug_temp_for_var_def(), integer_valued_real_single_p(), release_ssa_name_fn(), tree_single_nonnegative_warnv_p(), and walk_ssa_copies().
Return true if there is any work to be done by update_ssa for function FN.
References gcc_assert, function::gimple_df, NULL, gimple_df::ssa_renaming_needed, and update_ssa_initialized_fn.
Referenced by canonicalize_induction_variables(), compute_may_aliases(), dump_update_ssa(), execute_function_todo(), execute_todo(), gimple_duplicate_sese_tail(), loop_invariant_motion_in_fun(), update_ssa(), vect_do_peeling(), vect_transform_loops(), verify_loop_closed_ssa(), and verify_ssa().
void release_ssa_name_after_update_ssa | ( | tree | name | ) |
Mark NAME to be released after update_ssa has finished.
References BITMAP_ALLOC, bitmap_set_bit, cfun, gcc_assert, names_to_release, NULL, SSA_NAME_VERSION, and update_ssa_initialized_fn.
Referenced by release_ssa_name_fn().
Sets current definition of VAR to DEF.
References common_info::current_def, and get_common_info().
void update_ssa | ( | unsigned | update_flags | ) |
Given a set of newly created SSA names (NEW_SSA_NAMES) and a set of existing SSA names (OLD_SSA_NAMES), update the SSA form so that: 1- The names in OLD_SSA_NAMES dominated by the definitions of NEW_SSA_NAMES are all re-written to be reached by the appropriate definition from NEW_SSA_NAMES. 2- If needed, new PHI nodes are added to the iterated dominance frontier of the blocks where each of NEW_SSA_NAMES are defined. The mapping between OLD_SSA_NAMES and NEW_SSA_NAMES is setup by calling create_new_def_for to create new defs for names that the caller wants to replace. The caller cretaes the new names to be inserted and the names that need to be replaced by calling create_new_def_for for each old definition to be replaced. Note that the function assumes that the new defining statement has already been inserted in the IL. For instance, given the following code: 1 L0: 2 x_1 = PHI (0, x_5) 3 if (x_1 < 10) 4 if (x_1 > 7) 5 y_2 = 0 6 else 7 y_3 = x_1 + x_7 8 endif 9 x_5 = x_1 + 1 10 goto L0; 11 endif Suppose that we insert new names x_10 and x_11 (lines 4 and 8). 1 L0: 2 x_1 = PHI (0, x_5) 3 if (x_1 < 10) 4 x_10 = ... 5 if (x_1 > 7) 6 y_2 = 0 7 else 8 x_11 = ... 9 y_3 = x_1 + x_7 10 endif 11 x_5 = x_1 + 1 12 goto L0; 13 endif We want to replace all the uses of x_1 with the new definitions of x_10 and x_11. Note that the only uses that should be replaced are those at lines 5, 9 and 11. Also, the use of x_7 at line 9 should *not* be replaced (this is why we cannot just mark symbol 'x' for renaming). Additionally, we may need to insert a PHI node at line 11 because that is a merge point for x_10 and x_11. So the use of x_1 at line 11 will be replaced with the new PHI node. The insertion of PHI nodes is optional. They are not strictly necessary to preserve the SSA form, and depending on what the caller inserted, they may not even be useful for the optimizers. UPDATE_FLAGS controls various aspects of how update_ssa operates, see the documentation for TODO_update_ssa*.
References BITMAP_ALLOC, bitmap_clear(), bitmap_default_obstack, bitmap_empty_p(), bitmap_initialize(), bitmap_list_view(), bitmap_tree_view(), blocks_to_update, blocks_with_phis_to_rewrite, calculate_dominance_info(), CDI_DOMINATORS, cfun, compute_dominance_frontiers(), common_info::current_def, debug_gimple_stmt(), delete_update_ssa(), dom_info_state(), DOM_NONE, dump_file, dump_flags, dump_update_ssa(), ENTRY_BLOCK_PTR_FOR_FN, error(), EXECUTE_IF_SET_IN_BITMAP, FOR_EACH_BB_FN, FOR_EACH_SSA_NAME, FOR_EACH_SSA_USE_OPERAND, FOR_EACH_VEC_ELT, free(), gcc_assert, get_ssa_name_ann(), get_var_info(), gsi_end_p(), gsi_next(), gsi_start_bb(), gsi_stmt(), i, basic_block_def::index, ssa_name_info::info, var_info::info, init_update_ssa(), insert_updated_phi_nodes_compare_uids(), insert_updated_phi_nodes_for(), internal_error(), iterating_old_ssa_names, last_basic_block_for_fn, marked_for_renaming(), nearest_common_dominator_for_set(), need_ssa_update_p(), new_ssa_names, NULL, NULL_TREE, old_ssa_names, PERCENT, prepare_block_for_update(), prepare_names_to_update(), print_generic_expr(), rewrite_blocks(), REWRITE_UPDATE, REWRITE_UPDATE_REGION, ssa_name, SSA_NAME_IN_FREE_LIST, SSA_NAME_VAR, SSA_OP_ALL_USES, statistics_counter_event(), symbols_to_rename, TDF_DETAILS, TDF_SLIM, timevar_pop(), timevar_push(), TODO_update_ssa, TODO_update_ssa_full_phi, TODO_update_ssa_no_phi, TODO_update_ssa_only_virtuals, TREE_CODE, update_ssa_initialized_fn, USE_FROM_PTR, var_infos, and virtual_operand_p().
Referenced by autofdo::afdo_annotate_cfg(), autofdo::afdo_vpt_for_early_inline(), cleanup_tree_cfg_noloop(), compute_fn_summary(), autofdo::early_inline(), execute_function_todo(), execute_update_addresses_taken(), cgraph_node::expand(), expand_ifn_va_arg_1(), expand_omp_taskreg(), expand_thunk(), gen_parallel_loop(), cgraph_node::get_body(), ipa_tm_transform_clone(), ipa_tm_transform_transaction(), rewrite_into_loop_closed_ssa_1(), simd_clone_adjust(), tree_function_versioning(), tree_profiling(), tree_transform_and_unroll_loop(), tree_unroll_loops_completely(), tree_unswitch_single_loop(), vect_loop_versioning(), version_loop_by_alias_check(), and version_loop_for_if_conversion().
|
extern |
Set of SSA names that have been marked to be released after they were registered in the replacement table. They will be finally released after we finish updating the SSA web.
Referenced by delete_update_ssa(), dump_update_ssa(), init_update_ssa(), prepare_def_site_for(), prepare_names_to_update(), release_ssa_name_after_update_ssa(), and verify_ssaname_freelists().