GCC Middle and Back End API Reference
|
#include "config.h"
#include "system.h"
#include "coretypes.h"
#include "backend.h"
#include "hard-reg-set.h"
#include "tree.h"
#include "cfghooks.h"
#include "df.h"
#include "cfganal.h"
#include "cfgloop.h"
#include "dumpfile.h"
#include "cfg-flags.def"
Macros | |
#define | DEF_EDGE_FLAG(NAME, IDX) |
#define | DEF_BASIC_BLOCK_FLAG(NAME, IDX) |
Typedefs | |
typedef hash_map< int_hash< int, -1, -2 >, int > | copy_map_t |
Variables | |
static struct obstack | block_aux_obstack |
static void * | first_block_aux_obj = 0 |
static struct obstack | edge_aux_obstack |
static void * | first_edge_aux_obj = 0 |
static copy_map_t * | bb_original |
static copy_map_t * | bb_copy |
static copy_map_t * | loop_copy |
#define DEF_BASIC_BLOCK_FLAG | ( | NAME, | |
IDX ) |
#define DEF_EDGE_FLAG | ( | NAME, | |
IDX ) |
typedef hash_map<int_hash<int, -1, -2>, int> copy_map_t |
Data structures used to maintain mapping between basic blocks and copies.
|
static |
Allocate a memory block of SIZE as BB->aux. The obstack must be first initialized by alloc_aux_for_blocks.
References basic_block_def::aux, block_aux_obstack, first_block_aux_obj, and gcc_assert.
Referenced by alloc_aux_for_blocks().
void alloc_aux_for_blocks | ( | int | size | ) |
Initialize the block_aux_obstack and if SIZE is nonzero, call alloc_aux_for_block for each basic block.
References alloc_aux_for_block(), block_aux_obstack, cfun, first_block_aux_obj, FOR_ALL_BB_FN, gcc_assert, gcc_obstack_init, and initialized.
Referenced by compute_branch_probabilities(), estimate_bb_frequencies(), init_pre(), init_worklist(), one_code_hoisting_pass(), sanopt_optimize(), and vt_initialize().
void alloc_aux_for_edge | ( | edge | e, |
int | size ) |
Allocate a memory edge of SIZE as E->aux. The obstack must be first initialized by alloc_aux_for_edges.
References edge_aux_obstack, first_edge_aux_obj, and gcc_assert.
Referenced by alloc_aux_for_edges().
void alloc_aux_for_edges | ( | int | size | ) |
Initialize the edge_aux_obstack and if SIZE is nonzero, call alloc_aux_for_edge for each basic edge.
References alloc_aux_for_edge(), cfun, edge_aux_obstack, ENTRY_BLOCK_PTR_FOR_FN, EXIT_BLOCK_PTR_FOR_FN, first_edge_aux_obj, FOR_BB_BETWEEN, FOR_EACH_EDGE, gcc_assert, gcc_obstack_init, initialized, and basic_block_def::succs.
Referenced by branch_prob(), and estimate_bb_frequencies().
basic_block alloc_block | ( | void | ) |
Allocate memory for basic_block.
References basic_block_def::count, ggc_cleared_alloc(), and profile_count::uninitialized().
Referenced by create_basic_block_structure(), create_bb(), init_flow(), make_new_block(), and function_reader::parse_block().
void brief_dump_cfg | ( | FILE * | file, |
dump_flags_t | flags ) |
Dumps a brief description of cfg to FILE.
References cfun, dump_bb_info(), FOR_EACH_BB_FN, and TDF_DETAILS.
Referenced by gimple_dump_cfg().
edge cached_make_edge | ( | sbitmap | edge_cache, |
basic_block | src, | ||
basic_block | dst, | ||
int | flags ) |
Create an edge connecting SRC and DST with FLAGS optionally using edge cache CACHE. Return the new edge, NULL if already exist.
References bitmap_bit_p, bitmap_set_bit, cfun, ENTRY_BLOCK_PTR_FOR_FN, EXIT_BLOCK_PTR_FOR_FN, find_edge(), basic_block_def::index, make_edge(), NULL, and unchecked_make_edge().
Referenced by make_edges(), and make_label_edge().
|
static |
Check the consistency of profile information. We can't do that in verify_flow_info, as the counts may get invalid for incompletely solved graphs, later eliminating of conditionals or roundoff errors. It is still practical to have them reported for debugging of simple testcases.
References alloca, profile_probability::always(), BB_PARTITION, basic_block_def::count, current_function_decl, DECL_STRUCT_FUNCTION, profile_count::differs_from_p(), profile_probability::differs_from_p(), profile_count::dump(), profile_probability::dump(), ENTRY_BLOCK_PTR_FOR_FN, EXIT_BLOCK_PTR_FOR_FN, FOR_EACH_EDGE, profile_probability::never(), basic_block_def::preds, probably_never_executed_bb_p(), probably_never_executed_edge_p(), PROFILE_ABSENT, profile_status_for_fn, REG_BR_PROB_BASE, basic_block_def::succs, profile_probability::to_reg_br_prob_base(), and profile_count::zero().
Referenced by dump_bb_info().
void clear_aux_for_blocks | ( | void | ) |
Clear AUX pointers of all blocks.
References basic_block_def::aux, cfun, FOR_ALL_BB_FN, and NULL.
Referenced by compute_antinout_edge(), compute_available(), find_comparisons(), find_spanning_tree(), free_aux_for_blocks(), get_non_trapping(), gimple_lower_bitint(), if_convert(), reorder_loops(), tree_ssa_split_loops(), and tree_ssa_unswitch_loops().
void clear_aux_for_edges | ( | void | ) |
Clear AUX pointers of all edges.
References cfun, ENTRY_BLOCK_PTR_FOR_FN, EXIT_BLOCK_PTR_FOR_FN, FOR_BB_BETWEEN, FOR_EACH_EDGE, NULL, and basic_block_def::succs.
Referenced by compute_antinout_edge(), compute_available(), compute_laterin(), compute_nearerout(), and free_aux_for_edges().
void clear_bb_flags | ( | void | ) |
Clear all basic block flags that do not have to be preserved.
References BB_FLAGS_TO_PRESERVE, cfun, current_loops, basic_block_def::flags, FOR_ALL_BB_FN, LOOPS_HAVE_MARKED_IRREDUCIBLE_REGIONS, and loops_state_satisfies_p().
Referenced by combine_instructions(), ira(), oacc_loop_discovery(), and try_optimize_cfg().
void compact_blocks | ( | void | ) |
Sequentially order blocks and compact the arrays.
References cfun, df, df_compact_blocks(), ENTRY_BLOCK, ENTRY_BLOCK_PTR_FOR_FN, EXIT_BLOCK, EXIT_BLOCK_PTR_FOR_FN, FOR_EACH_BB_FN, gcc_assert, i, basic_block_def::index, last_basic_block_for_fn, n_basic_blocks_for_fn, NULL, NUM_FIXED_BLOCKS, and SET_BASIC_BLOCK_FOR_FN.
Referenced by cgraph_node::analyze(), branch_prob(), cleanup_cfg(), cleanup_tree_cfg_noloop(), and relink_block_chain().
|
inlinestatic |
Connect E to E->dest.
References df_mark_solutions_dirty(), EDGE_COUNT, basic_block_def::preds, and vec_safe_push().
Referenced by redirect_edge_succ(), and unchecked_make_edge().
|
inlinestatic |
Connect E to E->src.
References df_mark_solutions_dirty(), and vec_safe_push().
Referenced by redirect_edge_pred(), and unchecked_make_edge().
|
static |
Removes the value associated with OBJ from table TAB.
References original_copy_tables_initialized_p(), and hash_map< KeyId, Value, Traits >::remove().
Referenced by set_loop_copy().
|
static |
Sets the value associated with OBJ in table TAB to VAL. Do nothing when data structures are not initialized.
References original_copy_tables_initialized_p(), and hash_map< KeyId, Value, Traits >::put().
Referenced by set_bb_copy(), set_bb_original(), and set_loop_copy().
DEBUG_FUNCTION void debug | ( | edge_def & | ref | ) |
References edge_def::dest, dump_edge_info(), basic_block_def::index, edge_def::src, and TDF_DETAILS.
DEBUG_FUNCTION void debug | ( | edge_def * | ptr | ) |
References debug.
DEBUG_FUNCTION void debug_bb | ( | basic_block | bb | ) |
References debug_bb(), and dump_flags.
Referenced by debug_bb(), debug_bb_n(), debug_bb_n(), and debug_bb_slim().
DEBUG_FUNCTION void debug_bb | ( | basic_block | bb, |
dump_flags_t | flags ) |
Print BB with specified FLAGS.
References dump_bb().
DEBUG_FUNCTION basic_block debug_bb_n | ( | int | n | ) |
References BASIC_BLOCK_FOR_FN, cfun, and debug_bb().
DEBUG_FUNCTION basic_block debug_bb_n | ( | int | n, |
dump_flags_t | flags ) |
Print basic block numbered N with specified FLAGS.
References BASIC_BLOCK_FOR_FN, cfun, and debug_bb().
|
static |
Referenced by debug_helper(), debug_helper(), and debug_helper().
|
inlinestatic |
Disconnect edge E from E->dest.
References df_mark_solutions_dirty(), EDGE_COUNT, EDGE_PRED, and basic_block_def::preds.
Referenced by redirect_edge_succ(), and remove_edge_raw().
|
inlinestatic |
Disconnect edge E from E->src.
References df_mark_solutions_dirty(), ei_next(), ei_safe_edge(), ei_start, gcc_unreachable, edge_iterator::index, and basic_block_def::succs.
Referenced by redirect_edge_pred(), and remove_edge_raw().
void dump_bb_info | ( | FILE * | outf, |
basic_block | bb, | ||
int | indent, | ||
dump_flags_t | flags, | ||
bool | do_header, | ||
bool | do_footer ) |
Dumps cfg related information about basic block BB to OUTF. If HEADER is true, dump things that appear before the instructions contained in BB. If FOOTER is true, dump things that appear after. Flags are the TDF_* masks as documented in dumpfile.h. NB: With TDF_DETAILS, it is assumed that cfun is available, so that maybe_hot_bb_p and probably_never_executed_bb_p don't ICE.
Flags on basic blocks and edges. Copyright (C) 2012-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/>.
This file defines flags that may appear on basic blocks or on edges. Source files define DEF_BASIC_BLOCK_FLAG or DEF_EDGE_FLAG appropriately before including this file.
Masks for basic_block.flags. The format of this file is: DEF_BASIC_BLOCK_FLAG(NAME, IDX). NAME is the name of the basic block flag. A flag BB_#NAME will be created and the name is used in dump_edge_info. IDX is a sequence number that is used to determine the value of the flag, which is 1 << IDX). BB_HOT_PARTITION and BB_COLD_PARTITION should be preserved throughout the compilation, so they are never cleared. All other flags may be cleared by clear_bb_flags(). It is generally a bad idea to rely on any flags being up-to-date.
Only set on blocks that have just been created by create_bb.
Set by find_unreachable_blocks. Do not rely on this being set in any pass.
Set for blocks in an irreducible loop by loop analysis.
Set on blocks that may actually not be single-entry single-exit block.
Set on basic blocks that the scheduler should not touch. This is used by SMS to prevent other schedulers from messing with the loop schedule.
Set on blocks that should be put in a hot section.
Set on blocks that should be put in a cold section.
Set on block that was duplicated.
Set if the label at the top of this block is the target of a non-local goto.
Set on blocks that are in RTL format.
Set on blocks that are forwarder blocks. Only used in cfgcleanup.cc.
Set on blocks that cannot be threaded through. Only used for jump threading.
Set on blocks that were modified in some way. This bit is set in df_set_bb_dirty, but not cleared by df_analyze, so it can be used to test whether a block has been modified prior to a df_analyze call.
A general visited flag for passes to use.
Set on blocks that are in a transaction. This is calculated on demand, and is available after calling compute_transaction_bits().
References alloca, BB_ALL_FLAGS, bb_loop_depth(), cfun, check_bb_profile(), basic_block_def::count, current_function_decl, DECL_STRUCT_FUNCTION, profile_count::dump(), dump_edge_info(), basic_block_def::flags, FOR_EACH_EDGE, fputc(), gcc_assert, i, basic_block_def::index, profile_count::initialized_p(), maybe_hot_bb_p(), basic_block_def::next_bb, NULL, basic_block_def::preds, basic_block_def::prev_bb, probably_never_executed_bb_p(), basic_block_def::succs, and TDF_DETAILS.
Referenced by brief_dump_cfg(), dump_bb(), and print_rtl_with_bb().
void dump_edge_info | ( | FILE * | file, |
edge | e, | ||
dump_flags_t | flags, | ||
int | do_succ ) |
Flags on basic blocks and edges. Copyright (C) 2012-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/>.
This file defines flags that may appear on basic blocks or on edges. Source files define DEF_BASIC_BLOCK_FLAG or DEF_EDGE_FLAG appropriately before including this file.
Masks for edge.flags. The format of this file is: DEF_EDGE_FLAG(NAME, IDX, STRING). NAME is the name of the edge flag. A flag EDGE_#NAME will be created and the name is used in dump_edge_info. IDX is a sequence number that is used to determine the value of the flag, which is 1 << IDX).
'Straight line' flow. In GIMPLE and in cfglayout mode, all normal edges are fallthru edges. In cfgrtl mode, this flag really means that control flow falls through to the next basic block in the line.
Strange flow, like a computed jump or exception handling. Usually this means that the edge cannot be split.
Edge out of a basic block that ends with a CALL_INSN with abnormal exit, like an exception or a non-local goto. ABNORMAL_CALL edges also have ABNORMAL set. This flag is only used for the RTL CFG.
Exception edge. Exception handling edges represent possible control transfers from a trapping instruction to an exception handler. EH edges also have ABNORMAL set for the RTL CFG.
Never merge blocks via this edge. This is used for exception handling, to prevent merging away edges to the post-landing-pad basic block. This flag is only used for the RTL CFG.
Not a real edge. This is used to connect parts of the CFG that do not halt, such as infinite loops and noreturn functions, to the EXIT_BLOCK, so that traversing of the reverse CFG is possible.
A back edge, marked in a depth-first search of the CFG. Back edges are hints that this edge may be part of a loop in the CFG.
Edge in a part of the CFG that is an irreducible loop.
Edge taken when controlling predicate is nonzero. This is only used for the GIMPLE CFG.
Edge taken when controlling predicate is zero. This is only used for the GIMPLE CFG.
Edge is executable. This is only used in GIMPLE SSA-CCP and VRP. This is only used for the GIMPLE CFG.
Edge crosses between hot and cold sections, when we do partitioning. This flag is only used for the RTL CFG.
Edge from a sibcall CALL_INSN to exit. SIBCALL edges also have ABNORMAL set. This flag is only used for the RTL CFG.
Candidate for straight line flow. Only used in bb-reorder.cc. This flag is only used for the RTL CFG.
Exit of a loop. This is only used in ifcvt.cc. This flag is only used for the RTL CFG.
Uninstrumented edge out of a GIMPLE_TRANSACTION statement.
Abort (over) edge out of a GIMPLE_TRANSACTION statement.
An edge we should ignore. It should be entirely local to passes. ie, it is never set on any edge upon the completion of any pass.
References BUILTINS_LOCATION, cfun, EDGE_ALL_FLAGS, ENTRY_BLOCK, EXIT_BLOCK, fputc(), gcc_assert, i, basic_block_def::index, LOCATION_COLUMN, LOCATION_FILE, LOCATION_LINE, LOCATION_LOCUS, NULL, TDF_DETAILS, and TDF_SLIM.
Referenced by debug(), dump_basic_block_info(), dump_bb_info(), and verify_flow_info().
void expunge_block | ( | basic_block | b | ) |
Remove block B from the basic block array.
References b, cfun, n_basic_blocks_for_fn, NULL, SET_BASIC_BLOCK_FOR_FN, and unlink_block().
Referenced by delete_basic_block(), and merge_blocks().
void free_aux_for_blocks | ( | void | ) |
Free data allocated in block_aux_obstack and clear AUX pointers of all blocks.
References block_aux_obstack, clear_aux_for_blocks(), first_block_aux_obj, gcc_assert, and NULL.
Referenced by compute_branch_probabilities(), delete_worklist(), estimate_bb_frequencies(), fini_pre(), one_code_hoisting_pass(), sanopt_optimize(), and vt_finalize().
void free_aux_for_edges | ( | void | ) |
Free data allocated in edge_aux_obstack and clear AUX pointers of all edges.
References clear_aux_for_edges(), edge_aux_obstack, first_edge_aux_obj, gcc_assert, and NULL.
Referenced by branch_prob(), and estimate_bb_frequencies().
|
static |
Free basic block BB.
References ggc_free(), NULL, basic_block_def::preds, basic_block_def::succs, and vec_free().
Referenced by free_cfg().
void free_cfg | ( | struct function * | fn | ) |
Free the memory associated with the CFG in FN.
References basic_block_info_for_fn, function::cfg, ENTRY_BLOCK_PTR_FOR_FN, FOR_EACH_EDGE, free_block(), free_edge(), gcc_assert, ggc_free(), n_edges_for_fn, basic_block_def::next_bb, NULL, vec_free(), control_flow_graph::x_dom_computed, and control_flow_graph::x_label_to_block_map.
Referenced by release_function_body().
Helper function for remove_edge and free_cffg. Frees edge structure without actually removing it from the pred/succ arrays.
References ggc_free(), and n_edges_for_fn.
Referenced by free_cfg(), and remove_edge_raw().
void free_original_copy_tables | ( | void | ) |
Free the data structures to maintain mapping between blocks and its copies.
References bb_copy, bb_original, loop_copy, and NULL.
Referenced by copy_loop_before(), do_split_loop_on_cond(), back_jt_path_registry::duplicate_thread_path(), gen_parallel_loop(), gimple_duplicate_seme_region(), gimple_duplicate_sese_tail(), gimple_ssa_isolate_erroneous_paths(), ipa_tm_execute(), relink_block_chain(), split_loop(), split_paths(), tail_duplicate(), tree_loop_unroll_and_jam(), tree_predictive_commoning(), tree_ssa_prefetch_arrays(), tree_unswitch_single_loop(), try_peel_loop(), try_unroll_loop_completely(), fwd_jt_path_registry::update_cfg(), vect_do_peeling(), vect_loop_versioning(), version_loop_by_alias_check(), and version_loop_for_if_conversion().
basic_block get_bb_copy | ( | basic_block | bb | ) |
Get the copy of basic block.
References BASIC_BLOCK_FOR_FN, bb_copy, cfun, gcc_assert, hash_map< KeyId, Value, Traits >::get(), basic_block_def::index, NULL, and original_copy_tables_initialized_p().
Referenced by apply_opt_in_copies(), copy_bbs(), do_split_loop_on_cond(), back_jt_path_registry::duplicate_thread_path(), fix_loop_bb_probability(), gimple_duplicate_seme_region(), gimple_duplicate_sese_tail(), loop_version(), back_jt_path_registry::rewire_first_differing_edge(), slpeel_tree_duplicate_loop_to_edge_cfg(), split_loop(), unroll_loop_constant_iterations(), and unroll_loop_runtime_iterations().
basic_block get_bb_original | ( | basic_block | bb | ) |
Get the original basic block.
References BASIC_BLOCK_FOR_FN, bb_original, cfun, gcc_assert, hash_map< KeyId, Value, Traits >::get(), basic_block_def::index, NULL, and original_copy_tables_initialized_p().
Referenced by add_phi_args_after_copy_edge(), apply_opt_in_copies(), back_jt_path_registry::duplicate_thread_path(), gimple_duplicate_seme_region(), gimple_duplicate_sese_tail(), relink_block_chain(), tree_unswitch_single_loop(), and vect_do_peeling().
Get the copy of LOOP.
References cfun, gcc_assert, hash_map< KeyId, Value, Traits >::get(), get_loop(), loop_copy, NULL, loop::num, and original_copy_tables_initialized_p().
Referenced by duplicate_block(), slpeel_tree_duplicate_loop_to_edge_cfg(), vect_do_peeling(), and vect_loop_versioning().
void init_flow | ( | struct function * | the_fun | ) |
Control flow graph manipulation code for GNU compiler. Copyright (C) 1987-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/>.
This file contains low level functions to manipulate the CFG and analyze it. All other modules should not transform the data structure directly and use abstraction instead. The file is supposed to be ordered bottom-up and should not contain any code dependent on a particular intermediate language (RTL or trees). Available functionality: - Initialization/deallocation init_flow, free_cfg - Low level basic block manipulation alloc_block, expunge_block - Edge manipulation make_edge, make_single_succ_edge, cached_make_edge, remove_edge - Low level edge redirection (without updating instruction chain) redirect_edge_succ, redirect_edge_succ_nodup, redirect_edge_pred - Dumping and debugging dump_flow_info, debug_flow_info, dump_edge_info - Allocation of AUX fields for basic blocks alloc_aux_for_blocks, free_aux_for_blocks, alloc_aux_for_block - clear_bb_flags - Consistency checking verify_flow_info - Dumping and debugging print_rtl_with_bb, dump_bb, debug_bb, debug_bb_n TODO: Document these "Available functionality" functions in the files that implement them.
Called once at initialization time.
References alloc_block(), BB_ALL_FLAGS, control_flow_graph::bb_flags_allocated, function::cfg, control_flow_graph::count_max, EDGE_ALL_FLAGS, control_flow_graph::edge_flags_allocated, ENTRY_BLOCK, ENTRY_BLOCK_PTR_FOR_FN, EXIT_BLOCK, EXIT_BLOCK_PTR_FOR_FN, control_flow_graph::full_profile, ggc_cleared_alloc(), n_edges_for_fn, and profile_count::uninitialized().
Referenced by init_empty_tree_cfg_for_function().
void initialize_original_copy_tables | ( | void | ) |
Initialize the data structures to maintain mapping between blocks and its copies.
References bb_copy, bb_original, and loop_copy.
Referenced by cfg_layout_initialize(), copy_loop_before(), do_split_loop_on_cond(), back_jt_path_registry::duplicate_thread_path(), gen_parallel_loop(), gimple_duplicate_seme_region(), gimple_duplicate_sese_tail(), gimple_ssa_isolate_erroneous_paths(), ipa_tm_execute(), relink_block_chain(), split_loop(), split_paths(), tail_duplicate(), tree_loop_unroll_and_jam(), tree_predictive_commoning(), tree_ssa_prefetch_arrays(), tree_unswitch_single_loop(), try_peel_loop(), try_unroll_loop_completely(), fwd_jt_path_registry::update_cfg(), vect_do_peeling(), vect_loop_versioning(), version_loop_by_alias_check(), and version_loop_for_if_conversion().
void link_block | ( | basic_block | b, |
basic_block | after ) |
Link block B to chain after AFTER.
References b, basic_block_def::next_bb, and basic_block_def::prev_bb.
Referenced by create_basic_block_structure(), create_bb(), gimple_find_sub_bbs(), gimple_move_block_after(), merge_blocks_move_predecessor_nojumps(), and function_reader::parse_block().
edge make_edge | ( | basic_block | src, |
basic_block | dest, | ||
int | flags ) |
Create an edge connecting SRC and DEST with flags FLAGS. Return newly created edge or NULL if already exist.
References find_edge(), NULL, and unchecked_make_edge().
Referenced by add_test(), branch_fixup(), branch_prob(), cached_make_edge(), cfg_layout_split_edge(), rt_bb_visited::check(), combine_blocks(), connect_infinite_loops_to_exit(), connect_loops(), convert_if_conditions_to_switch(), copy_cfg_body(), copy_edges_for_bb(), create_cond_insert_point(), create_empty_if_region_on_edge(), create_empty_loop_on_edge(), create_parallel_loop(), tree_switch_conversion::switch_decision_tree::do_jump_if_equal(), do_split_loop_on_cond(), back_jt_path_registry::duplicate_thread_path(), edge_before_returns_twice_call(), tree_switch_conversion::bit_test_cluster::emit(), tree_switch_conversion::jump_table_cluster::emit(), tree_switch_conversion::switch_decision_tree::emit_cmp_and_jump_insns(), execute_sm_if_changed(), tree_switch_conversion::switch_conversion::exp_index_transform(), expand_complex_div_wide(), expand_gimple_tailcall(), expand_oacc_for(), expand_omp_atomic_pipeline(), expand_omp_for_generic(), expand_omp_for_init_counts(), expand_omp_for_init_vars(), expand_omp_for_ordered_loops(), expand_omp_for_static_chunk(), expand_omp_for_static_nochunk(), expand_omp_ordered_sink(), expand_omp_sections(), expand_omp_simd(), expand_omp_target(), expand_omp_taskloop_for_inner(), expand_omp_taskloop_for_outer(), expand_omp_taskreg(), expand_parallel_call(), expand_thunk(), expand_transaction(), extract_omp_for_update_vars(), find_bb_boundaries(), force_nonfallthru_and_redirect(), tree_switch_conversion::switch_conversion::gen_inbound_check(), gimple_divmod_fixed_value(), gimple_duplicate_sese_tail(), gimple_flow_call_edges_add(), gimple_gen_ic_func_profiler(), gimple_gen_time_profiler(), gimple_ic(), gimple_lower_bitint(), gimple_mod_pow2(), gimple_mod_subtract(), gimple_stringop_fixed_value(), handle_abnormal_edges(), tree_switch_conversion::bit_test_cluster::hoist_edge_and_branch_if_true(), hoist_guard(), init_lowered_empty_function(), input_cfg(), insert_check_and_trap(), insert_cond_bb(), rt_bb_visited::insert_exit_check_on_edge(), lv_adjust_loop_entry_edge(), make_cond_expr_edges(), make_edges(), make_edges(), make_edges_bb(), make_eh_dispatch_edges(), make_eh_edge(), make_gimple_asm_edges(), make_gimple_switch_edges(), make_goto_expr_edges(), make_single_succ_edge(), move_sese_in_condition(), move_sese_region_to_fn(), oacc_entry_exit_single_gang(), omp_make_gimple_edges(), optimize_mask_stores(), peep2_attempt(), rtl_flow_call_edges_add(), shrink_wrap_one_built_in_call_with_conds(), simd_clone_adjust(), slpeel_add_loop_guard(), split_bb_make_tm_edge(), tree_transform_and_unroll_loop(), ubsan_expand_null_ifn(), ubsan_expand_ptr_ifn(), unloop_loops(), unroll_loop_runtime_iterations(), vect_loop_versioning(), worker_single_copy(), and worker_single_simple().
edge make_single_succ_edge | ( | basic_block | src, |
basic_block | dest, | ||
int | flags ) |
Create an edge connecting SRC to DEST and set probability by knowing that it is the single edge leaving SRC.
References profile_probability::always(), and make_edge().
Referenced by add_noreturn_fake_exit_edges(), combine_blocks(), construct_exit_block(), construct_init_block(), copy_edges_for_bb(), create_cond_insert_point(), create_edge_and_update_destination_phis(), create_eh_forwarder_block(), create_parallel_loop(), dw2_build_landing_pads(), execute_sm_if_changed(), expand_complex_div_wide(), expand_gimple_cond(), expand_thunk(), fix_crossing_conditional_branches(), force_nonfallthru_and_redirect(), gimple_split_edge(), handle_simple_exit(), insert_cond_bb(), lower_resx(), move_sese_region_to_fn(), optimize_mask_stores(), rtl_split_edge(), simd_clone_adjust(), sjlj_emit_dispatch_table(), split_block_1(), split_function(), try_shrink_wrapping(), ubsan_expand_null_ifn(), and ubsan_expand_ptr_ifn().
bool original_copy_tables_initialized_p | ( | void | ) |
Return true iff we have had a call to initialize_original_copy_tables without a corresponding call to free_original_copy_tables.
Referenced by copy_original_table_clear(), copy_original_table_set(), get_bb_copy(), get_bb_original(), get_loop_copy(), and relink_block_chain().
void redirect_edge_pred | ( | edge | e, |
basic_block | new_pred ) |
Redirect an edge's predecessor from one block to another.
References connect_src(), and disconnect_src().
Referenced by destroy_loop(), expand_transaction(), force_nonfallthru_and_redirect(), tree_switch_conversion::bit_test_cluster::hoist_edge_and_branch_if_true(), slpeel_tree_duplicate_loop_to_edge_cfg(), and unsplit_eh().
void redirect_edge_succ | ( | edge | e, |
basic_block | new_succ ) |
Redirect an edge's successor from one block to another.
References connect_dest(), disconnect_dest(), execute_on_growing_pred(), and execute_on_shrinking_pred().
Referenced by cfg_layout_redirect_edge_and_branch(), cleanup_empty_eh_merge_phis(), construct_exit_block(), construct_init_block(), dead_or_predicable(), dw2_fix_up_crossing_landing_pad(), tree_switch_conversion::switch_decision_tree::emit_case_nodes(), tree_switch_conversion::switch_decision_tree::emit_jump(), execute_sm_if_changed(), expand_complex_div_wide(), expand_gimple_cond(), expand_omp_simd(), find_if_case_1(), finish_eh_generation(), fix_crossing_conditional_branches(), gimple_find_sub_bbs(), handle_simple_exit(), redirect_edge_succ_nodup(), rtl_split_edge(), simd_clone_adjust(), sjlj_fix_up_crossing_landing_pad(), try_optimize_cfg(), try_redirect_by_replacing_jump(), and tree_switch_conversion::switch_decision_tree::try_switch_expansion().
void remove_edge_raw | ( | edge | e | ) |
This function will remove an edge from the flow graph.
References cfun, disconnect_dest(), disconnect_src(), execute_on_shrinking_pred(), free_edge(), and remove_predictions_associated_with_edge().
Referenced by remove_edge().
void reset_original_copy_tables | ( | void | ) |
Reset the data structures to maintain mapping between blocks and its copies.
References bb_copy, bb_original, hash_map< KeyId, Value, Traits >::empty(), and loop_copy.
Referenced by vect_do_peeling().
void scale_bbs_frequencies | ( | basic_block * | bbs, |
int | nbbs, | ||
profile_probability | p ) |
Multiply all frequencies of basic blocks in array BBS of length NBBS by NUM/DEN, in profile_count arithmetic. More accurate than previous function but considerably slower.
Referenced by duplicate_loop_body_to_header_edge(), hoist_guard(), scale_loop_frequencies(), and vect_do_peeling().
void scale_bbs_frequencies_profile_count | ( | basic_block * | bbs, |
int | nbbs, | ||
profile_count | num, | ||
profile_count | den ) |
Multiply all frequencies of basic blocks in array BBS of length NBBS by NUM/DEN, in profile_count arithmetic. More accurate than previous function but considerably slower.
References count, i, profile_count::nonzero_p(), and profile_count::zero().
Referenced by duplicate_loop_body_to_header_edge(), back_jt_path_registry::duplicate_thread_path(), and gimple_duplicate_sese_tail().
void scale_strictly_dominated_blocks | ( | basic_block | bb, |
profile_count | num, | ||
profile_count | den ) |
Scales the frequencies of all basic blocks that are strictly dominated by BB by NUM/DEN.
References profile_count::apply_scale(), CDI_DOMINATORS, basic_block_def::count, first_dom_son(), next_dom_son(), profile_count::nonzero_p(), loop::num, worklist, and profile_count::zero().
Referenced by fold_loop_internal_call().
void set_bb_copy | ( | basic_block | bb, |
basic_block | copy ) |
Set copy for basic block. Do nothing when data structures are not initialized so passes not needing this don't need to care.
References bb_copy, copy_original_table_set(), and basic_block_def::index.
Referenced by duplicate_block().
void set_bb_original | ( | basic_block | bb, |
basic_block | original ) |
Set original for basic block. Do nothing when data structures are not initialized so passes not needing this don't need to care.
References bb_original, copy_original_table_set(), and basic_block_def::index.
Referenced by duplicate_block().
void set_edge_probability_and_rescale_others | ( | edge | e, |
profile_probability | new_prob ) |
Set probability of E to NEW_PROB and rescale other edges from E->src so their sum remains the same.
References profile_probability::always(), profile_probability::apply_scale(), dump_file, dump_flags, FOR_EACH_EDGE, profile_probability::guessed(), profile_probability::invert(), profile_probability::never(), NULL, and TDF_DETAILS.
Referenced by force_edge_cold(), scale_profile_for_vect_loop(), tree_transform_and_unroll_loop(), update_bb_profile_for_threading(), update_loop_exit_probability_scale_dom_bbs(), and update_profile_after_ch().
Set copy for LOOP to COPY. Do nothing when data structures are not initialized so passes not needing this don't need to care.
References copy_original_table_clear(), copy_original_table_set(), loop_copy, and loop::num.
Referenced by duplicate_loop(), duplicate_loop_body_to_header_edge(), back_jt_path_registry::duplicate_thread_path(), gimple_duplicate_seme_region(), gimple_duplicate_sese_tail(), loop_version(), fwd_jt_path_registry::thread_block_1(), and fwd_jt_path_registry::thread_through_loop_header().
edge unchecked_make_edge | ( | basic_block | src, |
basic_block | dst, | ||
int | flags ) |
Create an edge connecting SRC and DEST with flags FLAGS. Return newly created edge. Use this only if you are sure that this edge can't possibly already exist.
References cfun, connect_dest(), connect_src(), execute_on_growing_pred(), basic_block_def::flags, ggc_cleared_alloc(), n_edges_for_fn, and profile_probability::uninitialized().
Referenced by cached_make_edge(), function_reader::create_edges(), duplicate_block(), force_nonfallthru_and_redirect(), and make_edge().
void unlink_block | ( | basic_block | b | ) |
Unlink block B from chain.
References b, basic_block_def::next_bb, NULL, and basic_block_def::prev_bb.
Referenced by expunge_block(), gimple_find_sub_bbs(), gimple_move_block_after(), and merge_blocks_move_predecessor_nojumps().
void update_bb_profile_for_threading | ( | basic_block | bb, |
profile_count | count, | ||
edge | taken_edge ) |
An edge originally destinating BB of COUNT has been proved to leave the block by TAKEN_EDGE. Update profile of BB such that edge E can be redirected to destination of TAKEN_EDGE. This function may leave the profile inconsistent in the case TAKEN_EDGE frequency or count is believed to be lower than COUNT respectively.
References profile_count::apply_scale(), profile_probability::apply_scale(), basic_block_def::count, count, profile_probability::dump(), dump_file, gcc_assert, profile_count::guessed(), profile_probability::guessed(), basic_block_def::index, profile_count::initialized_p(), profile_probability::invert(), profile_count::nonzero_p(), set_edge_probability_and_rescale_others(), and profile_count::zero().
Referenced by back_jt_path_registry::duplicate_thread_path(), try_forward_edges(), and update_profile_after_ch().
|
static |
|
static |
|
static |
Simple routines to easily allocate AUX fields of basic blocks.
Referenced by alloc_aux_for_block(), alloc_aux_for_blocks(), and free_aux_for_blocks().
|
static |
Referenced by alloc_aux_for_edge(), alloc_aux_for_edges(), and free_aux_for_edges().
|
static |
Referenced by alloc_aux_for_block(), alloc_aux_for_blocks(), and free_aux_for_blocks().
|
static |
Referenced by alloc_aux_for_edge(), alloc_aux_for_edges(), and free_aux_for_edges().
|
static |
And between loops and copies.
Referenced by free_original_copy_tables(), get_loop_copy(), initialize_original_copy_tables(), reset_original_copy_tables(), and set_loop_copy().