GCC Middle and Back End API Reference
tree-cfg.h File Reference

Go to the source code of this file.


#define PENDING_STMT(e)   ((e)->insns.g)


void gt_ggc_mx (edge_def *e)
void gt_pch_nx (edge_def *e)
void gt_pch_nx (edge_def *e, gt_pointer_operator, void *)
void init_empty_tree_cfg_for_function (struct function *)
void init_empty_tree_cfg (void)
void start_recording_case_labels (void)
void end_recording_case_labels (void)
tree get_cases_for_edge (edge, gswitch *)
basic_block label_to_block (struct function *, tree)
void cleanup_dead_labels (void)
bool group_case_labels_stmt (gswitch *)
bool group_case_labels (void)
void replace_uses_by (tree, tree)
basic_block single_noncomplex_succ (basic_block bb)
void notice_special_calls (gcall *)
void clear_special_calls (void)
edge find_taken_edge (basic_block, tree)
void gimple_debug_bb (basic_block)
basic_block gimple_debug_bb_n (int)
void gimple_debug_cfg (int)
void gimple_dump_cfg (FILE *, dump_flags_t)
void dump_cfg_stats (FILE *)
void debug_cfg_stats (void)
bool computed_goto_p (gimple *)
bool stmt_can_make_abnormal_goto (gimple *)
basic_block get_abnormal_succ_dispatcher (basic_block)
bool is_ctrl_stmt (gimple *)
bool is_ctrl_altering_stmt (gimple *)
bool simple_goto_p (gimple *)
bool stmt_ends_bb_p (gimple *)
bool gimple_seq_unreachable_p (gimple_seq)
bool assert_unreachable_fallthru_edge_p (edge)
void delete_tree_cfg_annotations (function *)
gphiget_virtual_phi (basic_block)
gimplefirst_stmt (basic_block)
gimplelast_nondebug_stmt (basic_block)
gimplelast_and_only_stmt (basic_block)
bool verify_gimple_in_seq (gimple_seq, bool=true)
bool verify_gimple_in_cfg (struct function *, bool, bool=true)
tree gimple_block_label (basic_block)
void add_phi_args_after_copy_bb (basic_block)
void add_phi_args_after_copy (basic_block *, unsigned, edge)
basic_block split_edge_bb_loc (edge)
bool gimple_duplicate_seme_region (edge, edge, basic_block *, unsigned, basic_block *, bool)
bool gimple_duplicate_sese_tail (edge, edge, basic_block *, unsigned, basic_block *)
void gather_blocks_in_sese_region (basic_block entry, basic_block exit, vec< basic_block > *bbs_p)
void verify_sese (basic_block, basic_block, vec< basic_block > *)
bool gather_ssa_name_hash_map_from (tree const &, tree const &, void *)
void fold_loop_internal_call (gimple *, tree)
basic_block move_sese_region_to_fn (struct function *, basic_block, basic_block, tree)
void dump_function_to_file (tree, FILE *, dump_flags_t)
void debug_function (tree, dump_flags_t)
void print_loops_bb (FILE *, basic_block, int, int)
void print_loops (FILE *, int)
void debug (class loop &ref)
void debug (class loop *ptr)
void debug_verbose (class loop &ref)
void debug_verbose (class loop *ptr)
void debug_loops (int)
void debug_loop (class loop *, int)
void debug_loop_num (unsigned, int)
void remove_edge_and_dominated_blocks (edge)
bool gimple_purge_dead_eh_edges (basic_block)
bool gimple_purge_all_dead_eh_edges (const_bitmap)
bool gimple_purge_dead_abnormal_call_edges (basic_block)
bool gimple_purge_all_dead_abnormal_call_edges (const_bitmap)
void extract_true_false_edges_from_block (basic_block, edge *, edge *)
tree find_case_label_for_value (const gswitch *switch_stmt, tree val)
edge find_taken_edge_switch_expr (const gswitch *switch_stmt, tree val)
unsigned int execute_fixup_cfg (void)
unsigned int split_critical_edges (bool for_edge_insertion_p=false)
basic_block insert_cond_bb (basic_block, gimple *, gimple *, profile_probability)
bool gimple_find_sub_bbs (gimple_seq, gimple_stmt_iterator *)
bool extract_true_false_controlled_edges (basic_block, basic_block, edge *, edge *)
void generate_range_test (basic_block bb, tree index, tree low, tree high, tree *lhs, tree *rhs)
basic_block gimple_switch_label_bb (function *, gswitch *, unsigned)
basic_block gimple_switch_default_bb (function *, gswitch *)
edge gimple_switch_edge (function *, gswitch *, unsigned)
edge gimple_switch_default_edge (function *, gswitch *)
bool cond_only_block_p (basic_block)
void copy_phi_arg_into_existing_phi (edge, edge)
bool should_remove_lhs_p (tree lhs)
unsigned int split_edges_for_insertion ()

Macro Definition Documentation


#define PENDING_STMT ( e)    ((e)->insns.g)
Data and Control Flow Analysis for Trees.
   Copyright (C) 2001-2024 Free Software Foundation, Inc.
   Contributed by Diego Novillo <dnovillo@redhat.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
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
Location to track pending stmt for edge insertion.   

