GCC Middle and Back End API Reference
|
#include "config.h"
#include "system.h"
#include "coretypes.h"
#include "backend.h"
#include "target.h"
#include "rtl.h"
#include "tree.h"
#include "gimple.h"
#include "cfghooks.h"
#include "tree-pass.h"
#include "ssa.h"
#include "cgraph.h"
#include "gimple-pretty-print.h"
#include "diagnostic-core.h"
#include "fold-const.h"
#include "trans-mem.h"
#include "stor-layout.h"
#include "print-tree.h"
#include "cfganal.h"
#include "gimple-iterator.h"
#include "gimple-fold.h"
#include "tree-eh.h"
#include "gimplify-me.h"
#include "gimple-walk.h"
#include "tree-cfg.h"
#include "tree-ssa-loop-manip.h"
#include "tree-ssa-loop-niter.h"
#include "tree-into-ssa.h"
#include "tree-dfa.h"
#include "tree-ssa.h"
#include "except.h"
#include "cfgloop.h"
#include "tree-ssa-propagate.h"
#include "value-prof.h"
#include "tree-inline.h"
#include "tree-ssa-live.h"
#include "tree-ssa-dce.h"
#include "omp-general.h"
#include "omp-expand.h"
#include "tree-cfgcleanup.h"
#include "gimplify.h"
#include "attribs.h"
#include "selftest.h"
#include "opts.h"
#include "asan.h"
#include "profile.h"
#include "sreal.h"
Data Structures | |
struct | cfg_stats_d |
struct | replace_decls_d |
struct | locus_discrim_map |
struct | locus_discrim_hasher |
struct | label_record |
struct | move_stmt_d |
Variables | |
static const int | initial_cfg_capacity = 20 |
static hash_map< edge, tree > * | edge_to_cases |
static bitmap | touched_switch_bbs |
static vec< int > | bb_to_omp_idx |
static struct cfg_stats_d | cfg_stats |
static hash_table< locus_discrim_hasher > * | discriminator_per_locus |
static bool | eh_error_found |
struct cfg_hooks | gimple_cfg_hooks |
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().
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().
|
static |
Adds phi node arguments for edge E_COPY after basic block duplication.
References add_phi_arg(), bb_copy, find_edge(), FOR_EACH_EDGE, gcc_assert, get_bb_original(), gimple_phi_arg_location_from_edge(), gimple_seq_empty_p(), gsi_end_p(), gsi_next(), gsi_start_phis(), NULL, gphi_iterator::phi(), PHI_ARG_DEF_FROM_EDGE, phi_nodes(), and basic_block_def::succs.
Referenced by add_phi_args_after_copy(), and add_phi_args_after_copy_bb().
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>; else 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().
|
static |
Assign a unique discriminator value to all statements in block bb that have the same line number as locus.
References locus_discrim_map::discriminator, expand_location(), gimple_location(), gimple_set_location(), gsi_end_p(), gsi_next(), gsi_start_bb(), gsi_stmt(), location_with_discriminator(), next_discriminator_for_locus(), same_line_p(), and UNKNOWN_LOCATION.
Referenced by assign_discriminators().
|
static |
Assign discriminators to statement locations.
References assign_discriminator(), cfun, expand_location(), first_non_label_stmt(), FOR_EACH_BB_FN, FOR_EACH_EDGE, gimple_location(), gimple_set_location(), gsi_end_p(), gsi_next(), gsi_start_bb(), gsi_stmt(), has_discriminator(), is_gimple_debug(), last, last_nondebug_stmt(), location_with_discriminator(), next_discriminator_for_locus(), NULL, same_line_p(), basic_block_def::succs, and UNKNOWN_LOCATION.
Referenced by build_gimple_cfg().
|
static |
Checks if BB is part of the region defined by N_REGION BBS.
Referenced by gimple_duplicate_sese_tail().
|
static |
Entry point to the CFG builder for trees. SEQ is the sequence of statements to be added to the flowgraph.
References assign_discriminators(), basic_block_info_for_fn, cfg_stats, cfun, cleanup_dead_labels(), create_empty_bb(), discriminator_per_locus, ENTRY_BLOCK_PTR_FOR_FN, gimple_register_cfg_hooks(), group_case_labels(), init_empty_tree_cfg(), make_blocks(), make_edges(), n_basic_blocks_for_fn, NULL, NUM_FIXED_BLOCKS, and vec_safe_grow_cleared().
Referenced by execute_build_cfg().
Return true if T, a GIMPLE_CALL, can make an abnormal transfer of control flow. Transfers of control flow associated with EH are excluded.
References cfun, ECF_LEAF, gimple_call_flags(), and gimple_has_side_effects().
Referenced by gimple_call_initialize_ctrl_altering(), and stmt_can_make_abnormal_goto().
void cleanup_dead_labels | ( | void | ) |
Cleanup redundant labels. This is a three-step process: 1) Find the leading label for each block. 2) Redirect all references to labels to the leading labels. 3) Cleanup all useless labels.
References as_a(), CASE_LABEL, cfun, cleanup_dead_labels_eh(), computed_goto_p(), DECL_ARTIFICIAL, DECL_NONLOCAL, dyn_cast(), EH_LANDING_PAD_NR, FOR_EACH_BB_FN, FORCED_LABEL, free(), gcc_checking_assert, gimple_asm_label_op(), gimple_asm_nlabels(), gimple_cond_false_label(), gimple_cond_set_false_label(), gimple_cond_set_true_label(), gimple_cond_true_label(), gimple_goto_dest(), gimple_goto_set_dest(), gimple_label_label(), gimple_switch_label(), gimple_switch_num_labels(), gimple_transaction_label_norm(), gimple_transaction_label_over(), gimple_transaction_label_uninst(), gimple_transaction_set_label_norm(), gimple_transaction_set_label_over(), gimple_transaction_set_label_uninst(), gsi_end_p(), gsi_last_bb(), gsi_next(), gsi_remove(), gsi_start_bb(), gsi_stmt(), i, basic_block_def::index, label_for_bb(), last_basic_block_for_fn, main_block_label(), NULL, TREE_VALUE, and rtx_def::used.
Referenced by build_gimple_cfg(), and execute_cleanup_cfg_post_optimizing().
|
static |
Clean up redundant labels within the exception tree.
References cfun, EH_LANDING_PAD_NR, ERT_ALLOWED_EXCEPTIONS, ERT_CLEANUP, ERT_MUST_NOT_THROW, ERT_TRY, FOR_ALL_EH_REGION, i, eh_landing_pad_d::index, eh_catch_d::label, label_for_bb(), main_block_label(), eh_catch_d::next_catch, NULL, eh_landing_pad_d::post_landing_pad, r, and vec_safe_iterate().
Referenced by cleanup_dead_labels().
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().
Insert all subblocks of BLOCK into BLOCKS and recurse.
References hash_set< KeyId, Lazy, Traits >::add(), BLOCK_CHAIN, BLOCK_SUBBLOCKS, and collect_subblocks().
Referenced by collect_subblocks(), and verify_gimple_in_cfg().
Return true if T is a computed goto.
References gimple_goto_dest(), and TREE_CODE.
Referenced by cleanup_dead_labels(), copy_edges_for_bb(), find_taken_edge(), handle_abnormal_edges(), and stmt_can_make_abnormal_goto().
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().
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().
|
static |
Create and return a new empty basic block after bb AFTER.
References alloc_block(), basic_block_info_for_fn, cfun, basic_block_def::flags, gcc_assert, basic_block_def::index, last_basic_block_for_fn, link_block(), n_basic_blocks_for_fn, NULL, SET_BASIC_BLOCK_FOR_FN, set_bb_seq(), and vec_safe_grow_cleared().
DEBUG_FUNCTION void debug | ( | class loop & | ref | ) |
Dump a loop.
References print_loop().
DEBUG_FUNCTION void debug | ( | class loop * | ptr | ) |
References debug.
DEBUG_FUNCTION 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_FUNCTION 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_FUNCTION void debug_loop_num | ( | unsigned | num, |
int | verbosity ) |
Print on stderr the code of loop number NUM, at some VERBOSITY level.
References cfun, debug_loop(), and get_loop().
DEBUG_FUNCTION void debug_loops | ( | int | verbosity | ) |
Debugging loops structure at tree level, at some VERBOSITY level.
References print_loops().
DEBUG_FUNCTION void debug_verbose | ( | class loop & | ref | ) |
Dump a loop verbosely.
References print_loop().
DEBUG_FUNCTION void debug_verbose | ( | class loop * | ptr | ) |
References debug.
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().
|
static |
Walk a gimplified function and warn for functions whose return value is ignored and attribute((warn_unused_result)) is set. This is done before inlining, so we don't have to worry about that.
References as_a(), do_warn_unused_result(), g, gimple_bind_body(), gimple_call_fndecl(), gimple_call_fntype(), gimple_call_internal_p(), gimple_call_lhs(), gimple_catch_handler(), gimple_eh_filter_failure(), gimple_location(), gimple_try_cleanup(), gimple_try_eval(), gsi_end_p(), gsi_next(), gsi_start(), gsi_stmt(), i, lookup_attribute(), TYPE_ATTRIBUTES, and warning_at().
Referenced by do_warn_unused_result().
void dump_cfg_stats | ( | FILE * | file | ) |
Dump CFG statistics on FILE.
References cfg_stats, cfun, current_function_name(), EDGE_COUNT, FOR_EACH_BB_FN, n_basic_blocks_for_fn, cfg_stats_d::num_merged_labels, PRsa, SIZE_AMOUNT, and basic_block_def::succs.
Referenced by debug_cfg_stats(), and gimple_dump_cfg().
|
static |
Dump default def DEF to file FILE using FLAGS and indentation SPC.
References dump_ssaname_info_to_file(), i, print_generic_expr(), SSA_NAME_VAR, and TREE_TYPE.
Referenced by 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().
Called for each element in the hash table (P) as we delete the edge to cases hash table. Clear all the CASE_CHAINs to prevent problems with copying of SWITCH_EXPRs and structure sharing rules, then free the hash table element.
References CASE_CHAIN, and NULL.
Referenced by 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().
|
static |
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().
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 *TRUE_CONTROLLED_EDGE and *FALSE_CONTROLLED_EDGE if 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().
void extract_true_false_edges_from_block | ( | basic_block | b, |
edge * | true_edge, | ||
edge * | false_edge ) |
Given a basic block B which ends with a conditional and has precisely two successors, determine which of the edges is taken if the conditional is true and which is taken if the conditional is false. Set TRUE_EDGE and FALSE_EDGE appropriately.
Referenced by associate_equivalences_with_edges(), canonicalize_loop_ivs(), check_forbidden_calls(), create_parallel_loop(), do_split_loop_on_cond(), dump_implicit_edges(), expand_gimple_cond(), extract_true_false_controlled_edges(), find_conditions(), find_doloop_use(), find_loop_guard(), back_threader::find_taken_edge_cond(), find_taken_edge_cond_expr(), fold_loop_internal_call(), gimple_verify_flow_info(), hoist_guard(), match_simplify_replacement(), minmax_replacement(), predicate_bbs(), process_bb(), record_edge_info(), split_loop(), static_loop_exit(), jump_threader::thread_outgoing_edges(), value_replacement(), and vect_loop_versioning().
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().
|
static |
Return LOOP_DIST_ALIAS call if present in BB.
References g, gimple_call_internal_p(), gsi_end_p(), gsi_last_bb(), gsi_prev(), gsi_stmt(), NULL, and safe_is_a().
Referenced by move_sese_region_to_fn().
|
static |
Examine the statements in BB (which is in SRC_CFUN); find and return the outermost EH region. Use REGION as the incoming base EH region. If there is no single outermost region, return NULL and set *ALL to true.
References eh_region_outermost(), get_eh_region_from_lp_number_fn(), gsi_end_p(), gsi_next(), gsi_start_bb(), gsi_stmt(), lookup_stmt_eh_lp_fn(), NULL, si, and walk_stmt_info::stmt.
Referenced by move_sese_region_to_fn().
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().
|
static |
Given a constant value VAL and the entry block BB to a GOTO_EXPR statement, determine which of the outgoing edges will be taken out of the block. Return NULL if either edge may be taken.
References cfun, find_edge(), label_to_block(), and NULL.
Referenced by find_taken_edge().
Given COND_STMT and a constant value VAL for use as the predicate, determine which of the two edges will be taken out of the statement's block. Return NULL if either edge may be taken. If VAL is NULL_TREE, then the current value of COND_STMT's predicate is used.
References extract_true_false_edges_from_block(), gimple_bb(), gimple_cond_false_p(), gimple_cond_true_p(), integer_one_node, integer_zero_node, integer_zerop(), NULL, NULL_TREE, and TREE_CODE.
Referenced by find_taken_edge().
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().
|
static |
Return the first non-label statement in basic block BB.
References gsi_end_p(), gsi_next(), gsi_start_bb(), gsi_stmt(), i, and NULL.
Referenced by assign_discriminators().
gimple * first_stmt | ( | basic_block | bb | ) |
Return the first statement in basic block BB.
References gsi_end_p(), gsi_next(), gsi_start_bb(), gsi_stmt(), i, is_gimple_debug(), and NULL.
Referenced by expand_omp_atomic(), make_cond_expr_edges(), parloops_is_slp_reduction(), remove_forwarder_block(), remove_forwarder_block_with_phi(), and vect_slp_function().
|
static |
Fixup the loop arrays and numbers after moving LOOP and its subloops from FN1 to FN2.
References fixup_loop_arrays_after_move(), get_loops(), loop::inner, loops_for_fn(), loop::next, NULL, loop::num, number_of_loops(), and vec_safe_push().
Referenced by fixup_loop_arrays_after_move(), and move_sese_region_to_fn().
Fold loop internal call G like IFN_LOOP_VECTORIZED/IFN_LOOP_DIST_ALIAS to VALUE and update any immediate uses of it's LHS.
References profile_probability::always(), as_a(), extract_true_false_edges_from_block(), FOR_EACH_IMM_USE_ON_STMT, FOR_EACH_IMM_USE_STMT, g, gcc_assert, gimple_bb(), gimple_call_lhs(), gimple_cond_false_p(), gimple_cond_true_p(), gsi_for_stmt(), profile_probability::never(), profile_count::nonzero_p(), NULL, replace_call_with_value(), scale_strictly_dominated_blocks(), SET_USE, single_pred_edge(), and update_stmt().
Referenced by expand_vector_operations(), move_sese_region_to_fn(), set_uid_loop_bbs(), try_vectorize_loop_1(), and vect_loop_versioning().
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().
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().
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().
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().
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().
gphi * get_virtual_phi | ( | basic_block | bb | ) |
Return the virtual phi in BB.
References gsi_end_p(), gsi_next(), gsi_start_phis(), NULL, PHI_RESULT, and virtual_operand_p().
Referenced by combine_blocks(), find_vdef_in_loop(), virtual_operand_live::get_live_in(), get_live_virtual_operand_on_edge(), make_forwarders_with_degenerate_phis(), move_early_exit_stmts(), phiprop_insert_phi(), sink_common_stores_to_bb(), slpeel_tree_duplicate_loop_to_edge_cfg(), sm_seq_valid_bb(), translate_vuse_through_block(), vect_analyze_early_break_dependences(), vect_setup_realignment(), vectorizable_load(), and verify_vssa().
|
static |
Do book-keeping of basic block BB for the profile consistency checker. Store the counting in RECORD.
References cfun, basic_block_def::count, count, eni_size_weights, eni_time_weights, ENTRY_BLOCK_PTR_FOR_FN, estimate_num_insns(), gsi_end_p(), gsi_next_nondebug(), gsi_start_nondebug_after_labels_bb(), gsi_stmt(), i, profile_count::initialized_p(), profile_count::ipa(), profile_info, profile_record::size, profile_record::time, sreal::to_double(), profile_count::to_gcov_type(), and profile_count::to_sreal_scale().
|
static |
Return true if BB ends with a call, possibly followed by some instructions that must stay with the call. Return false, otherwise.
References gsi_end_p(), gsi_last_nondebug_bb(), gsi_stmt(), and is_gimple_call().
|
static |
Return true if BB ends with a conditional branch. Return false, otherwise.
References gsi_last_bb(), and safe_is_a().
tree gimple_block_label | ( | basic_block | bb | ) |
Return a non-special label in the head of basic block BLOCK. Create one if it doesn't exist.
References create_artificial_label(), DECL_NONLOCAL, dyn_cast(), gimple_build_label(), gimple_label_label(), gsi_end_p(), gsi_insert_before(), gsi_move_before(), GSI_NEW_STMT, gsi_next(), gsi_start_bb(), gsi_stmt(), i, walk_stmt_info::stmt, and UNKNOWN_LOCATION.
Referenced by build_case_label(), construct_init_block(), expand_omp_sections(), expand_thunk(), gimple_redirect_edge_and_branch(), gsi_insert_finally_seq_after_call(), lower_eh_dispatch(), lower_resx(), redirect_eh_dispatch_edge(), redirect_eh_edge_1(), and split_bb_make_tm_edge().
|
static |
Initialize GF_CALL_CTRL_ALTERING flag, which indicates the call could alter control flow except via eh. We initialize the flag at CFG build time and only ever clear it later.
References call_can_make_abnormal_goto(), ECF_NORETURN, ECF_TM_BUILTIN, gimple_call_builtin_p(), gimple_call_flags(), gimple_call_fndecl(), gimple_call_internal_p(), gimple_call_internal_unique_p(), gimple_call_set_ctrl_altering(), and is_tm_ending_fndecl().
Referenced by make_blocks_1().
|
static |
Return true if basic_block can be duplicated.
References CONST_CAST_BB, ECF_RETURNS_TWICE, g, gimple_call_flags(), gimple_call_internal_p(), gimple_call_internal_unique_p(), walk_stmt_info::gsi, gsi_end_p(), gsi_next(), gsi_start_bb(), gsi_stmt(), is_gimple_call(), last, and last_nondebug_stmt().
|
static |
Checks whether we can merge block B into block A.
References a, b, cfun, current_loops, DECL_ARTIFICIAL, dyn_cast(), EDGE_COMPLEX, ENTRY_BLOCK_PTR_FOR_FN, EXIT_BLOCK_PTR_FOR_FN, FORCED_LABEL, gimple_label_label(), gimple_location(), gsi_after_labels(), gsi_end_p(), gsi_last_bb(), gsi_last_nondebug_bb(), gsi_next(), gsi_next_nondebug(), gsi_start_bb(), gsi_start_phis(), gsi_stmt(), is_gimple_debug(), LOOPS_HAVE_SIMPLE_LATCHES, loops_state_satisfies_p(), name_registered_for_update_p(), PHI_RESULT, single_pred_p(), single_succ(), single_succ_edge(), single_succ_p(), stmt_ends_bb_p(), and UNKNOWN_LOCATION.
|
static |
Returns true if it is possible to remove edge E by redirecting it to the destination of the other edge from E->src.
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().
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().
void gimple_debug_cfg | ( | dump_flags_t | flags | ) |
Dump the CFG on stderr. FLAGS are the same used by the tree dumping functions (see TDF_* in dumpfile.h).
References 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 tree.h).
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().
|
static |
Create a duplicate of the basic block BB. NOTE: This does not preserve SSA form.
References cfun, create_empty_bb(), create_new_def_for(), create_phi_node(), DECL_EXTERNAL, DECL_HAS_VALUE_EXPR_P, DECL_IGNORED_P, DECL_NONSHAREABLE, DEF_FROM_PTR, EXIT_BLOCK_PTR_FOR_FN, FOR_EACH_SSA_DEF_OPERAND, gcc_assert, get_base_address(), get_new_clique(), hash_map< KeyId, Value, Traits >::get_or_insert(), gimple_copy(), gimple_debug_bind_get_var(), gimple_debug_bind_p(), gimple_duplicate_stmt_histograms(), gimple_get_lhs(), gimple_num_ops(), gimple_op(), gimple_phi_result(), gimple_phi_result_ptr(), gimple_set_uid(), gimple_uid(), walk_stmt_info::gsi, gsi_end_p(), gsi_insert_after(), GSI_NEW_STMT, gsi_next(), gsi_start_bb(), gsi_start_phis(), gsi_stmt(), handled_component_p(), i, basic_block_def::loop_father, maybe_duplicate_eh_stmt(), MR_DEPENDENCE_CLIQUE, NULL_TREE, loop::owned_clique, SSA_OP_ALL_DEFS, walk_stmt_info::stmt, TREE_CODE, TREE_OPERAND, TREE_STATIC, and VAR_P.
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().
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 otherwise. For example, some_code; if (cond) A; else B; is transformed to if (cond) { some_code; A; } else { some_code; B; }
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().
|
static |
Return TRUE if block BB has no executable statements, otherwise return FALSE.
References walk_stmt_info::gsi, gsi_after_labels(), gsi_end_p(), gsi_next(), gsi_stmt(), is_gimple_debug(), phi_nodes(), and walk_stmt_info::stmt.
|
static |
This function is called whenever a new edge is created or redirected.
References gimple_seq_empty_p(), phi_nodes(), and reserve_phi_args_for_new_edge().
|
static |
This function is called immediately before edge E is removed from the edge vector E->dest->preds.
References gimple_seq_empty_p(), phi_nodes(), and remove_phi_args().
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().
|
static |
Add fake edges to the function exit for any non constant and non noreturn calls (or noreturn calls with EH/abnormal edges), volatile inline assembly in the bitmap of blocks specified by BLOCKS or to the whole CFG if BLOCKS is zero. Return the number of blocks that were split. The goal is to expose cases in which entering a basic block does not imply that all subsequent instructions must be executed.
References BASIC_BLOCK_FOR_FN, bitmap_bit_p, cfun, checking_verify_flow_info(), EXIT_BLOCK_PTR_FOR_FN, find_edge(), gcc_assert, gimple_build_nop(), gsi_commit_edge_inserts(), gsi_end_p(), gsi_insert_on_edge(), gsi_last_nondebug_bb(), gsi_prev(), gsi_stmt(), profile_probability::guessed_never(), i, last_basic_block_for_fn, make_edge(), n_basic_blocks_for_fn, NULL, NUM_FIXED_BLOCKS, basic_block_def::prev_bb, split_block(), and stmt_can_terminate_bb_p().
|
static |
Adds a if else statement to COND_BB with condition COND_EXPR. SECOND_HEAD is the destination of the THEN and FIRST_HEAD is the destination of the ELSE part.
References force_gimple_operand_gsi_1(), gimple_build_cond_from_tree(), GSI_CONTINUE_LINKING, gsi_insert_after(), gsi_last_bb(), GSI_NEW_STMT, is_gimple_condexpr_for_cond(), NULL_TREE, and single_succ_edge().
|
static |
Adjust phi nodes for 'first' basic block. 'second' basic block is a copy of 'first'. Both of them are dominated by 'new_head' basic block. When 'new_head' was created by 'second's incoming edge it received phi arguments on the edge by split_edge(). Later, additional edge 'e' was created to connect 'new_head' and 'first'. Now this routine adds phi args on this additional edge 'e' that new_head to second edge received as part of edge splitting.
References add_phi_arg(), find_edge(), gcc_assert, gimple_phi_arg_location_from_edge(), gsi_end_p(), gsi_next(), gsi_start_phis(), NULL, gphi_iterator::phi(), and PHI_ARG_DEF.
|
static |
Updates phi nodes after creating a forwarder block joined by edge FALLTHRU.
References add_phi_arg(), copy_ssa_name(), create_phi_node(), flush_pending_stmts(), FOR_EACH_EDGE, gimple_phi_arg_location(), gimple_phi_result(), gimple_phi_set_result(), walk_stmt_info::gsi, gsi_end_p(), gsi_next(), gsi_start_phis(), basic_block_def::preds, single_pred_p(), and UNKNOWN_LOCATION.
|
static |
Flowgraph optimization and cleanup.
Merge block B into block A.
References a, b, bb_seq(), bitmap_set_bit, cfgcleanup_altered_bbs, current_loops, DECL_ARTIFICIAL, DECL_NONLOCAL, dump_file, dyn_cast(), EH_LANDING_PAD_NR, FOR_EACH_IMM_USE_ON_STMT, FOR_EACH_IMM_USE_STMT, FORCED_LABEL, gcc_assert, get_eh_landing_pad_from_number(), gimple_build_assign(), gimple_build_debug_bind(), gimple_debug_bind_reset_value(), gimple_label_label(), gimple_phi_arg_def(), gimple_phi_result(), gimple_set_bb(), gsi_end_p(), gsi_insert_after(), gsi_insert_before(), gsi_insert_seq_after(), gsi_last_bb(), GSI_NEW_STMT, gsi_next(), gsi_remove(), GSI_SAME_STMT, gsi_start_bb(), gsi_start_phis(), gsi_stmt(), integer_zero_node, last, LOOP_CLOSED_SSA, loops_state_satisfies_p(), MAY_HAVE_DEBUG_BIND_STMTS, may_propagate_copy(), move_block_after(), NULL, NULL_TREE, eh_landing_pad_d::post_landing_pad, remove_phi_node(), replace_uses_by(), set_bb_seq(), SET_USE, single_succ_edge(), SSA_NAME_OCCURS_IN_ABNORMAL_PHI, stmt_ends_bb_p(), TREE_CODE, and virtual_operand_p().
|
static |
Moves basic block BB after block AFTER.
References link_block(), basic_block_def::prev_bb, and unlink_block().
bool gimple_purge_all_dead_abnormal_call_edges | ( | const_bitmap | blocks | ) |
Purge dead abnormal call edges from basic block listed in BLOCKS.
References BASIC_BLOCK_FOR_FN, cfun, changed, EXECUTE_IF_SET_IN_BITMAP, gcc_assert, gimple_purge_dead_abnormal_call_edges(), i, and NULL.
Referenced by eliminate_dom_walker::eliminate_cleanup(), and substitute_and_fold_engine::substitute_and_fold().
bool gimple_purge_all_dead_eh_edges | ( | const_bitmap | blocks | ) |
Purge dead EH edges from basic block listed in BLOCKS.
References BASIC_BLOCK_FOR_FN, cfun, changed, EXECUTE_IF_SET_IN_BITMAP, gcc_assert, gimple_purge_dead_eh_edges(), i, and NULL.
Referenced by ipcp_modif_dom_walker::cleanup_eh(), eliminate_dom_walker::eliminate_cleanup(), fold_marked_statements(), substitute_and_fold_engine::substitute_and_fold(), and tree_lower_complex().
bool gimple_purge_dead_abnormal_call_edges | ( | basic_block | bb | ) |
Purge dead abnormal call edges from basic block BB.
References changed, ei_next(), ei_safe_edge(), ei_start, gsi_last_bb(), remove_edge_and_dominated_blocks(), stmt_can_make_abnormal_goto(), and basic_block_def::succs.
Referenced by execute_fixup_cfg(), gimple_purge_all_dead_abnormal_call_edges(), and optimize_inline_calls().
bool gimple_purge_dead_eh_edges | ( | basic_block | bb | ) |
Purge dead EH edges from basic block BB.
References cfun, changed, ei_next(), ei_safe_edge(), ei_start, gsi_last_bb(), remove_edge_and_dominated_blocks(), stmt_can_throw_internal(), and basic_block_def::succs.
Referenced by strlen_pass::before_dom_children(), cleanup_control_flow_bb(), execute_cse_conv_1(), execute_cse_sincos_1(), execute_fixup_cfg(), expand_omp_target(), expand_omp_taskreg(), expand_vector_operations(), gimple_expand_vec_set_extract_expr(), gimple_ic(), gimple_purge_all_dead_eh_edges(), instrument_memory_accesses(), ipa_simd_modify_function_body(), ipa_param_body_adjustments::modify_cfun_body(), optimize_inline_calls(), redirect_all_calls(), replace_uses_by(), sra_modify_function_body(), and scc_copy_prop::~scc_copy_prop().
|
static |
Redirect E to DEST. Return NULL on failure. Otherwise, return the edge representing the redirected branch.
References as_a(), bitmap_set_bit, CASE_CHAIN, CASE_LABEL, cfun, ENTRY_BLOCK_PTR_FOR_FN, find_edge(), gcc_assert, gcc_unreachable, get_cases_for_edge(), gimple_asm_label_op(), gimple_asm_nlabels(), gimple_bb(), gimple_block_label(), gimple_switch_label(), gimple_switch_num_labels(), gimple_transaction_set_label_norm(), gimple_transaction_set_label_over(), gimple_transaction_set_label_uninst(), gimple_try_redirect_by_replacing_jump(), walk_stmt_info::gsi, gsi_end_p(), gsi_last_nondebug_bb(), gsi_remove(), gsi_stmt(), i, label_to_block(), last, NULL, redirect_eh_dispatch_edge(), redirect_eh_edge(), ssa_redirect_edge(), walk_stmt_info::stmt, touched_switch_bbs, and TREE_VALUE.
Referenced by gimple_redirect_edge_and_branch_force().
|
static |
Simple wrapper, as we can always redirect fallthru edges.
References gcc_assert, gimple_redirect_edge_and_branch(), and NULL.
bool gimple_seq_unreachable_p | ( | gimple_seq | stmts | ) |
Returns true if the sequence of statements STMTS only contains a call to __builtin_unreachable ().
References gimple_call_builtin_p(), gimple_clobber_p(), gsi_end_p(), gsi_last(), gsi_prev(), gsi_stmt(), is_gimple_debug(), NULL, sanitize_flags_p(), and SANITIZE_UNREACHABLE.
Referenced by assert_unreachable_fallthru_edge_p(), expand_case(), group_case_labels_stmt(), and remove_unreachable::maybe_register().
|
static |
Splits basic block BB after statement STMT (but at least after the labels). If STMT is NULL, BB is split just after the labels.
References create_empty_bb(), FOR_EACH_EDGE, gimple_set_bb(), walk_stmt_info::gsi, gsi_after_labels(), gsi_end_p(), gsi_for_stmt(), gsi_next(), gsi_split_seq_before(), gsi_start(), gsi_stmt(), NULL, set_bb_seq(), walk_stmt_info::stmt, and basic_block_def::succs.
|
static |
Split a basic block if it ends with a conditional branch and if the other part of the block is not empty.
References walk_stmt_info::gsi, gsi_end_p(), gsi_last_nondebug_bb(), gsi_prev(), gsi_stmt(), last, NULL, and split_block().
|
static |
Split a (typically critical) edge EDGE_IN. Return the new block. Abort on abnormal edges.
References basic_block_def::count, create_empty_bb(), edge_def::dest, gcc_assert, basic_block_def::basic_block_il_dependent::gimple, basic_block_def::il, make_single_succ_edge(), NULL, gimple_bb_info::phi_nodes, phi_nodes(), redirect_edge_and_branch(), set_phi_nodes(), and split_edge_bb_loc().
basic_block gimple_switch_default_bb | ( | function * | ifun, |
gswitch * | gs ) |
Return the default basic block of a switch statement.
References gimple_switch_label_bb().
Referenced by tree_switch_conversion::switch_decision_tree::analyze_switch_statement(), convert_single_case_switch(), tree_switch_conversion::switch_conversion::exp_index_transform(), and group_case_labels_stmt().
Return the default edge of a switch statement.
References gimple_switch_edge().
Referenced by gimple_outgoing_range::calc_switch_ranges(), tree_switch_conversion::switch_conversion::collect(), tree_switch_conversion::jump_table_cluster::emit(), and tree_switch_conversion::switch_decision_tree::try_switch_expansion().
Return the edge that belongs to label numbered INDEX of a switch statement.
References find_edge(), gimple_bb(), and gimple_switch_label_bb().
Referenced by gimple_outgoing_range::calc_switch_ranges(), tree_switch_conversion::switch_conversion::collect(), tree_switch_conversion::switch_decision_tree::compute_cases_per_edge(), gimple_switch_default_edge(), and set_switch_stmt_execution_predicate().
basic_block gimple_switch_label_bb | ( | function * | ifun, |
gswitch * | gs, | ||
unsigned | index ) |
Return the basic block that belongs to label numbered INDEX of a switch statement.
References CASE_LABEL, gimple_switch_label(), and label_to_block().
Referenced by tree_switch_conversion::switch_conversion::check_final_bb(), gimple_switch_default_bb(), gimple_switch_edge(), gimple_verify_flow_info(), and make_gimple_switch_edges().
|
static |
Attempt to perform edge redirection by replacing a possibly complex jump instruction by a goto or by removing the jump completely. This can apply only if all edges now point to the same block. The parameters and return values are equivalent to redirect_edge_and_branch.
References EDGE_COUNT, EDGE_SUCC, gsi_end_p(), gsi_last_bb(), gsi_remove(), gsi_stmt(), i, NULL, ssa_redirect_edge(), walk_stmt_info::stmt, and basic_block_def::succs.
Referenced by gimple_redirect_edge_and_branch().
|
static |
Verifies that the flow information is OK.
References as_a(), basic_block_def::aux, bb_has_abnormal_pred(), CASE_LOW, CDI_DOMINATORS, cfun, basic_block_def::count, count, current_function_decl, decl_function_context(), DECL_NONLOCAL, dom_info_state(), DOM_NO_FAST_QUERY, dyn_cast(), ECF_RETURNS_TWICE, EDGE_COUNT, EH_LANDING_PAD_NR, ENTRY_BLOCK_PTR_FOR_FN, error(), EXIT_BLOCK_PTR_FOR_FN, extract_true_false_edges_from_block(), FOR_EACH_BB_FN, FOR_EACH_EDGE, gcc_assert, gimple_call_builtin_p(), gimple_call_flags(), gimple_label_label(), gimple_switch_label(), gimple_switch_label_bb(), gimple_switch_num_labels(), walk_stmt_info::gsi, gsi_end_p(), gsi_last_nondebug_bb(), gsi_next(), gsi_one_nondebug_before_end_p(), gsi_start_bb(), gsi_stmt(), i, basic_block_def::index, profile_count::initialized_p(), is_ctrl_stmt(), is_gimple_debug(), label_to_block(), NULL, print_generic_expr(), print_gimple_stmt(), simple_goto_p(), single_succ(), single_succ_edge(), single_succ_p(), walk_stmt_info::stmt, stmt_ends_bb_p(), basic_block_def::succs, TDF_SLIM, tree_int_cst_lt(), verify_dominators(), verify_eh_dispatch_edge(), and verify_eh_edges().
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().
Scan the sorted vector of cases in STMT (a GIMPLE_SWITCH) and combine the ones jumping to the same label. Eg. three separate entries 1: 2: 3: become one entry 1..3:
References hash_set< KeyId, Lazy, Traits >::add(), bb_seq(), BUILTINS_LOCATION, CASE_HIGH, CASE_LABEL, CASE_LOW, cfun, hash_set< KeyId, Lazy, Traits >::contains(), DECL_NONLOCAL, dyn_cast(), EDGE_COUNT, find_edge(), FORCED_LABEL, gcc_assert, gimple_bb(), gimple_in_ssa_p(), gimple_label_label(), gimple_location(), gimple_seq_unreachable_p(), gimple_switch_default_bb(), gimple_switch_label(), gimple_switch_num_labels(), gimple_switch_set_label(), gimple_switch_set_num_labels(), gsi_end_p(), gsi_next(), gsi_start_bb(), gsi_stmt(), i, label_to_block(), last_nondebug_stmt(), LOCATION_LOCUS, NULL, remove_edge_and_dominated_blocks(), basic_block_def::succs, and wi::to_wide().
Referenced by end_recording_case_labels(), tree_switch_conversion::switch_conversion::expand(), gimple_lower_bitint(), and group_case_labels().
|
extern |
void gt_ggc_mx | ( | edge_def * | e | ) |
Garbage collection and PCH support for edge_def.
References current_ir_type(), edge_def::dest, edge_def::edge_def_insns::g, edge_def::goto_locus, gt_ggc_mx(), edge_def::insns, IR_GIMPLE, LOCATION_BLOCK, edge_def::edge_def_insns::r, and edge_def::src.
|
extern |
|
extern |
|
static |
|
extern |
Garbage collection support for edge_def.
|
extern |
void gt_pch_nx | ( | edge_def * | e | ) |
void gt_pch_nx | ( | edge_def * | e, |
gt_pointer_operator | op, | ||
void * | cookie ) |
|
extern |
|
extern |
|
static |
|
extern |
PCH support for edge_def.
|
static |
Helper function for make_edges. Create a basic block with with ABNORMAL_DISPATCHER internal call in it if needed, and create abnormal edges from BBS to it and from it to FOR_BB if COMPUTED_GOTO is false, otherwise factor the computed gotos.
References bb_to_omp_idx, boolean_false_node, boolean_true_node, computed_goto_p(), create_artificial_label(), create_basic_block(), create_tmp_var, FOR_EACH_VEC_ELT, g, gcc_assert, gimple_build_assign(), gimple_build_call_internal(), gimple_build_goto(), gimple_build_label(), gimple_call_set_ctrl_altering(), gimple_goto_dest(), gimple_location(), gsi_after_labels(), gsi_insert_after(), gsi_insert_before(), gsi_last_bb(), GSI_NEW_STMT, gsi_remove(), GSI_SAME_STMT, gsi_start_bb(), gsi_stmt(), basic_block_def::index, last, make_edge(), NULL, ptr_type_node, and UNKNOWN_LOCATION.
Referenced by make_edges().
void init_empty_tree_cfg | ( | void | ) |
References cfun, and init_empty_tree_cfg_for_function().
Referenced by build_gimple_cfg(), init_lowered_empty_function(), initialize_cfun(), and move_sese_region_to_fn().
void init_empty_tree_cfg_for_function | ( | struct function * | fn | ) |
References basic_block_info_for_fn, ENTRY_BLOCK, ENTRY_BLOCK_PTR_FOR_FN, EXIT_BLOCK, EXIT_BLOCK_PTR_FOR_FN, init_flow(), initial_cfg_capacity, label_to_block_map_for_fn, last_basic_block_for_fn, n_basic_blocks_for_fn, NUM_FIXED_BLOCKS, PROFILE_ABSENT, profile_status_for_fn, SET_BASIC_BLOCK_FOR_FN, and vec_safe_grow_cleared().
Referenced by function_reader::create_function(), init_empty_tree_cfg(), and input_cfg().
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().
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().
Return true if T represents a stmt that always transfers control.
Referenced by create_edge_for_control_dependence(), do_hoist_insertion(), execute_fixup_cfg(), gimple_verify_flow_info(), gsi_move_to_bb_end(), mark_last_stmt_necessary(), remove_dead_stmt(), stmt_ends_bb_p(), fwd_jt_path_registry::thread_block_1(), and vect_stmt_relevant_p().
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(), predicate_bbs(), 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().
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 statement.
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(), minmax_replacement(), and poor_ifcvt_pred().
gimple * last_nondebug_stmt | ( | basic_block | bb | ) |
Return the last statement in basic block BB.
References gsi_end_p(), gsi_last_bb(), gsi_prev(), gsi_stmt(), i, is_gimple_debug(), and NULL.
Referenced by adjust_context_and_scope(), autofdo::afdo_propagate_circuit(), assign_discriminators(), compute_added_num_insns(), determine_parallel_type(), do_warn_aggressive_loop_optimizations(), do_while_loop_p(), estimate_numbers_of_iterations(), execute_fixup_cfg(), expand_oacc_for(), expand_omp(), expand_omp_atomic(), expand_omp_atomic_cas(), expand_omp_atomic_fetch_op(), expand_omp_for(), expand_omp_for_init_counts(), expand_omp_for_init_vars(), expand_omp_for_static_chunk(), expand_omp_sections(), expand_omp_simd(), expand_omp_target(), expand_omp_taskreg(), expand_task_call(), gen_parallel_loop(), get_predicates_for_bb(), gimple_can_duplicate_bb_p(), group_case_labels_stmt(), hoist_guard(), init_loop_unswitch_info(), match_simplify_replacement(), may_eliminate_iv(), maybe_optimize_range_tests(), minmax_replacement(), no_side_effect_bb(), omp_make_gimple_edges(), optimize_range_tests(), optimize_range_tests_to_bit_test(), optimize_range_tests_var_bound(), rvrp_folder::pre_fold_bb(), gimple_ranger::range_on_exit(), reassociate_bb(), redirect_all_calls(), remove_exit_barrier(), set_predicates_for_bb(), standard_iv_increment_position(), stmt_after_ip_normal_pos(), suitable_cond_bb(), tm_region_init(), update_range_test(), and workshare_safe_to_combine_p().
|
static |
Given LABEL return the first label in the same basic block.
References cfun, basic_block_def::index, label_for_bb(), label_to_block(), and rtx_def::used.
Referenced by cleanup_dead_labels(), and cleanup_dead_labels_eh().
|
static |
Basic blocks and flowgraphs.
Build a flowgraph for the sequence of stmts SEQ.
References cfun, ENTRY_BLOCK_PTR_FOR_FN, gcc_assert, gimple_debug_nonbind_marker_p(), gsi_end_p(), gsi_last(), gsi_move_after(), gsi_none(), gsi_prev(), gsi_stmt(), i, is_a(), is_gimple_debug(), make_blocks_1(), and MAY_HAVE_DEBUG_MARKER_STMTS.
Referenced by build_gimple_cfg().
|
static |
Insert SEQ after BB and build a flowgraph.
References create_basic_block(), create_tmp_var, gimple_block(), gimple_build_assign(), gimple_call_initialize_ctrl_altering(), gimple_get_lhs(), gimple_has_lhs(), gimple_location(), gimple_set_bb(), gimple_set_block(), gimple_set_lhs(), gimple_set_location(), gsi_end_p(), gsi_insert_after(), gsi_next(), GSI_SAME_STMT, gsi_split_seq_before(), gsi_start(), gsi_stmt(), i, is_gimple_call(), is_gimple_debug(), is_gimple_reg_type(), NULL, stmt_can_make_abnormal_goto(), stmt_ends_bb_p(), stmt_starts_bb_p(), and TREE_TYPE.
Referenced by gimple_find_sub_bbs(), and make_blocks().
|
static |
Create the edges for a GIMPLE_COND starting at block BB.
References as_a(), cfun, first_stmt(), gcc_assert, gimple_cond_false_label(), gimple_cond_set_false_label(), gimple_cond_set_true_label(), gimple_cond_true_label(), gimple_location(), gsi_last_bb(), label_to_block(), make_edge(), and NULL_TREE.
Referenced by make_edges_bb().
|
static |
Edges.
Join all the blocks in the flowgraph.
References BASIC_BLOCK_FOR_FN, bb_to_omp_idx, cfun, count, DECL_NONLOCAL, dyn_cast(), ECF_RETURNS_TWICE, ENTRY_BLOCK_PTR_FOR_FN, FOR_EACH_BB_FN, FORCED_LABEL, gimple_call_builtin_p(), gimple_call_flags(), gimple_label_label(), gsi_end_p(), gsi_next(), gsi_next_nondebug(), gsi_start_bb(), gsi_stmt(), handle_abnormal_edges(), basic_block_def::index, is_gimple_call(), is_gimple_debug(), make_edge(), make_edges_bb(), n_basic_blocks_for_fn, NULL, NUM_FIXED_BLOCKS, and omp_free_regions().
Referenced by build_gimple_cfg(), find_many_sub_basic_blocks(), and find_sub_basic_blocks().
|
static |
Creates outgoing edges for BB. Returns 1 when it ends with an computed goto, returns 2 when it ends with a statement that might return to this function via an nonlocal goto, otherwise return 0. Updates *PCUR_REGION with the OMP region this BB is in.
References as_a(), CASE_GIMPLE_OMP, cfun, EXIT_BLOCK_PTR_FOR_FN, gcc_assert, gimple_call_builtin_p(), gimple_call_noreturn_p(), gimple_location(), gimple_transaction_label_norm(), gimple_transaction_label_over(), gimple_transaction_label_uninst(), gimple_transaction_subcode(), gsi_last_bb(), GTMA_HAVE_ABORT, GTMA_IS_OUTER, is_ctrl_altering_stmt(), label_to_block(), last, make_cond_expr_edges(), make_edge(), make_eh_dispatch_edges(), make_eh_edge(), make_gimple_asm_edges(), make_gimple_switch_edges(), make_goto_expr_edges(), basic_block_def::next_bb, omp_make_gimple_edges(), stmt_can_make_abnormal_goto(), and stmt_ends_bb_p().
Referenced by gimple_find_sub_bbs(), and make_edges().
|
static |
Create edges for an asm statement with labels at block BB.
References as_a(), cfun, gimple_asm_label_op(), gimple_asm_nlabels(), gsi_last_bb(), i, label_to_block(), make_edge(), and TREE_VALUE.
Referenced by make_edges_bb().
|
static |
Create the edges for a GIMPLE_SWITCH starting at block BB.
References cfun, gimple_switch_label_bb(), gimple_switch_num_labels(), i, and make_edge().
Referenced by make_edges_bb().
|
static |
Create edges for a goto statement at block BB. Returns true if abnormal edges should be created.
References cfun, gimple_goto_dest(), gimple_location(), gsi_last_bb(), gsi_remove(), gsi_stmt(), label_to_block(), last, make_edge(), and simple_goto_p().
Referenced by make_edges_bb().
gimple_opt_pass * make_pass_build_cfg | ( | gcc::context * | ctxt | ) |
gimple_opt_pass * make_pass_fixup_cfg | ( | gcc::context * | ctxt | ) |
gimple_opt_pass * make_pass_split_crit_edges | ( | gcc::context * | ctxt | ) |
gimple_opt_pass * make_pass_warn_function_return | ( | gcc::context * | ctxt | ) |
gimple_opt_pass * make_pass_warn_unused_result | ( | gcc::context * | ctxt | ) |
|
static |
Maybe Remove stores to variables we marked write-only. Return true if a store was removed.
References bitmap_set_bit, DECL_EXTERNAL, dump_file, dump_flags, varpool_node::get(), get_base_address(), gimple_assign_rhs1(), gimple_assign_single_p(), gimple_get_lhs(), gimple_has_side_effects(), gimple_store_p(), gsi_remove(), print_gimple_stmt(), release_defs(), SSA_NAME_IS_DEFAULT_DEF, SSA_NAME_VERSION, TDF_DETAILS, TDF_MEMSYMS, TDF_VOPS, TREE_CODE, TREE_STATIC, unlink_stmt_vdef(), and VAR_P.
Referenced by execute_fixup_cfg().
|
static |
Move basic block BB from function CFUN to function DEST_FN. The block is moved out of the original linked list and placed after block AFTER in the new list. Also, the block is removed from the original array of blocks and placed in DEST_FN's array of blocks. If UPDATE_EDGE_COUNT_P is true, the edge counts on both CFGs is updated to reflect the moved edges. The local variables are remapped to new instances, VARS_MAP is used to record the mapping.
References as_a(), loop::aux, CDI_DOMINATORS, function::cfg, cfun, current_loops, function::decl, DECL_CONTEXT, delete_from_dominance_info(), dyn_cast(), EDGE_COUNT, move_stmt_d::eh_map, FOR_EACH_EDGE, FOR_EACH_IMM_USE_ON_STMT, FOR_EACH_IMM_USE_STMT, FOR_EACH_PHI_ARG, free_stmt_operands(), gcc_assert, gimple_duplicate_stmt_histograms(), gimple_label_label(), gimple_phi_arg_location(), gimple_phi_arg_set_location(), gimple_remove_stmt_histograms(), gsi_end_p(), gsi_next(), gsi_start_bb(), gsi_start_phis(), gsi_stmt(), i, basic_block_def::index, is_gimple_call(), LABEL_DECL_UID, control_flow_graph::last_label_uid, LOCATION_BLOCK, basic_block_def::loop_father, maybe_duplicate_eh_stmt_fn(), move_block_after(), move_stmt_op(), move_stmt_r(), move_stmt_d::new_block, notice_special_calls(), NULL, NULL_TREE, move_stmt_d::orig_block, PHI_RESULT, pop_cfun(), basic_block_def::preds, push_cfun(), remove_phi_node(), remove_stmt_from_eh_lp_fn(), replace_ssa_name(), set_block(), SET_PHI_RESULT, SET_USE, si, SSA_NAME_VAR, SSA_OP_USE, walk_stmt_info::stmt, basic_block_def::succs, TREE_CODE, UNKNOWN_LOCATION, update_stmt(), USE_FROM_PTR, move_stmt_d::vars_map, vec_safe_grow_cleared(), vec_safe_length(), virtual_operand_p(), walk_gimple_stmt(), control_flow_graph::x_basic_block_info, control_flow_graph::x_label_to_block_map, control_flow_graph::x_last_basic_block, control_flow_graph::x_n_basic_blocks, and control_flow_graph::x_n_edges.
Referenced by 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().
|
static |
Helper for move_stmt_r. Given an EH region number for the source function, map that to the duplicate EH regio number in the dest.
References move_stmt_d::eh_map, hash_map< KeyId, Value, Traits >::get(), get_eh_region_from_number(), and eh_region_d::index.
Referenced by move_stmt_eh_region_tree_nr(), and move_stmt_r().
|
static |
Similar, but operate on INTEGER_CSTs.
References build_int_cst(), integer_type_node, move_stmt_eh_region_nr(), and tree_to_shwi().
Referenced by move_stmt_r().
Helper for move_block_to_fn. Set TREE_BLOCK in every expression contained in *TP if it has been ORIG_BLOCK previously and change the DECL_CONTEXT of every local variable referenced in *TP.
References BLOCK_SUPERCONTEXT, cfun, DECL_CONTEXT, DECL_NONLOCAL, DECL_P, DECL_UID, EXPR_P, FORCED_LABEL, gcc_assert, hash_map< KeyId, Value, Traits >::get(), gimple_in_ssa_p(), is_gimple_min_invariant(), is_global_var(), move_stmt_d::new_block, move_stmt_d::new_label_map, NULL_TREE, move_stmt_d::orig_block, move_stmt_d::remap_decls_p, replace_by_duplicate_decl(), replace_ssa_name(), move_stmt_d::to_context, TREE_BLOCK, TREE_CODE, TREE_SET_BLOCK, TYPE_P, unshare_expr(), VAR_P, and move_stmt_d::vars_map.
Referenced by move_block_to_fn(), and move_stmt_r().
|
static |
Like move_stmt_op, but for gimple statements. Helper for move_block_to_fn. Set GIMPLE_BLOCK in every expression contained in the current statement in *GSI_P and change the DECL_CONTEXT of every local variable referenced in the current statement.
References as_a(), BUILT_IN_NORMAL, DECL_CONTEXT, DECL_FUNCTION_CODE(), DECL_NONLOCAL, fndecl_built_in_p(), FORCED_LABEL, gimple_block(), gimple_call_arg(), gimple_call_fndecl(), gimple_call_set_arg(), gimple_eh_dispatch_region(), gimple_eh_dispatch_set_region(), gimple_label_label(), gimple_omp_body_ptr(), gimple_resx_region(), gimple_resx_set_region(), gimple_set_block(), gsi_stmt(), is_gimple_omp(), move_stmt_eh_region_nr(), move_stmt_eh_region_tree_nr(), move_stmt_op(), move_stmt_r(), move_stmt_d::new_block, NULL_TREE, move_stmt_d::orig_block, r, move_stmt_d::remap_decls_p, move_stmt_d::to_context, walk_gimple_op(), and walk_gimple_seq_mod().
Referenced by move_block_to_fn(), and move_stmt_r().
References cfun, create_artificial_label(), DECL_UID, gcc_assert, LABEL_DECL_UID, NULL, TREE_CODE, and UNKNOWN_LOCATION.
Referenced by move_sese_region_to_fn().
|
static |
Find the next available discriminator value for LOCUS. The discriminator distinguishes among several basic blocks that share a common locus, allowing for more accurate sample-based profiling.
References locus_discrim_map::discriminator, discriminator_per_locus, gcc_assert, and locus_discrim_map::location_line.
Referenced by assign_discriminator(), and assign_discriminators().
void notice_special_calls | ( | gcall * | call | ) |
T is CALL_EXPR. Set current_function_calls_* flags.
References cfun, ECF_MAY_BE_ALLOCA, ECF_RETURNS_TWICE, gimple_call_flags(), and gimple_call_must_tail_p().
Referenced by copy_bb(), eliminate_unnecessary_stmts(), gimplify_call_expr(), gimplify_modify_expr(), and move_block_to_fn().
Returns true if there is one pointer type in TYPE_POINTER_TO (SRC_OBJ) list of pointer-to types that is trivially convertible to DEST.
References edge_def::dest, edge_def::src, TYPE_NEXT_PTR_TO, TYPE_POINTER_TO, and useless_type_conversion_p().
Referenced by verify_gimple_assign_single().
|
static |
Pretty print LOOP on FILE, indented INDENT spaces. Following VERBOSITY level this outputs the contents of the loop, or just its structure.
References alloca, cfun, FOR_EACH_BB_FN, loop::header, basic_block_def::index, loop::inner, loop::latch, basic_block_def::loop_father, NULL, loop::num, print_loop_and_siblings(), print_loop_info(), and print_loops_bb().
Referenced by debug(), debug_loop(), debug_verbose(), and print_loop_and_siblings().
|
static |
Print the LOOP and its sibling loops on FILE, indented INDENT spaces. Following VERBOSITY level this outputs the contents of the loop, or just its structure.
References loop::next, NULL, print_loop(), and print_loop_and_siblings().
Referenced by print_loop(), print_loop_and_siblings(), and print_loops().
void print_loop_info | ( | FILE * | file, |
const class loop * | loop, | ||
const char * | prefix ) |
Print loop information.
References loop::any_estimate, loop::any_likely_upper_bound, loop::any_upper_bound, loop::can_be_parallel, cfun, loop::dont_vectorize, profile_count::dump(), expected_loop_iterations_by_profile(), loop::finite_p, loop::force_vectorize, loop::in_oacc_kernels_region, loop_count_in(), maybe_flat_loop_profile(), loop::nb_iterations, loop::nb_iterations_estimate, loop::nb_iterations_likely_upper_bound, loop::nb_iterations_upper_bound, loop::num, print_decu(), print_generic_expr(), sreal::to_double(), loop::unroll, and loop::warned_aggressive_loop_optimizations.
Referenced by flow_loop_dump(), and print_loop().
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().
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().
|
static |
Print no_sanitize attribute to FILE for a given attribute VALUE.
References i, sanitizer_opts_s::name, NULL, sanitizer_opts, and tree_to_uhwi().
Referenced by dump_function_to_file().
|
static |
Print on FILE the indexes for the predecessors of basic_block BB.
References FOR_EACH_EDGE, and basic_block_def::preds.
Referenced by print_loops_bb().
|
static |
Print on FILE the indexes for the successors of basic_block BB.
References FOR_EACH_EDGE, and basic_block_def::succs.
Referenced by print_loops_bb().
|
static |
Return nonzero if we are recording information for case labels.
References edge_to_cases, and NULL.
Referenced by get_cases_for_edge().
|
static |
Remove statements of basic block BB.
References BASIC_BLOCK_FOR_FN, bb_seq(), bb_to_omp_idx, cfun, current_loops, DECL_NONLOCAL, dump_bb(), dump_file, dump_flags, dyn_cast(), ENTRY_BLOCK_PTR_FOR_FN, FOR_EACH_VEC_ELT, FORCED_LABEL, free_numbers_of_iterations_estimates(), gcc_assert, basic_block_def::basic_block_il_dependent::gimple, gimple_label_label(), gsi_after_labels(), gsi_end_p(), gsi_insert_before(), gsi_last_bb(), GSI_NEW_STMT, gsi_prev(), gsi_remove(), gsi_stmt(), loop::header, i, basic_block_def::il, basic_block_def::index, loop::latch, basic_block_def::loop_father, NULL, NUM_FIXED_BLOCKS, gimple_bb_info::phi_nodes, basic_block_def::prev_bb, release_defs(), remove_phi_nodes_and_edges_for_unreachable_block(), gimple_bb_info::seq, single_succ(), TDF_BLOCKS, and TDF_DETAILS.
void remove_edge_and_dominated_blocks | ( | edge | e | ) |
Removes edge E and all the blocks dominated by it, and updates dominance information. The IL in E->src needs to be updated separately. If dominance info is not available, only the edge E is removed.
References BASIC_BLOCK_FOR_FN, bitmap_clear_bit(), bitmap_ior_into(), bitmap_set_bit, CDI_DOMINATORS, cfgcleanup_altered_bbs, cfun, current_loops, delete_basic_block(), df, dom_info_available_p(), dominated_by_p(), EXECUTE_IF_SET_IN_BITMAP, EXIT_BLOCK_PTR_FOR_FN, first_dom_son(), flow_loop_nested_p(), FOR_EACH_EDGE, FOR_EACH_VEC_ELT, free_numbers_of_iterations_estimates(), get_all_dominated_blocks(), get_immediate_dominator(), loop::header, i, basic_block_def::index, iterate_fix_dominators(), loop_outer(), LOOPS_NEED_FIXUP, loops_state_set(), mark_loop_for_removal(), next_dom_son(), NULL, basic_block_def::preds, remove_edge(), basic_block_def::succs, and vNULL.
Referenced by cleanup_control_expr_graph(), cleanup_control_flow_bb(), expand_omp_taskloop_for_inner(), expand_omp_taskreg(), gimple_purge_dead_abnormal_call_edges(), gimple_purge_dead_eh_edges(), group_case_labels_stmt(), and remove_fallthru_edge().
|
static |
Remove PHI nodes associated with basic block BB and all edges out of BB.
References EDGE_COUNT, EDGE_SUCC, remove_edge(), remove_phi_nodes(), and basic_block_def::succs.
Referenced by remove_bb().
|
static |
Change DECL_CONTEXT of all BLOCK_VARS in block, including subblocks.
References BLOCK_CHAIN, BLOCK_SUBBLOCKS, BLOCK_VARS, DECL_CHAIN, DECL_HAS_VALUE_EXPR_P, DECL_VALUE_EXPR, NULL, replace_block_vars_by_duplicates(), replace_block_vars_by_duplicates_1(), replace_by_duplicate_decl(), SET_DECL_VALUE_EXPR, replace_decls_d::to_context, TREE_CODE, unshare_expr(), VAR_P, replace_decls_d::vars_map, and walk_tree.
Referenced by move_sese_region_to_fn(), and replace_block_vars_by_duplicates().
|
static |
Tree walker to replace the decls used inside value expressions by duplicates.
References IS_TYPE_OR_DECL_P, NULL, replace_by_duplicate_decl(), replace_decls_d::to_context, TREE_CODE, and replace_decls_d::vars_map.
Referenced by replace_block_vars_by_duplicates().
|
static |
Replaces *TP with a duplicate (belonging to function TO_CONTEXT). The duplicates are recorded in VARS_MAP.
References add_local_decl(), copy_node(), copy_var_decl(), DECL_CONTEXT, DECL_NAME, DECL_STRUCT_FUNCTION, gcc_assert, hash_map< KeyId, Value, Traits >::get_or_insert(), SSA_VAR_P, TREE_CODE, and TREE_TYPE.
Referenced by move_sese_region_to_fn(), move_stmt_op(), replace_block_vars_by_duplicates(), replace_block_vars_by_duplicates_1(), and replace_ssa_name().
|
static |
Look for ANNOTATE calls with loop annotation kind; if found, remove them and propagate the information to the loop. We assume that the annotations come immediately before the condition of the loop.
References annot_expr_ivdep_kind, annot_expr_maybe_infinite_kind, annot_expr_no_vector_kind, annot_expr_parallel_kind, annot_expr_unroll_kind, annot_expr_vector_kind, cfun, loop::finite_p, FOR_EACH_BB_FN, gcc_unreachable, get_loop_exit_edges(), gimple_build_assign(), gimple_call_arg(), gimple_call_internal_fn(), gimple_call_internal_p(), gimple_call_lhs(), gimple_location(), gsi_end_p(), gsi_last_bb(), gsi_prev(), gsi_replace(), gsi_stmt(), replace_loop_annotate_in_block(), tree_to_shwi(), and warning_at().
Referenced by execute_build_cfg().
|
static |
Look for ANNOTATE calls with loop annotation kind in BB; if found, remove them and propagate the information to LOOP. We assume that the annotations come immediately before the condition in BB, if any.
References annot_expr_ivdep_kind, annot_expr_maybe_infinite_kind, annot_expr_no_vector_kind, annot_expr_parallel_kind, annot_expr_unroll_kind, annot_expr_vector_kind, loop::can_be_parallel, cfun, loop::dont_vectorize, loop::finite_p, loop::force_vectorize, gcc_unreachable, gimple_build_assign(), gimple_call_arg(), gimple_call_internal_fn(), gimple_call_internal_p(), gimple_call_lhs(), gsi_end_p(), gsi_last_bb(), gsi_prev(), gsi_prev_nondebug(), gsi_replace(), gsi_stmt(), INT_MAX, loop::safelen, tree_to_shwi(), and loop::unroll.
Referenced by replace_loop_annotate().
|
static |
Creates an ssa name in TO_CONTEXT equivalent to NAME. VARS_MAP maps old ssa names and var_decls to the new ones.
References copy_ssa_name_fn(), DECL_STRUCT_FUNCTION, gcc_assert, hash_map< KeyId, Value, Traits >::get(), make_ssa_name_fn(), NULL, hash_map< KeyId, Value, Traits >::put(), replace_by_duplicate_decl(), SSA_NAME_DEF_STMT, SSA_NAME_IS_DEFAULT_DEF, SSA_NAME_VAR, and virtual_operand_p().
Referenced by move_block_to_fn(), and move_stmt_op().
Replaces all uses of NAME by VAL.
References as_a(), bitmap_set_bit, cfgcleanup_altered_bbs, cfun, current_loops, fold_stmt(), FOR_EACH_IMM_USE_ON_STMT, FOR_EACH_IMM_USE_STMT, gcc_checking_assert, gimple_bb(), gimple_num_ops(), gimple_op(), gimple_phi_arg_edge(), gimple_purge_dead_eh_edges(), gsi_for_stmt(), gsi_stmt(), has_zero_uses(), i, is_gimple_min_invariant(), maybe_clean_or_replace_eh_stmt(), PHI_ARG_INDEX_FROM_USE, recompute_tree_invariant_for_addr_expr(), replace_exp(), SSA_NAME_OCCURS_IN_ABNORMAL_PHI, stmt_ends_bb_p(), substitute_in_loop_info(), TREE_CODE, update_stmt(), and virtual_operand_p().
Referenced by adjust_simduid_builtins(), clean_up_loop_closed_phi(), create_call_for_reduction_1(), execute_cse_conv_1(), execute_oacc_device_lower(), final_value_replacement_loop(), gimple_merge_blocks(), oacc_entry_exit_single_gang(), object_sizes_execute(), optimize_atomic_bit_test_and(), ipa_param_body_adjustments::replace_removed_params_ssa_names(), scc_copy_prop::replace_scc_by_value(), shrink_wrap_one_built_in_call_with_conds(), spaceship_replacement(), tree_if_conversion(), and vect_loop_versioning().
|
static |
Return TRUE if LOCUS1 and LOCUS2 refer to the same source line.
References expand_location(), and NULL.
Referenced by assign_discriminator(), and assign_discriminators().
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().
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().
unsigned int split_critical_edges | ( | bool | for_edge_insertion_p | ) |
Split all critical edges. Split some extra (not necessarily critical) edges if FOR_EDGE_INSERTION_P is true.
References cfun, EDGE_CRITICAL_P, end_recording_case_labels(), ENTRY_BLOCK_PTR_FOR_FN, EXIT_BLOCK_PTR_FOR_FN, FOR_ALL_BB_FN, FOR_EACH_EDGE, gimple_call_builtin_p(), gimple_seq_empty_p(), gsi_end_p(), gsi_last_bb(), gsi_stmt(), phi_nodes(), single_pred_p(), split_edge(), start_recording_case_labels(), stmt_ends_bb_p(), and basic_block_def::succs.
Referenced by split_edges_for_insertion().
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().
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().
Return true if T can make an abnormal transfer of control flow. Transfers of control flow associated with EH are excluded.
References call_can_make_abnormal_goto(), computed_goto_p(), and is_gimple_call().
Referenced by substitute_and_fold_dom_walker::before_dom_children(), copy_cfg_body(), copy_edges_for_bb(), delete_dead_or_redundant_assignment(), eliminate_dom_walker::eliminate_cleanup(), eliminate_dom_walker::eliminate_stmt(), eliminate_unnecessary_stmts(), gimple_purge_dead_abnormal_call_edges(), make_blocks_1(), make_edges_bb(), and maybe_move_debug_stmts_to_successors().
Return true if statement T may terminate execution of BB in ways not explicitly represtented in the CFG.
References cfun, dyn_cast(), ECF_CONST, ECF_LOOPING_CONST_OR_PURE, ECF_NORETURN, ECF_NOTHROW, ECF_PURE, ECF_RETURNS_TWICE, fndecl_built_in_p(), FOR_EACH_EDGE, gimple_asm_basic_p(), gimple_asm_volatile_p(), gimple_bb(), gimple_call_flags(), gimple_call_fndecl(), is_gimple_call(), NULL_TREE, stmt_can_throw_external(), and basic_block_def::succs.
Referenced by determine_unlikely_bbs(), force_edge_cold(), gimple_flow_call_edges_add(), isolate_path(), loop_only_exit_p(), unlikely_executed_bb_p(), and want_merge_blocks_p().
Return true if T should end a basic block.
References is_ctrl_altering_stmt(), and is_ctrl_stmt().
Referenced by abnormal_edge_after_stmt_p(), ranger_cache::apply_inferred_ranges(), arith_overflow_check_p(), avoid_deep_ter_for_debug(), can_guard_call_p(), ccp_initialize(), compute_avail(), create_new_iv(), disqualify_if_bad_bb_terminating_stmt(), do_hoist_insertion(), expand_call_inline(), gimple_can_merge_blocks_p(), gimple_duplicate_sese_tail(), gimple_find_edge_insert_loc(), gimple_ic(), gimple_lower_bitint(), gimple_merge_blocks(), gimple_verify_flow_info(), gsi_insert_finally_seq_after_call(), if_convertible_gimple_assign_stmt_p(), init_copy_prop(), init_dont_simulate_again(), insert_backedge_copies(), insert_gimplified_predicates(), insert_initializers(), insert_stmt_after(), insert_trap(), instrument_bool_enum_load(), make_blocks_1(), make_edges_bb(), maybe_register_def(), move_debug_stmts_from_forwarder(), movement_possibility_1(), replace_uses_by(), rewrite_stmt(), scan_function(), shrink_wrap_one_built_in_call_with_conds(), simplify_builtin_call(), ssa_propagation_engine::simulate_stmt(), split_critical_edges(), sra_modify_assign(), sra_modify_call_arg(), sra_modify_expr(), ssa_create_duplicates(), statement_sink_location(), use_internal_fn(), vect_create_constant_vectors(), and vect_transform_cycle_phi().
Various helpers.
Return true if STMT should start a new basic block. PREV_STMT is the statement preceding STMT. It is used when STMT is a label or a case label. Labels should only start a new basic block if their previous statement wasn't a label. Otherwise, sequence of labels would generate unnecessary basic blocks that only contain a single label.
References cfg_stats, DECL_ARTIFICIAL, DECL_NONLOCAL, dyn_cast(), ECF_RETURNS_TWICE, FORCED_LABEL, gimple_call_flags(), gimple_call_internal_p(), gimple_label_label(), is_gimple_debug(), NULL, cfg_stats_d::num_merged_labels, and safe_dyn_cast().
Referenced by make_blocks_1().
Return true when the T can be shared.
References error_mark_node, is_gimple_min_invariant(), IS_TYPE_OR_DECL_P, and TREE_CODE.
Referenced by verify_node_sharing_1().
Return true if TYPE1 is a fixed-point type and if conversions to and from TYPE2 can be handled by FIXED_CONVERT_EXPR.
References FIXED_POINT_TYPE_P, INTEGRAL_TYPE_P, and SCALAR_FLOAT_TYPE_P.
Referenced by verify_gimple_assign_unary().
Verify properties of the address expression T whose base should be TREE_ADDRESSABLE if VERIFY_ADDRESSABLE is true.
References error(), handled_component_p(), recompute_tree_invariant_for_addr_expr(), TREE_ADDRESSABLE, TREE_CODE, TREE_CONSTANT, TREE_OPERAND, TREE_SIDE_EFFECTS, and VAR_P.
Referenced by verify_gimple_assign_single(), and verify_types_in_gimple_reference().
bool verify_eh_throw_stmt_node | ( | gimple *const & | stmt, |
const int & | , | ||
hash_set< gimple * > * | visited ) |
References debug_gimple_stmt(), eh_error_found, error(), walk_stmt_info::stmt, and visited.
Referenced by verify_gimple_in_cfg().
Called via walk_gimple_op. Verify locations of expressions.
References verify_expr_location_1().
Referenced by verify_gimple_in_cfg().
Called via walk_tree. Verify locations of expressions.
References cfun, DECL_DEBUG_EXPR, DECL_EXTERNAL, decl_function_context(), DECL_HAS_DEBUG_EXPR_P, DECL_HAS_VALUE_EXPR_P, DECL_VALUE_EXPR, error(), EXPR_LOCATION, EXPR_P, NULL, SCOPE_FILE_SCOPE_P, TREE_CODE, TREE_STATIC, VAR_P, verify_expr_no_block(), verify_location(), and walk_tree.
Referenced by verify_expr_location(), and verify_gimple_in_cfg().
Called via walk_tree. Verify that expressions have no blocks.
References EXPR_LOCATION, EXPR_P, LOCATION_BLOCK, and NULL.
Referenced by verify_expr_location_1().
Verify the contents of a GIMPLE_ASSIGN STMT. Returns true when there is a problem, otherwise false.
References debug_generic_stmt(), error(), gcc_unreachable, gimple_assign_lhs(), gimple_assign_nontemporal_move_p(), gimple_assign_rhs_class(), GIMPLE_BINARY_RHS, GIMPLE_SINGLE_RHS, GIMPLE_TERNARY_RHS, GIMPLE_UNARY_RHS, is_gimple_reg(), verify_gimple_assign_binary(), verify_gimple_assign_single(), verify_gimple_assign_ternary(), and verify_gimple_assign_unary().
Referenced by verify_gimple_stmt().
Verify a gimple assignment statement STMT with a binary rhs. Returns true if anything is wrong.
References debug_generic_expr(), debug_generic_stmt(), element_mode(), error(), FIXED_POINT_TYPE_P, gcc_unreachable, GET_MODE_SIZE(), get_tree_code_name(), gimple_assign_lhs(), gimple_assign_rhs1(), gimple_assign_rhs2(), gimple_assign_rhs_code(), INTEGRAL_TYPE_P, is_gimple_reg(), is_gimple_val(), known_eq, POINTER_TYPE_P, ptrofftype_p(), SCALAR_FLOAT_TYPE_P, TREE_CODE, TREE_TYPE, TYPE_MODE, TYPE_PRECISION, TYPE_UNSIGNED, TYPE_VECTOR_SUBPARTS(), types_compatible_p(), useless_type_conversion_p(), VECTOR_BOOLEAN_TYPE_P, VECTOR_TYPE_P, and verify_gimple_comparison().
Referenced by verify_gimple_assign().
Verify a gimple assignment statement STMT with a single rhs. Returns true if anything is wrong.
References compare_tree_int(), CONSTRUCTOR_ELTS, CONSTRUCTOR_NELTS, debug_generic_expr(), debug_generic_stmt(), DECL_P, error(), FOR_EACH_CONSTRUCTOR_ELT, get_tree_code_name(), gimple_assign_lhs(), gimple_assign_rhs1(), gimple_assign_rhs_code(), gimple_clobber_p(), handled_component_p(), i, is_gimple_addressable(), is_gimple_reg(), is_gimple_reg_type(), is_gimple_val(), maybe_gt, NULL_TREE, one_pointer_to_useless_type_conversion_p(), TREE_CODE, TREE_OPERAND, TREE_TYPE, TYPE_VECTOR_SUBPARTS(), types_compatible_p(), useless_type_conversion_p(), VECTOR_TYPE_P, verify_address(), and verify_types_in_gimple_reference().
Referenced by verify_gimple_assign().
Verify a gimple assignment statement STMT with a ternary rhs. Returns true if anything is wrong.
References bitsizetype, debug_generic_expr(), element_mode(), error(), FIXED_POINT_TYPE_P, gcc_unreachable, GET_MODE_BITSIZE(), GET_MODE_SIZE(), GET_MODE_UNIT_BITSIZE, get_tree_code_name(), gimple_assign_lhs(), gimple_assign_rhs1(), gimple_assign_rhs2(), gimple_assign_rhs3(), gimple_assign_rhs_code(), INTEGRAL_TYPE_P, is_gimple_reg(), is_gimple_val(), SCALAR_FLOAT_TYPE_P, SCALAR_INT_TYPE_MODE, SCALAR_TYPE_MODE, wi::to_poly_offset(), TREE_CODE, TREE_CONSTANT, tree_fits_uhwi_p(), tree_nop_conversion_p(), tree_to_uhwi(), TREE_TYPE, type_has_mode_precision_p(), TYPE_MODE, TYPE_PRECISION, TYPE_SIZE, TYPE_VECTOR_SUBPARTS(), types_compatible_p(), useless_type_conversion_p(), VECTOR_BOOLEAN_TYPE_P, and VECTOR_TYPE_P.
Referenced by verify_gimple_assign().
Verify a gimple assignment statement STMT with an unary rhs. Returns true if anything is wrong.
References ANY_INTEGRAL_TYPE_P, BITS_PER_WORD, CASE_CONVERT, debug_generic_expr(), element_mode(), element_precision(), error(), gcc_unreachable, GET_MODE_PRECISION(), GET_MODE_SIZE(), get_tree_code_name(), gimple_assign_lhs(), gimple_assign_rhs1(), gimple_assign_rhs_code(), INTEGRAL_TYPE_P, is_gimple_reg(), is_gimple_val(), known_eq, POINTER_TYPE_P, ptr_mode, SCALAR_FLOAT_TYPE_P, TREE_CODE, TREE_TYPE, TYPE_ADDR_SPACE, TYPE_MODE, TYPE_PRECISION, TYPE_UNSIGNED, TYPE_VECTOR_SUBPARTS(), useless_type_conversion_p(), valid_fixed_convert_types_p(), VECTOR_BOOLEAN_TYPE_P, VECTOR_FLOAT_TYPE_P, VECTOR_INTEGER_TYPE_P, and VECTOR_TYPE_P.
Referenced by verify_gimple_assign().
Verify the contents of a GIMPLE_CALL STMT. Returns true when there is a problem, otherwise false.
References BUILT_IN_NORMAL, debug_generic_expr(), debug_generic_stmt(), DECL_FUNCTION_CODE(), DECL_LOOPING_CONST_OR_PURE_P, DECL_PURE_P, DECL_STATIC_CHAIN, error(), fndecl_built_in_p(), gimple_call_arg(), gimple_call_chain(), gimple_call_ctrl_altering_p(), gimple_call_fn(), gimple_call_fndecl(), gimple_call_fntype(), gimple_call_internal_p(), gimple_call_lhs(), gimple_call_noreturn_p(), gimple_call_num_args(), i, is_gimple_call_addr(), is_gimple_lvalue(), is_gimple_reg(), is_gimple_reg_type(), is_gimple_val(), POINTER_TYPE_P, poly_int_tree_p(), should_remove_lhs_p(), SSA_NAME_VAR, TREE_CODE, TREE_OPERAND, TREE_READONLY, TREE_TYPE, TYPE_SIZE_UNIT, useless_type_conversion_p(), and verify_types_in_gimple_reference().
Referenced by verify_gimple_stmt().
Verifies the gimple comparison with the result type TYPE and the operands OP0 and OP1, comparison code is CODE.
References debug_generic_expr(), error(), INTEGRAL_TYPE_P, is_gimple_val(), TREE_CODE, TREE_TYPE, TYPE_PRECISION, TYPE_VECTOR_SUBPARTS(), useless_type_conversion_p(), VECTOR_BOOLEAN_TYPE_P, VECTOR_INTEGER_TYPE_P, and VECTOR_TYPE_P.
Referenced by verify_gimple_assign_binary(), and verify_gimple_cond().
Verify a gimple cond statement STMT. Returns true if anything is wrong.
References boolean_type_node, error(), gimple_cond_code(), gimple_cond_false_label(), gimple_cond_lhs(), gimple_cond_rhs(), gimple_cond_true_label(), tcc_comparison, TREE_CODE, TREE_CODE_CLASS, and verify_gimple_comparison().
Referenced by verify_gimple_stmt().
Verify a gimple debug statement STMT. Returns true if anything is wrong.
Referenced by verify_gimple_stmt().
Verify the contents of a GIMPLE_GOTO STMT. Returns true when there is a problem, otherwise false.
References edge_def::dest, error(), gimple_goto_dest(), is_gimple_val(), POINTER_TYPE_P, TREE_CODE, and TREE_TYPE.
Referenced by verify_gimple_stmt().
DEBUG_FUNCTION bool verify_gimple_in_cfg | ( | struct function * | fn, |
bool | verify_nothrow, | ||
bool | ice ) |
Disable warnings about missing quoting in GCC diagnostics for the verification errors. Their format strings don't follow GCC diagnostic conventions and trigger an ICE in the end.
Verify the GIMPLE statements in the CFG of FN.
References hash_set< KeyId, Lazy, Traits >::add(), cfun, collect_subblocks(), debug_generic_expr(), debug_gimple_stmt(), function::decl, DECL_INITIAL, eh_error_found, error(), FOR_EACH_BB_FN, FOR_EACH_EDGE, get_eh_throw_stmt_table(), gimple_bb(), gimple_location(), gimple_phi_arg_def(), gimple_phi_arg_location(), gimple_phi_num_args(), gimple_phi_result(), walk_stmt_info::gsi, gsi_end_p(), gsi_next(), gsi_one_before_end_p(), gsi_start_bb(), gsi_start_phis(), gsi_stmt(), i, internal_error(), lookup_stmt_eh_lp(), NULL, walk_stmt_info::stmt, stmt_could_throw_p(), basic_block_def::succs, timevar_pop(), timevar_push(), hash_map< KeyId, Value, Traits >::traverse(), UNKNOWN_LOCATION, verify_eh_throw_stmt_node(), verify_expr_location(), verify_expr_location_1(), verify_gimple_phi(), verify_gimple_stmt(), verify_histograms(), verify_location(), verify_node_sharing(), verify_node_sharing_1(), virtual_operand_p(), visited, walk_gimple_op(), and walk_tree.
Referenced by execute_function_todo().
DEBUG_FUNCTION 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().
|
static |
Verify the GIMPLE statements inside the sequence STMTS.
References as_a(), debug_gimple_stmt(), gimple_assume_body(), gimple_bind_body(), gimple_catch_handler(), gimple_eh_else_e_body(), gimple_eh_else_n_body(), gimple_eh_filter_failure(), gimple_try_cleanup(), gimple_try_eval(), gsi_end_p(), gsi_next(), gsi_start(), gsi_stmt(), verify_gimple_in_seq_2(), verify_gimple_stmt(), and verify_gimple_transaction().
Referenced by verify_gimple_in_seq(), verify_gimple_in_seq_2(), and verify_gimple_transaction().
Verify a gimple label statement STMT. Returns true if anything is wrong.
References cfun, current_function_decl, DECL_CONTEXT, DECL_NONLOCAL, EH_LANDING_PAD_NR, error(), FORCED_LABEL, get_eh_landing_pad_from_number(), gimple_bb(), gimple_label_label(), LABEL_DECL_UID, label_to_block_map_for_fn, eh_landing_pad_d::post_landing_pad, and TREE_CODE.
Referenced by verify_gimple_stmt().
Verify the contents of a GIMPLE_PHI. Returns true if there is a problem, and false otherwise.
References cfun, debug_generic_expr(), debug_generic_stmt(), error(), gimple_phi_arg_def(), gimple_phi_num_args(), gimple_phi_result(), gimple_vop(), i, is_gimple_val(), SSA_NAME_VAR, TREE_CODE, TREE_TYPE, useless_type_conversion_p(), and virtual_operand_p().
Referenced by verify_gimple_in_cfg().
Verify the contents of a GIMPLE_RETURN STMT. Returns true when there is a problem, otherwise false.
References cfun, debug_generic_stmt(), DECL_BY_REFERENCE, error(), gimple_return_retval(), is_gimple_val(), NULL, SSA_NAME_VAR, TREE_CODE, TREE_TYPE, and useless_type_conversion_p().
Referenced by verify_gimple_stmt().
Verify the GIMPLE statement STMT. Returns true if there is an error, otherwise false.
References as_a(), CASE_GIMPLE_OMP, gcc_unreachable, verify_gimple_assign(), verify_gimple_call(), verify_gimple_cond(), verify_gimple_debug(), verify_gimple_goto(), verify_gimple_label(), verify_gimple_return(), verify_gimple_switch(), and verify_gimple_transaction().
Referenced by verify_gimple_in_cfg(), and verify_gimple_in_seq_2().
Verify the contents of a GIMPLE_SWITCH STMT. Returns true when there is a problem, otherwise false.
References CASE_CHAIN, CASE_HIGH, CASE_LOW, debug_generic_expr(), debug_generic_stmt(), error(), gimple_switch_index(), gimple_switch_label(), gimple_switch_num_labels(), i, INTEGRAL_TYPE_P, is_gimple_val(), NULL_TREE, tree_int_cst_lt(), TREE_TYPE, and TYPE_PRECISION.
Referenced by verify_gimple_stmt().
|
static |
Verify the contents of a GIMPLE_TRANSACTION. Returns true if there is a problem, otherwise false.
References gimple_transaction_body(), gimple_transaction_label_norm(), gimple_transaction_label_over(), gimple_transaction_label_uninst(), NULL, TREE_CODE, and verify_gimple_in_seq_2().
Referenced by verify_gimple_in_seq_2(), and verify_gimple_stmt().
Verify if the location LOCs block is in BLOCKS.
References BLOCK_SOURCE_LOCATION, hash_set< KeyId, Lazy, Traits >::contains(), error(), LOCATION_BLOCK, NULL_TREE, and verify_location().
Referenced by verify_expr_location_1(), verify_gimple_in_cfg(), and verify_location().
Called via walk_gimple_stmt. Verify tree sharing.
References verify_node_sharing_1().
Referenced by verify_gimple_in_cfg().
Called via walk_tree. Verify tree sharing.
References NULL, tree_node_can_be_shared(), and visited.
Referenced by verify_gimple_in_cfg(), and verify_node_sharing().
DEBUG_FUNCTION 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().
Verify if EXPR is a valid GIMPLE reference expression. If REQUIRE_LVALUE is true verifies it is an lvalue. Returns true if there is an error, otherwise false.
References AGGREGATE_TYPE_P, bitsizetype, cfun, debug_generic_stmt(), error(), GET_MODE_BITSIZE(), get_tree_code_name(), handled_component_p(), INDIRECT_REF_P, INTEGRAL_TYPE_P, is_gimple_id(), is_gimple_mem_ref_addr(), is_gimple_min_invariant(), is_gimple_reg(), is_gimple_reg_type(), is_gimple_val(), maybe_gt, MR_DEPENDENCE_CLIQUE, POINTER_TYPE_P, poly_int_tree_p(), TMR_BASE, TMR_OFFSET, TREE_CODE, TREE_OPERAND, tree_to_poly_uint64(), TREE_TYPE, type_has_mode_precision_p(), TYPE_MODE, TYPE_PRECISION, TYPE_SIZE, types_compatible_p(), useless_type_conversion_p(), and verify_address().
Referenced by verify_gimple_assign_single(), and verify_gimple_call().
|
static |
OpenMP region idxs for blocks during cfg pass.
Referenced by execute_build_cfg(), handle_abnormal_edges(), make_edges(), and remove_bb().
|
static |
Referenced by build_gimple_cfg(), dump_cfg_stats(), and stmt_starts_bb_p().
|
static |
Referenced by build_gimple_cfg(), and next_discriminator_for_locus().
This hash table allows us to efficiently lookup all CASE_LABEL_EXPRs which use a particular edge. The CASE_LABEL_EXPRs are chained together via their CASE_CHAIN field, which we clear after we're done with the hash table to prevent problems with duplication of GIMPLE_SWITCHes. Access to this list of CASE_LABEL_EXPRs allows us to efficiently update the case vector in response to edge redirections. Right now this table is set up and torn down at key points in the compilation process. It would be nice if we could make the table more persistent. The key is getting notification of changes to the CFG (particularly edge removal, creation and redirection).
Referenced by end_recording_case_labels(), get_cases_for_edge(), recording_case_labels_p(), and start_recording_case_labels().
|
static |
Referenced by verify_eh_throw_stmt_node(), and verify_gimple_in_cfg().
struct cfg_hooks gimple_cfg_hooks |
Hooks containers.
Referenced by current_ir_type(), and gimple_register_cfg_hooks().
|
static |
Control flow functions 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 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 functions for building the Control Flow Graph (CFG) for a function tree.
Local declarations.
Initial capacity for the basic block array.
Referenced by init_empty_tree_cfg_for_function().
|
static |
If we record edge_to_cases, this bitmap will hold indexes of basic blocks that end in a GIMPLE_SWITCH which we touched due to edge manipulations.
Referenced by end_recording_case_labels(), gimple_redirect_edge_and_branch(), and start_recording_case_labels().