Referenced by create_parallel_loop(), eliminate_tail_call(), gimple_duplicate_sese_tail(), gimple_gen_edge_profiler(), gsi_commit_one_edge_insert(), gsi_insert_on_edge(), gsi_insert_on_edge_immediate(), gsi_insert_seq_on_edge(), gsi_insert_seq_on_edge_immediate(), and gsi_start_edge().

Function Documentation

◆ add_phi_args_after_copy()

void add_phi_args_after_copy ( basic_block * region_copy,
unsigned n_region,
edge e_copy )
Blocks in REGION_COPY array of length N_REGION were created by
duplication of basic blocks.  Add phi node arguments for edges
going from these blocks.  If E_COPY is not NULL, also add
phi node arguments for its destination. 

References add_phi_args_after_copy_bb(), add_phi_args_after_copy_edge(), and i.

Referenced by back_jt_path_registry::duplicate_thread_path(), gimple_duplicate_seme_region(), gimple_duplicate_sese_tail(), slpeel_tree_duplicate_loop_to_edge_cfg(), and transform_duplicate().

◆ add_phi_args_after_copy_bb()

void add_phi_args_after_copy_bb ( basic_block bb_copy)
Basic block BB_COPY was created by code duplication.  Add phi node
arguments for edges going out of BB_COPY.  The blocks that were
duplicated have BB_DUPLICATED set.   

References add_phi_args_after_copy_edge(), bb_copy, and FOR_EACH_EDGE.

Referenced by add_phi_args_after_copy(), and copy_phi_node_args().

◆ assert_unreachable_fallthru_edge_p()

bool assert_unreachable_fallthru_edge_p ( edge e)
Returns true for edge E where e->src ends with a GIMPLE_COND and
the other edge points to a bb with just __builtin_unreachable ().
I.e. return true for C->M edge in:
<bb C>:
if (something)
  goto <bb N>;
  goto <bb M>;
<bb N>:
__builtin_unreachable ();
<bb M>:   

References bb_seq(), EDGE_COUNT, EDGE_SUCC, gimple_seq_unreachable_p(), gsi_last_bb(), safe_is_a(), and basic_block_def::succs.

Referenced by dom_opt_dom_walker::set_global_ranges_from_unreachable_edges().

◆ cleanup_dead_labels()

◆ clear_special_calls()

void clear_special_calls ( void )
Clear flags set by notice_special_calls.  Used by dead code removal
to update the flags.   

References cfun.

Referenced by eliminate_unnecessary_stmts().

◆ computed_goto_p()

bool computed_goto_p ( gimple * t)

◆ cond_only_block_p()

bool cond_only_block_p ( basic_block bb)
Return true if the only executable statement in BB is a GIMPLE_COND.   

References gsi_after_labels(), gsi_end_p(), gsi_next(), gsi_stmt(), is_gimple_debug(), and phi_nodes().

Referenced by optimize_spaceship(), and spaceship_replacement().

◆ copy_phi_arg_into_existing_phi()

void copy_phi_arg_into_existing_phi ( edge src_e,
edge tgt_e )
For each PHI in BB, copy the argument associated with SRC_E to TGT_E.
Assuming the argument exists, just does not have a value.   

References gimple_phi_arg_def(), gimple_phi_arg_location(), gimple_phi_arg_set_location(), gsi_end_p(), gsi_next(), gsi_start_phis(), and SET_PHI_ARG_DEF.

Referenced by gimple_duplicate_sese_tail(), remove_forwarder_block(), replace_phi_edge_with_variable(), and ssa_fix_duplicate_block_edges().

◆ debug() [1/2]

void debug ( class loop & ref)
Dump a loop.   

References print_loop().

◆ debug() [2/2]

void debug ( class loop * ptr)

References debug.

◆ debug_cfg_stats()

void debug_cfg_stats ( void )
Dump CFG statistics on stderr.  Keep extern so that it's always
linked in the final executable.   

References dump_cfg_stats().

◆ debug_function()

void debug_function ( tree fn,
dump_flags_t flags )
Dump FUNCTION_DECL FN to stderr using FLAGS (see TDF_* in tree.h)   

References dump_function_to_file().

◆ debug_loop()

void debug_loop ( class loop * loop,
int verbosity )
Print on stderr the code of LOOP, at some VERBOSITY level.   

References print_loop().

Referenced by debug_loop_num().

◆ debug_loop_num()

void debug_loop_num ( unsigned num,
int verbosity )
Print on stderr the code of loop number NUM, at some VERBOSITY

References cfun, debug_loop(), and get_loop().

◆ debug_loops()

void debug_loops ( int verbosity)
Debugging loops structure at tree level, at some VERBOSITY level.   

References print_loops().

◆ debug_verbose() [1/2]

void debug_verbose ( class loop & ref)
Dump a loop verbosely.   

References print_loop().

◆ debug_verbose() [2/2]

void debug_verbose ( class loop * ptr)

References debug.

◆ delete_tree_cfg_annotations()

void delete_tree_cfg_annotations ( struct function * fn)
Remove block annotations and other data structures.   

References label_to_block_map_for_fn, and vec_free().

Referenced by release_function_body().

◆ dump_cfg_stats()

void dump_cfg_stats ( FILE * file)

◆ dump_function_to_file()

void dump_function_to_file ( tree fndecl,
FILE * file,
dump_flags_t flags )
Dump FUNCTION_DECL FN to file FILE using FLAGS (see TDF_* in dumpfile.h)

References a, basic_block_info_for_fn, BIND_EXPR_BODY, function::cfg, basic_block_def::count, function::curr_properties, current_function_decl, function::decl, DECL_ARGUMENTS, DECL_ATTRIBUTES, DECL_BY_REFERENCE, DECL_CHAIN, decl_is_tm_clone(), DECL_RESULT, DECL_SAVED_TREE, DECL_STRUCT_FUNCTION, DECL_UID, dump_bb(), dump_default_def(), dump_eh_tree(), dump_enumerated_decls(), dump_flags, dump_node(), ENTRY_BLOCK_PTR_FOR_FN, FOR_EACH_BB_FN, FOR_EACH_LOCAL_DECL, FOR_EACH_SSA_NAME, function_name(), get_attribute_name(), get_hot_bb_threshold(), gimple_body(), gimple_has_body_p(), gimple_in_ssa_p(), gimple_seq_first_stmt(), gimple_seq_last_stmt(), i, IDENTIFIER_POINTER, profile_count::initialized_p(), function::local_decls, n_basic_blocks_for_fn, NULL, NULL_TREE, PRId64, print_generic_decl(), print_generic_expr(), print_generic_stmt_indented(), print_gimple_seq(), print_no_sanitize_attr_value(), print_omp_context_selector(), PRIu64, profile_info, profile_quality_as_string(), PROP_cfg, PROP_gimple_any, PROP_gimple_lcf, PROP_ssa, profile_count::quality(), ssa_default_def(), SSA_NAME_IDENTIFIER, SSA_NAME_VAR, function::static_chain_decl, TDF_ALIAS, TDF_EH, TDF_ENUMERATE_LOCALS, TDF_GIMPLE, TDF_RAW, TDF_SLIM, TDF_UID, TREE_CHAIN, TREE_CODE, TREE_PURPOSE, TREE_TYPE, TREE_VALUE, TYPE_ATTRIBUTES, profile_count::value(), and vec_safe_is_empty().

Referenced by branch_prob(), debug_body(), debug_function(), dump_function(), ipa_icf::sem_function::dump_to_file(), tree_switch_conversion::switch_decision_tree::emit(), execute_function_dump(), expand_omp_target(), expand_omp_taskreg(), finalize_nesting_tree_1(), gimple_dump_cfg(), cgraph_node::materialize_clone(), oacc_do_neutering(), split_function(), and tail_merge_optimize().

◆ end_recording_case_labels()

void end_recording_case_labels ( void )
Stop recording information mapping edges to case labels and
remove any information we have recorded.   

References BASIC_BLOCK_FOR_FN, BITMAP_FREE, cfun, edge_to_cases, edge_to_cases_cleanup(), EXECUTE_IF_SET_IN_BITMAP, group_case_labels_stmt(), gsi_last_bb(), i, NULL, safe_dyn_cast(), and touched_switch_bbs.

Referenced by cleanup_tree_cfg_noloop(), and split_critical_edges().

◆ execute_fixup_cfg()

unsigned int execute_fixup_cfg ( void )
IPA passes, compilation of earlier functions or inlining
might have changed some properties, such as marked functions nothrow,
pure, const or noreturn.
Remove redundant edges and basic blocks, and create new ones if necessary.  

References profile_count::adjust_for_ipa_scaling(), profile_count::apply_scale(), cfun, compute_function_frequency(), basic_block_def::count, cgraph_node::count, cgraph_node::create_edge(), current_function_decl, current_loops, DECL_EXTERNAL, dyn_cast(), ECF_CONST, ECF_LOOPING_CONST_OR_PURE, ECF_NORETURN, ECF_PURE, EDGE_COUNT, ENTRY_BLOCK_PTR_FOR_FN, EXIT_BLOCK_PTR_FOR_FN, fixup_noreturn_call(), FOR_EACH_BB_FN, cgraph_node::get(), varpool_node::get(), get_base_address(), cgraph_node::get_create(), gimple_build_builtin_unreachable(), gimple_call_flags(), gimple_call_fndecl(), gimple_call_noreturn_p(), gimple_call_set_ctrl_altering(), gimple_call_set_lhs(), gimple_get_lhs(), gimple_in_ssa_p(), gimple_purge_dead_abnormal_call_edges(), gimple_purge_dead_eh_edges(), gsi_end_p(), gsi_insert_after(), gsi_last_bb(), GSI_NEW_STMT, gsi_next(), gsi_start_bb(), gsi_stmt(), profile_count::initialized_p(), is_ctrl_stmt(), is_gimple_call(), last, last_nondebug_stmt(), LOOPS_NEED_FIXUP, loops_state_set(), maybe_clean_eh_stmt(), maybe_remove_writeonly_store(), NULL, simple_dce_from_worklist(), basic_block_def::succs, todo, TODO_cleanup_cfg, TODO_update_ssa, TREE_STATIC, UNKNOWN_LOCATION, update_max_bb_count(), update_stmt(), and VAR_P.

Referenced by autofdo::auto_profile(), execute_cleanup_cfg_post_optimizing(), inline_transform(), and tree_profiling().

◆ extract_true_false_controlled_edges()

bool extract_true_false_controlled_edges ( basic_block dom,
basic_block phiblock,
edge * true_controlled_edge,
edge * false_controlled_edge )
From a controlling predicate in the immediate dominator DOM of
PHIBLOCK determine the edges into PHIBLOCK that are chosen if the
predicate evaluates to true and false and store them to
they are non-NULL.  Returns true if the edges can be determined,
else return false.   

References CDI_DOMINATORS, dominated_by_p(), EDGE_PRED, extract_true_false_edges_from_block(), NULL, and single_pred_p().

Referenced by extract_true_false_args_from_phi(), and vn_phi_eq().

◆ extract_true_false_edges_from_block()

void extract_true_false_edges_from_block ( basic_block b,
edge * true_edge,
edge * false_edge )

◆ find_case_label_for_value()

tree find_case_label_for_value ( const gswitch * switch_stmt,
tree val )
Return the CASE_LABEL_EXPR that SWITCH_STMT will take for VAL.
We can make optimal use here of the fact that the case labels are
sorted: We can do a binary search for a case matching VAL.   

References CASE_HIGH, CASE_LOW, gimple_switch_default_label(), gimple_switch_label(), gimple_switch_num_labels(), i, NULL, and tree_int_cst_compare().

Referenced by find_taken_edge_switch_expr().

◆ find_taken_edge()

edge find_taken_edge ( basic_block bb,
tree val )
Given a basic block BB and a value VAL for use in the final statement
of the block (if a GIMPLE_COND, GIMPLE_SWITCH, or computed goto), return
the edge that will be taken out of the block.
If VAL is NULL_TREE, then the current value of the final statement's
predicate or index is used.
If the value does not match a unique edge, NULL is returned.   

References as_a(), computed_goto_p(), find_taken_edge_computed_goto(), find_taken_edge_cond_expr(), find_taken_edge_switch_expr(), gsi_last_bb(), NULL, single_succ_edge(), single_succ_p(), TREE_CODE, and TREE_OPERAND.

Referenced by check_array_bounds_dom_walker::before_dom_children(), cleanup_control_expr_graph(), copy_prop_visit_cond_stmt(), dom_opt_dom_walker::fold_cond(), fold_marked_statements(), simplify_using_ranges::legacy_fold_cond(), dom_opt_dom_walker::optimize_stmt(), process_bb(), jump_threader::thread_around_empty_blocks(), jump_threader::thread_through_normal_block(), and visit_cond_stmt().

◆ find_taken_edge_switch_expr()

edge find_taken_edge_switch_expr ( const gswitch * switch_stmt,
tree val )
Given SWITCH_STMT and an INTEGER_CST VAL for use as the index, determine
which edge will be taken out of the statement's block.  Return NULL if any
edge may be taken.
If VAL is NULL_TREE, then the current value of SWITCH_STMT's index
is used.   

References CASE_LABEL, cfun, find_case_label_for_value(), find_edge(), gcc_assert, gimple_bb(), gimple_switch_default_label(), gimple_switch_index(), gimple_switch_num_labels(), label_to_block(), NULL, NULL_TREE, and TREE_CODE.

Referenced by find_taken_edge(), and tree_predict_by_opcode().

◆ first_stmt()

◆ fold_loop_internal_call()

◆ gather_blocks_in_sese_region()

void gather_blocks_in_sese_region ( basic_block entry,
basic_block exit,
vec< basic_block > * bbs_p )
Add all the blocks dominated by ENTRY to the array BBS_P.  Stop
adding blocks when the dominator traversal reaches EXIT.  This
function silently assumes that ENTRY strictly dominates EXIT.   

References CDI_DOMINATORS, first_dom_son(), gather_blocks_in_sese_region(), and next_dom_son().

Referenced by eliminate_local_variables(), gather_blocks_in_sese_region(), move_sese_region_to_fn(), and separate_decls_in_region().

◆ gather_ssa_name_hash_map_from()

bool gather_ssa_name_hash_map_from ( tree const & from,
tree const & ,
void * data )
If FROM is an SSA_NAME, mark the version in bitmap DATA.   

References bitmap_set_bit, SSA_NAME_VERSION, and TREE_CODE.

Referenced by move_sese_region_to_fn().

◆ generate_range_test()

void generate_range_test ( basic_block bb,
tree index,
tree low,
tree high,
tree * lhs,
tree * rhs )
Generate a range test LHS CODE RHS that determines whether INDEX is in the
range [low, high].  Place associated stmts before *GSI.   

References const_binop(), fold_convert, gimple_build(), gimple_convert(), gsi_insert_seq_before(), gsi_last_bb(), GSI_SAME_STMT, NULL, range_check_type(), and TREE_TYPE.

Referenced by convert_single_case_switch(), and tree_switch_conversion::switch_decision_tree::emit_case_nodes().

◆ get_abnormal_succ_dispatcher()

basic_block get_abnormal_succ_dispatcher ( basic_block bb)
If basic block BB has an abnormal edge to a basic block
containing IFN_ABNORMAL_DISPATCHER internal call, return
that the dispatcher's basic block, otherwise return NULL.   

References FOR_EACH_EDGE, g, gimple_call_internal_p(), gsi_start_nondebug_after_labels_bb(), gsi_stmt(), NULL, and basic_block_def::succs.

Referenced by copy_cfg_body(), and copy_edges_for_bb().

◆ get_cases_for_edge()

tree get_cases_for_edge ( edge e,
gswitch * t )
If we are inside a {start,end}_recording_cases block, then return
a chain of CASE_LABEL_EXPRs from T which reference E.

Otherwise return NULL.   

References CASE_CHAIN, CASE_LABEL, cfun, edge_to_cases, find_edge(), gimple_switch_label(), gimple_switch_num_labels(), i, label_to_block(), NULL, and recording_case_labels_p().

Referenced by gimple_redirect_edge_and_branch(), and predicate::init_from_control_deps().

◆ get_virtual_phi()

◆ gimple_block_label()

◆ gimple_debug_bb()

void gimple_debug_bb ( basic_block bb)
Dump a basic block on stderr.   

References dump_bb(), TDF_BLOCKS, TDF_MEMSYMS, and TDF_VOPS.

Referenced by gimple_debug_bb_n().

◆ gimple_debug_bb_n()

basic_block gimple_debug_bb_n ( int n)
Dump basic block with index N on stderr.   

References BASIC_BLOCK_FOR_FN, cfun, and gimple_debug_bb().

◆ gimple_debug_cfg()

void gimple_debug_cfg ( int )

◆ gimple_dump_cfg()

void gimple_dump_cfg ( FILE * file,
dump_flags_t flags )
Dump the program showing basic block boundaries on the given FILE.

FLAGS are the same used by the tree dumping functions (see TDF_* in

References brief_dump_cfg(), cfun, current_function_decl, dump_cfg_stats(), dump_function_header(), dump_function_to_file(), last_basic_block_for_fn, n_basic_blocks_for_fn, n_edges_for_fn, TDF_BLOCKS, TDF_DETAILS, and TDF_STATS.

Referenced by compute_branch_probabilities(), gimple_debug_cfg(), and rewrite_out_of_ssa().

◆ gimple_duplicate_seme_region()

bool gimple_duplicate_seme_region ( edge entry,
edge exit,
basic_block * region,
unsigned n_region,
basic_block * region_copy,
bool update_dominance )
Duplicates a REGION (set of N_REGION basic blocks) with just a single
important exit edge EXIT.  By important we mean that no SSA name defined
inside region is live over the other exit edges of the region.  All entry
edges to the region must go to ENTRY->dest.  The edge ENTRY is redirected
to the duplicate of the region.  Dominance and loop information is
updated if UPDATE_DOMINANCE is true, but not the SSA web.  If
UPDATE_DOMINANCE is false then we assume that the caller will update the
dominance information after calling this function.  The new basic
blocks are stored to REGION_COPY in the same order as they had in REGION,
provided that REGION_COPY is not NULL.
The function returns false if it is unable to copy the region,
true otherwise.

It is callers responsibility to update profile.   

References add_phi_args_after_copy(), can_copy_bbs_p(), CDI_DOMINATORS, copy_bbs(), dominated_by_p(), flush_pending_stmts(), free(), free_original_copy_tables(), gcc_assert, get_bb_copy(), get_bb_original(), get_dominated_by_region(), loop::header, i, initialize_original_copy_tables(), iterate_fix_dominators(), loop::latch, loop_outer(), NULL, redirect_edge_and_branch(), set_immediate_dominator(), set_loop_copy(), and split_edge_bb_loc().

◆ gimple_duplicate_sese_tail()

bool gimple_duplicate_sese_tail ( edge entry,
edge exit,
basic_block * region,
unsigned n_region,
basic_block * region_copy )
Duplicates REGION consisting of N_REGION blocks.  The new blocks
  are stored to REGION_COPY in the same order in that they appear
  in REGION, if REGION_COPY is not NULL.  ENTRY is the entry to
  the region, EXIT an exit from it.  The condition guarding EXIT
  is moved to ENTRY.  Returns true if duplication succeeds, false

  For example,

  if (cond)

  is transformed to

  if (cond)

References add_phi_args_after_copy(), as_a(), bb_part_of_region_p(), can_copy_bbs_p(), CDI_DOMINATORS, cfun, copy_bbs(), copy_phi_arg_into_existing_phi(), duplicate_loop(), duplicate_subloops(), EDGE_COUNT, EDGE_SUCC, loop::exits, free(), free_original_copy_tables(), gcc_assert, get_bb_copy(), get_bb_original(), get_dominated_by_region(), gimple_copy(), gsi_insert_after(), gsi_last_bb(), GSI_NEW_STMT, loop::header, i, initialize_original_copy_tables(), profile_count::initialized_p(), loop::inner, iterate_fix_dominators(), loop::latch, make_edge(), need_ssa_update_p(), loop::next, NULL, PENDING_STMT, redirect_edge_and_branch(), rescan_loop_exit(), scale_bbs_frequencies_profile_count(), set_immediate_dominator(), set_loop_copy(), single_succ_edge(), split_edge(), split_edge_bb_loc(), stmt_ends_bb_p(), and profile_count::uninitialized().

Referenced by transform_to_exit_first_loop().

◆ gimple_find_sub_bbs()

bool gimple_find_sub_bbs ( gimple_seq seq,
gimple_stmt_iterator * gsi )
Add SEQ after GSI.  Start new bb after GSI, and created further bbs as
needed.  Returns true if new bbs were created.
Note: This is transitional code, and should not be used for new code.  We
should be able to get rid of this by rewriting all target va-arg
gimplification hooks to use an interface gimple_build_cond_value as described
in https://gcc.gnu.org/ml/gcc-patches/2015-02/msg01194.html.   

References add_bb_to_loop(), cfun, basic_block_def::count, FOR_EACH_EDGE, gcc_assert, gimple_bb(), gsi_stmt(), link_block(), basic_block_def::loop_father, make_blocks_1(), make_edges_bb(), n_basic_blocks_for_fn, basic_block_def::next_bb, NULL, basic_block_def::preds, PROFILE_READ, profile_status_for_fn, redirect_edge_succ(), split_block(), tree_guess_outgoing_edge_probabilities(), unlink_block(), and profile_count::zero().

Referenced by expand_ifn_va_arg_1().

◆ gimple_purge_all_dead_abnormal_call_edges()

bool gimple_purge_all_dead_abnormal_call_edges ( const_bitmap blocks)

◆ gimple_purge_all_dead_eh_edges()

◆ gimple_purge_dead_abnormal_call_edges()

bool gimple_purge_dead_abnormal_call_edges ( basic_block bb)

◆ gimple_purge_dead_eh_edges()

◆ gimple_seq_unreachable_p()

bool gimple_seq_unreachable_p ( gimple_seq stmts)

◆ gimple_switch_default_bb()

basic_block gimple_switch_default_bb ( function * ifun,
gswitch * gs )

◆ gimple_switch_default_edge()

◆ gimple_switch_edge()

◆ gimple_switch_label_bb()

basic_block gimple_switch_label_bb ( function * ifun,
gswitch * gs,
unsigned index )

◆ group_case_labels()

bool group_case_labels ( void )
Look for blocks ending in a multiway branch (a GIMPLE_SWITCH),
and scan the sorted vector of cases.  Combine the ones jumping to the
same label.   

References cfun, changed, FOR_EACH_BB_FN, group_case_labels_stmt(), gsi_last_bb(), and safe_dyn_cast().

Referenced by build_gimple_cfg(), and execute_cleanup_cfg_post_optimizing().

◆ group_case_labels_stmt()

◆ gt_ggc_mx()

◆ gt_pch_nx() [1/2]

◆ gt_pch_nx() [2/2]

◆ init_empty_tree_cfg()

void init_empty_tree_cfg ( void )

◆ init_empty_tree_cfg_for_function()

◆ insert_cond_bb()

basic_block insert_cond_bb ( basic_block bb,
gimple * stmt,
gimple * cond,
profile_probability prob )
Insert COND expression which is GIMPLE_COND after STMT
in basic block BB with appropriate basic block split
and creation of a new conditionally executed basic block.
Update profile so the new bb is visited with probability PROB.
Return created basic block.   

References add_bb_to_loop(), CDI_DOMINATORS, basic_block_def::count, create_empty_bb(), current_loops, dom_info_available_p(), gcc_assert, GSI_CONTINUE_LINKING, gsi_end_p(), gsi_insert_after(), gsi_insert_before(), gsi_last_bb(), basic_block_def::loop_father, make_edge(), make_single_succ_edge(), set_immediate_dominator(), and split_block().

Referenced by expand_complex_multiplication().

◆ is_ctrl_altering_stmt()

bool is_ctrl_altering_stmt ( gimple * t)
Return true if T is a statement that may alter the flow of control
(e.g., a call to a non-returning function).   

References as_a(), CASE_GIMPLE_OMP, cfun, gcc_assert, gimple_asm_nlabels(), gimple_call_ctrl_altering_p(), and stmt_can_throw_internal().

Referenced by expand_complex_move(), instrument_expr(), make_edges_bb(), mark_stmt_if_obviously_necessary(), stmt_ends_bb_p(), vect_schedule_slp_node(), and vect_slp_function().

◆ is_ctrl_stmt()

◆ label_to_block()

basic_block label_to_block ( struct function * ifun,
tree dest )
Return the basic block holding label DEST.   

References BASIC_BLOCK_FOR_FN, function::cfg, cfun, gimple_build_label(), gsi_insert_before(), GSI_NEW_STMT, gsi_start_bb(), LABEL_DECL_UID, NULL, NUM_FIXED_BLOCKS, seen_error(), vec_safe_length(), and control_flow_graph::x_label_to_block_map.

Referenced by tree_switch_conversion::switch_decision_tree::analyze_switch_statement(), associate_equivalences_with_edges(), tree_switch_conversion::switch_conversion::build_constructors(), builtin_setjmp_setup_bb(), clean_up_after_unswitching(), cleanup_control_flow_bb(), cleanup_empty_eh(), convert_single_case_switch(), dump_gimple_switch(), evaluate_control_stmt_using_entry_checks(), execute_early_expand_coro_ifns(), expand_asm_stmt(), expand_case(), find_taken_edge_computed_goto(), back_threader::find_taken_edge_switch(), find_taken_edge_switch_expr(), find_unswitching_predicates_for_bb(), tree_switch_conversion::switch_conversion::gather_default_values(), get_cases_for_edge(), gimple_redirect_edge_and_branch(), gimple_switch_label_bb(), gimple_verify_flow_info(), group_case_labels_stmt(), lower_eh_dispatch(), lower_resx(), main_block_label(), make_cond_expr_edges(), make_edges_bb(), make_eh_dispatch_edges(), make_eh_edge(), make_gimple_asm_edges(), make_goto_expr_edges(), maybe_remove_unreachable_handlers(), record_edge_info(), redirect_eh_dispatch_edge(), simplify_gimple_switch_label_vec(), simplify_using_ranges::simplify_switch_using_ranges(), jump_threader::thread_around_empty_blocks(), jump_threader::thread_through_normal_block(), unsplit_eh(), verify_eh_dispatch_edge(), and verify_eh_edges().

◆ last_and_only_stmt()

gimple * last_and_only_stmt ( basic_block bb)
Return the last statement of an otherwise empty block.  Return NULL
if the block is totally empty, or if it contains more than one

References gsi_end_p(), gsi_last_nondebug_bb(), gsi_prev_nondebug(), gsi_stmt(), i, last, and NULL.

Referenced by cond_store_replacement(), determine_parallel_type(), edge_forwards_cmp_to_conditional_jump_through_empty_bb_p(), is_feasible_trace(), and minmax_replacement().

◆ last_nondebug_stmt()

◆ move_sese_region_to_fn()

basic_block move_sese_region_to_fn ( struct function * dest_cfun,
basic_block entry_bb,
basic_block exit_bb,
tree orig_block )
Move a single-entry, single-exit region delimited by ENTRY_BB and
EXIT_BB to function DEST_CFUN.  The whole region is replaced by a
single basic block in the original CFG and the new basic block is
returned.  DEST_CFUN must not have a CFG yet.

Note that the region need not be a pure SESE region.  Blocks inside
the region may contain calls to abort/exit.  The only restriction
is that ENTRY_BB should be the only entry point and it must
dominate EXIT_BB.

Change TREE_BLOCK of all statements in ORIG_BLOCK to the new
functions outermost BLOCK, move all subblocks of ORIG_BLOCK
to the new function.

All local variables referenced in the region are assumed to be in
the corresponding BLOCK_VARS and unexpanded variable lists
associated with DEST_CFUN.

TODO: investigate whether we can reuse gimple_duplicate_sese_region to
reimplement move_sese_region_to_fn by duplicating the region rather than
moving it.   

References add_bb_to_loop(), loop::aux, BITMAP_ALLOC, BITMAP_FREE, BLOCK_CHAIN, BLOCK_SUBBLOCKS, BLOCK_SUPERCONTEXT, build_int_cst(), CDI_DOMINATORS, function::cfg, cfun, hash_table< Descriptor, Lazy, Allocator >::clear_slot(), basic_block_def::count, count, create_empty_bb(), current_loops, function::decl, DECL_ARGUMENTS, DECL_CHAIN, DECL_INITIAL, dominated_by_p(), duplicate_eh_regions(), EDGE_COUNT, function::eh, move_stmt_d::eh_map, ei_safe_edge(), ei_start, ENTRY_BLOCK_PTR_FOR_FN, EXECUTE_IF_SET_IN_BITMAP, EXIT_BLOCK_PTR_FOR_FN, loop::exits, loops::exits, find_loop_dist_alias(), find_outermost_region_in_block(), hash_table< Descriptor, Lazy, Allocator >::find_slot_with_hash(), fixup_loop_arrays_after_move(), flow_loop_tree_node_add(), flow_loop_tree_node_remove(), fold_loop_internal_call(), FOR_EACH_BB_FN, FOR_EACH_EDGE, FOR_EACH_VEC_ELT, loop::force_vectorize, free(), free_numbers_of_iterations_estimates(), move_stmt_d::from_context, g, gather_blocks_in_sese_region(), gather_ssa_name_hash_map_from(), gcc_assert, get_dominated_by_region(), get_immediate_dominator(), get_loop(), get_loops(), ggc_cleared_alloc(), ggc_free(), gimple_build_nop(), gimple_call_arg(), gimple_call_set_arg(), gimple_in_ssa_p(), function::has_force_vectorize_loops, function::has_simduid_loops, loop::header, i, init_eh_for_function(), init_empty_tree_cfg(), init_loops_structure(), integer_type_node, loops::larray, function::last_clique, basic_block_def::loop_father, loop_outer(), loops_for_fn(), LOOPS_MAY_HAVE_MULTIPLE_LATCHES, make_edge(), make_single_succ_edge(), make_ssa_name_fn(), move_block_to_fn(), move_stmt_d::new_block, move_stmt_d::new_label_map, new_label_mapper(), NULL, NULL_TREE, loop::num_nodes, move_stmt_d::orig_block, pop_cfun(), basic_block_def::preds, push_cfun(), hash_map< KeyId, Value, Traits >::put(), release_ssa_name(), move_stmt_d::remap_decls_p, remove_edge(), replace_block_vars_by_duplicates(), replace_by_duplicate_decl(), set_immediate_dominator(), set_loops_for_fn(), set_ssa_default_def(), loop::simduid, ssa_name, loops::state, basic_block_def::succs, move_stmt_d::to_context, hash_map< KeyId, Value, Traits >::traverse(), tree_map_eq, tree_map_hash(), tree_to_shwi(), update_stmt(), move_stmt_d::vars_map, vec_safe_iterate(), vec_safe_length(), verify_sese(), control_flow_graph::x_entry_block_ptr, and profile_count::zero().

Referenced by expand_omp_target(), and expand_omp_taskreg().

◆ notice_special_calls()

void notice_special_calls ( gcall * call)
T is CALL_EXPR.  Set current_function_calls_* flags.   

References cfun, ECF_MAY_BE_ALLOCA, ECF_RETURNS_TWICE, and gimple_call_flags().

Referenced by copy_bb(), eliminate_unnecessary_stmts(), gimplify_call_expr(), gimplify_modify_expr(), and move_block_to_fn().

◆ print_loops()

void print_loops ( FILE * file,
int verbosity )
Follow a CFG edge from the entry point of the program, and on entry
of a loop, pretty print the loop structure on FILE.   

References cfun, current_function_name(), ENTRY_BLOCK_PTR_FOR_FN, basic_block_def::loop_father, and print_loop_and_siblings().

Referenced by debug_loops().

◆ print_loops_bb()

void print_loops_bb ( FILE * file,
basic_block bb,
int indent,
int verbosity )
Print to FILE the basic block BB following the VERBOSITY level.   

References alloca, dump_bb(), basic_block_def::index, print_pred_bbs(), print_succ_bbs(), TDF_MEMSYMS, and TDF_VOPS.

Referenced by print_loop().

◆ remove_edge_and_dominated_blocks()

◆ replace_uses_by()

◆ should_remove_lhs_p()

bool should_remove_lhs_p ( tree lhs)

◆ simple_goto_p()

bool simple_goto_p ( gimple * t)
Return true if T is a simple local goto.   

References gimple_goto_dest(), and TREE_CODE.

Referenced by gimple_verify_flow_info(), make_goto_expr_edges(), and mark_stmt_if_obviously_necessary().

◆ single_noncomplex_succ()

basic_block single_noncomplex_succ ( basic_block bb)
Return the one of two successors of BB that is not reachable by a
complex edge, if there is one.  Else, return BB.  We use
this in optimizations that use post-dominators for their heuristics,
to catch the cases in C++ where function calls are involved.   

References EDGE_COMPLEX, EDGE_COUNT, EDGE_SUCC, and basic_block_def::succs.

Referenced by compute_merit().

◆ split_critical_edges()

unsigned int split_critical_edges ( bool for_edge_insertion_p)

◆ split_edge_bb_loc()

basic_block split_edge_bb_loc ( edge edge_in)
Returns the basic block after which the new basic block created
by splitting edge EDGE_IN should be placed.  Tries to keep the new block
near its "logical" location.  This is of most help to humans looking
at debugging dumps.   

References edge_def::dest, EDGE_COMPLEX, find_edge(), and basic_block_def::prev_bb.

Referenced by back_jt_path_registry::duplicate_thread_path(), gimple_duplicate_seme_region(), gimple_duplicate_sese_tail(), and gimple_split_edge().

◆ split_edges_for_insertion()

unsigned int split_edges_for_insertion ( )

References split_critical_edges().

Referenced by tail_merge_optimize().

◆ start_recording_case_labels()

void start_recording_case_labels ( void )
Start recording information mapping edges to case labels.   

References BITMAP_ALLOC, edge_to_cases, gcc_assert, NULL, and touched_switch_bbs.

Referenced by cleanup_tree_cfg_noloop(), and split_critical_edges().

◆ stmt_can_make_abnormal_goto()

◆ stmt_ends_bb_p()

◆ verify_gimple_in_cfg()

◆ verify_gimple_in_seq()

bool verify_gimple_in_seq ( gimple_seq stmts,
bool ice )
Verify the GIMPLE statements inside the statement list STMTS.   

References internal_error(), timevar_pop(), timevar_push(), and verify_gimple_in_seq_2().

Referenced by execute_function_todo(), and gimplify_body().

◆ verify_sese()

void verify_sese ( basic_block entry,
basic_block exit,
vec< basic_block > * bbs_p )
Verify that the blocks in BBS_P are a single-entry, single-exit region
delimited by ENTRY_BB and EXIT_BB, possibly containing noreturn blocks.   

References BITMAP_ALLOC, bitmap_bit_p, BITMAP_FREE, bitmap_set_bit, ei_edge(), ei_end_p(), ei_next(), ei_start, FOR_EACH_VEC_ELT, gcc_assert, i, basic_block_def::index, NULL, basic_block_def::preds, single_pred(), single_pred_p(), single_succ(), single_succ_p(), and basic_block_def::succs.

Referenced by move_sese_region_to_fn().