GCC Middle and Back End API Reference
|
#include "predict.h"
#include "vec.h"
#include "function.h"
#include "cfg-flags.def"
#include "cfghooks.h"
Go to the source code of this file.
Data Structures | |
struct | edge_def |
union | edge_def::edge_def_insns |
struct | profile_record |
struct | rtl_bb_info |
struct | gimple_bb_info |
struct | basic_block_def |
union | basic_block_def::basic_block_il_dependent |
struct | control_flow_graph |
struct | ce_if_block |
struct | edge_list |
class | control_dependences |
struct | edge_iterator |
Macros | |
#define | DEF_EDGE_FLAG(NAME, IDX) EDGE_##NAME = 1 << IDX , |
#define | EDGE_ALL_FLAGS ((LAST_CFG_EDGE_FLAG - 1) * 2 - 1) |
#define | EDGE_COMPLEX (EDGE_ABNORMAL | EDGE_ABNORMAL_CALL | EDGE_EH | EDGE_PRESERVE) |
#define | BB_FREQ_MAX 10000 |
#define | DEF_BASIC_BLOCK_FLAG(NAME, IDX) BB_##NAME = 1 << IDX , |
#define | BB_ALL_FLAGS ((LAST_CFG_BB_FLAG - 1) * 2 - 1) |
#define | BB_FLAGS_TO_PRESERVE |
#define | BB_UNPARTITIONED 0 |
#define | BB_PARTITION(bb) ((bb)->flags & (BB_HOT_PARTITION|BB_COLD_PARTITION)) |
#define | BB_SET_PARTITION(bb, part) |
#define | BB_COPY_PARTITION(dstbb, srcbb) BB_SET_PARTITION (dstbb, BB_PARTITION (srcbb)) |
#define | ENTRY_BLOCK_PTR_FOR_FUNCTION(FN) ((FN)->cfg->x_entry_block_ptr) |
#define | EXIT_BLOCK_PTR_FOR_FUNCTION(FN) ((FN)->cfg->x_exit_block_ptr) |
#define | basic_block_info_for_function(FN) ((FN)->cfg->x_basic_block_info) |
#define | n_basic_blocks_for_function(FN) ((FN)->cfg->x_n_basic_blocks) |
#define | n_edges_for_function(FN) ((FN)->cfg->x_n_edges) |
#define | last_basic_block_for_function(FN) ((FN)->cfg->x_last_basic_block) |
#define | label_to_block_map_for_function(FN) ((FN)->cfg->x_label_to_block_map) |
#define | profile_status_for_function(FN) ((FN)->cfg->x_profile_status) |
#define | BASIC_BLOCK_FOR_FUNCTION(FN, N) ((*basic_block_info_for_function (FN))[(N)]) |
#define | SET_BASIC_BLOCK_FOR_FUNCTION(FN, N, BB) ((*basic_block_info_for_function (FN))[(N)] = (BB)) |
#define | ENTRY_BLOCK_PTR (cfun->cfg->x_entry_block_ptr) |
#define | EXIT_BLOCK_PTR (cfun->cfg->x_exit_block_ptr) |
#define | basic_block_info (cfun->cfg->x_basic_block_info) |
#define | n_basic_blocks (cfun->cfg->x_n_basic_blocks) |
#define | n_edges (cfun->cfg->x_n_edges) |
#define | last_basic_block (cfun->cfg->x_last_basic_block) |
#define | label_to_block_map (cfun->cfg->x_label_to_block_map) |
#define | profile_status (cfun->cfg->x_profile_status) |
#define | BASIC_BLOCK(N) ((*basic_block_info)[(N)]) |
#define | SET_BASIC_BLOCK(N, BB) ((*basic_block_info)[(N)] = (BB)) |
#define | FOR_BB_BETWEEN(BB, FROM, TO, DIR) for (BB = FROM; BB != TO; BB = BB->DIR) |
#define | FOR_EACH_BB_FN(BB, FN) FOR_BB_BETWEEN (BB, (FN)->cfg->x_entry_block_ptr->next_bb, (FN)->cfg->x_exit_block_ptr, next_bb) |
#define | FOR_EACH_BB(BB) FOR_EACH_BB_FN (BB, cfun) |
#define | FOR_EACH_BB_REVERSE_FN(BB, FN) FOR_BB_BETWEEN (BB, (FN)->cfg->x_exit_block_ptr->prev_bb, (FN)->cfg->x_entry_block_ptr, prev_bb) |
#define | FOR_EACH_BB_REVERSE(BB) FOR_EACH_BB_REVERSE_FN (BB, cfun) |
#define | FOR_BB_INSNS(BB, INSN) |
#define | FOR_BB_INSNS_SAFE(BB, INSN, CURR) |
#define | FOR_BB_INSNS_REVERSE(BB, INSN) |
#define | FOR_BB_INSNS_REVERSE_SAFE(BB, INSN, CURR) |
#define | FOR_ALL_BB(BB) for (BB = ENTRY_BLOCK_PTR; BB; BB = BB->next_bb) |
#define | FOR_ALL_BB_FN(BB, FN) for (BB = ENTRY_BLOCK_PTR_FOR_FUNCTION (FN); BB; BB = BB->next_bb) |
#define | BB_HEAD(B) (B)->il.x.head_ |
#define | BB_END(B) (B)->il.x.rtl->end_ |
#define | BB_HEADER(B) (B)->il.x.rtl->header_ |
#define | BB_FOOTER(B) (B)->il.x.rtl->footer_ |
#define | ENTRY_BLOCK (0) |
#define | EXIT_BLOCK (1) |
#define | NUM_FIXED_BLOCKS (2) |
#define | set_block_for_insn(INSN, BB) (BLOCK_FOR_INSN (INSN) = BB) |
#define | REG_BR_PROB_BASE 10000 |
#define | EDGE_INDEX_NO_EDGE -1 |
#define | EDGE_INDEX(el, pred, succ) (find_edge_index ((el), (pred), (succ))) |
#define | INDEX_EDGE_PRED_BB(el, index) ((el)->index_to_edge[(index)]->src) |
#define | INDEX_EDGE_SUCC_BB(el, index) ((el)->index_to_edge[(index)]->dest) |
#define | INDEX_EDGE(el, index) ((el)->index_to_edge[(index)]) |
#define | NUM_EDGES(el) ((el)->num_edges) |
#define | FALLTHRU_EDGE(bb) |
#define | BRANCH_EDGE(bb) |
#define | RDIV(X, Y) (((X) + (Y) / 2) / (Y)) |
#define | EDGE_FREQUENCY(e) |
#define | GCOV_COMPUTE_SCALE(num, den) ((den) ? RDIV ((num) * REG_BR_PROB_BASE, (den)) : REG_BR_PROB_BASE) |
#define | EDGE_CRITICAL_P(e) |
#define | EDGE_COUNT(ev) vec_safe_length (ev) |
#define | EDGE_I(ev, i) (*ev)[(i)] |
#define | EDGE_PRED(bb, i) (*(bb)->preds)[(i)] |
#define | EDGE_SUCC(bb, i) (*(bb)->succs)[(i)] |
#define | ei_start(iter) ei_start_1 (&(iter)) |
#define | ei_last(iter) ei_last_1 (&(iter)) |
#define | FOR_EACH_EDGE(EDGE, ITER, EDGE_VEC) |
#define | CLEANUP_EXPENSIVE |
#define | CLEANUP_CROSSJUMP 2 /* Do crossjumping. */ |
#define | CLEANUP_POST_REGSTACK |
#define | CLEANUP_THREADING 8 /* Do jump threading. */ |
#define | CLEANUP_NO_INSN_DEL |
#define | CLEANUP_CFGLAYOUT 32 /* Do cleanup in cfglayout mode. */ |
#define | CLEANUP_CFG_CHANGED 64 /* The caller changed the CFG. */ |
Typedefs | |
typedef int | __assert_gimple_bb_smaller_rtl_bb [(int) sizeof(struct rtl_bb_info)-(int) sizeof(struct gimple_bb_info)] |
typedef struct ce_if_block | ce_if_block_t |
typedef struct gcov_working_set_info | gcov_working_set_t |
Enumerations | |
enum | cfg_edge_flags { LAST_CFG_EDGE_FLAG } |
enum | cfg_bb_flags { DEF_BASIC_BLOCK_FLAG } |
enum | dom_state { DOM_NONE, DOM_NO_FAST_QUERY, DOM_OK } |
enum | profile_status_d { PROFILE_ABSENT, PROFILE_GUESSED, PROFILE_READ, PROFILE_LAST } |
enum | replace_direction { dir_none, dir_forward, dir_backward, dir_both } |
enum | cdi_direction { CDI_DOMINATORS = 1, CDI_POST_DOMINATORS = 2 } |
Variables | |
struct gcov_ctr_summary * | profile_info |
edge | mfb_kj_edge |
#define BASIC_BLOCK | ( | N | ) | ((*basic_block_info)[(N)]) |
Referenced by associate_equivalences_with_edges(), build_btr_def_use_webs(), cmp_dfsnum(), compute_kill(), compute_out(), debug_insn_slim(), df_chain_remove_problem(), df_entry_block_defs_collect(), df_get_eh_block_artificial_uses(), df_grow_insn_info(), find_occr_in_bb(), find_taken_edge(), fixup_noreturn_call(), free_original_copy_tables(), gimple_block_ends_with_call_p(), insert_var_expansion_initialization(), make_pass_df_finish(), optimize_range_tests_diff(), regstat_get_setjmp_crosses(), return_insn_p(), and update_dep_bb().
#define BASIC_BLOCK_FOR_FUNCTION | ( | FN, | |
N | |||
) | ((*basic_block_info_for_function (FN))[(N)]) |
Referenced by input_cfg(), and input_phi().
#define basic_block_info (cfun->cfg->x_basic_block_info) |
#define basic_block_info_for_function | ( | FN | ) | ((FN)->cfg->x_basic_block_info) |
#define BB_ALL_FLAGS ((LAST_CFG_BB_FLAG - 1) * 2 - 1) |
Bit mask for all basic block flags.
#define BB_COPY_PARTITION | ( | dstbb, | |
srcbb | |||
) | BB_SET_PARTITION (dstbb, BB_PARTITION (srcbb)) |
Referenced by rtl_force_nonfallthru(), and rtl_redirect_edge_and_branch_force().
#define BB_END | ( | B | ) | (B)->il.x.rtl->end_ |
Referenced by bb_note(), block_has_preserve_label(), block_label(), btr_def_live_range(), cfg_layout_can_merge_blocks_p(), cfg_layout_redirect_edge_and_branch(), cheap_bb_rtx_cost_p(), compute_hash_table(), compute_out(), cond_exec_find_if_block(), contains_no_active_insn_p(), count_reg_usage(), delete_insn(), df_simulate_fixup_sets(), edge_probability_reliable_p(), find_cond_trap(), find_invariants_to_move(), find_partition_fixes(), fixup_new_cold_bb(), fixup_reorder_chain(), get_last_bb_insn(), inner_loop_header_p(), insert_store(), memref_referenced_p(), merge_blocks_move_predecessor_nojumps(), noce_can_store_speculate_p(), prologue_epilogue_contains(), record_insns(), reorder_basic_blocks(), rtl_delete_block(), rtl_force_nonfallthru(), rtl_split_block(), rtl_verify_edges(), split_iv(), thread_prologue_and_epilogue_insns(), and vt_get_decl_and_offset().
#define BB_FLAGS_TO_PRESERVE |
Bit mask for all basic block flags that must be preserved. These are the bit masks that are not cleared by clear_bb_flags.
Referenced by redirect_edge_succ().
#define BB_FOOTER | ( | B | ) | (B)->il.x.rtl->footer_ |
Referenced by block_label(), and cfg_layout_split_block().
#define BB_FREQ_MAX 10000 |
Referenced by find_clusters_1().
#define BB_HEAD | ( | B | ) | (B)->il.x.head_ |
Stuff for recording basic block info.
Referenced by can_fallthru(), cfg_layout_can_merge_blocks_p(), cfg_layout_redirect_edge_and_branch(), compute_out(), contains_no_active_insn_p(), count_reg_usage(), delete_insn(), emit_barrier_after_bb(), fix_crossing_unconditional_branches(), init_resource_info(), insert_store(), insert_var_expansion_initialization(), memref_referenced_p(), merge_blocks_move_predecessor_nojumps(), profile_function(), record_insns(), restore_operands(), return_insn_p(), rtl_delete_block(), rtl_split_block(), rtl_split_edge(), rtl_verify_edges(), thread_prologue_and_epilogue_insns(), try_crossjump_to_edge(), and vt_get_decl_and_offset().
#define BB_HEADER | ( | B | ) | (B)->il.x.rtl->header_ |
Referenced by cfg_layout_split_block(), and label_for_bb().
#define BB_PARTITION | ( | bb | ) | ((bb)->flags & (BB_HOT_PARTITION|BB_COLD_PARTITION)) |
Partitions, to be used when partitioning hot and cold basic blocks into separate sections.
Referenced by find_traces_1_round(), fix_crossing_unconditional_branches(), get_uncond_jump_length(), merge_blocks_move_predecessor_nojumps(), merge_blocks_move_successor_nojumps(), and print_rtl_with_bb().
#define BB_SET_PARTITION | ( | bb, | |
part | |||
) |
Referenced by print_rtl_with_bb(), and sanitize_hot_paths().
#define BB_UNPARTITIONED 0 |
Dummy bitmask for convenience in the hot/cold partitioning code.
#define BRANCH_EDGE | ( | bb | ) |
BB is assumed to contain conditional jump. Return the branch edge.
Referenced by cse_process_notes_1(), and get_last_bb_insn().
#define CLEANUP_CFG_CHANGED 64 /* The caller changed the CFG. */ |
#define CLEANUP_CFGLAYOUT 32 /* Do cleanup in cfglayout mode. */ |
#define CLEANUP_CROSSJUMP 2 /* Do crossjumping. */ |
#define CLEANUP_EXPENSIVE |
Referenced by merge_blocks_move_successor_nojumps(), and migrate_btr_defs().
#define CLEANUP_NO_INSN_DEL |
#define CLEANUP_POST_REGSTACK |
#define CLEANUP_THREADING 8 /* Do jump threading. */ |
Masks for basic_block.flags.
Masks for edge.flags.
#define EDGE_ALL_FLAGS ((LAST_CFG_EDGE_FLAG - 1) * 2 - 1) |
Bit mask for all edge flags.
#define EDGE_COMPLEX (EDGE_ABNORMAL | EDGE_ABNORMAL_CALL | EDGE_EH | EDGE_PRESERVE) |
The following four flags all indicate something special about an edge. Test the edge flags on EDGE_COMPLEX to detect all forms of "strange" control flow transfers.
Referenced by cond_move_convert_if_block(), count_reg_usage(), find_implicit_sets(), remove_fallthru_edge(), and simplify_cond_using_ranges().
#define EDGE_COUNT | ( | ev | ) | vec_safe_length (ev) |
Referenced by add_phi_node_to_bb(), can_remove_branch_p(), compare_range_with_value(), compute_dominance_frontiers_1(), compute_hash_table(), cond_exec_find_if_block(), count_reg_usage(), dfs_enumerate_from(), dfs_find_deadend(), dump_recorded_exit(), duplicate_loop(), estimated_unrolled_size(), find_clusters_1(), find_traces_1_round(), get_last_bb_insn(), gimple_merge_blocks(), tm_memop_hasher::hash(), if_convertible_loop_p(), input_phi(), insert_store(), lower_emutls_phi_arg(), mark_stmt_if_obviously_necessary(), move_stmt_r(), output_eh_regions(), remove_fake_predecessors(), remove_predictions_associated_with_edge(), thread_prologue_and_epilogue_insns(), update_forwarder_flag(), and vect_create_cond_for_alias_checks().
#define EDGE_CRITICAL_P | ( | e | ) |
Return nonzero if edge is critical.
Referenced by coalesce_cost_bb(), compute_hash_table(), dump_value_range(), find_group(), instrument_edges(), and rtl_move_block_after().
#define EDGE_FREQUENCY | ( | e | ) |
Return expected execution frequency of the edge E.
Referenced by can_duplicate_block_p(), check_bb_profile(), compute_alignments(), copy_bb(), delete_allocno_from_bucket(), expand_transaction(), expected_loop_iterations_unbounded(), find_traces_1_round(), split_function(), and stmt_starts_bb_p().
#define EDGE_I | ( | ev, | |
i | |||
) | (*ev)[(i)] |
Referenced by insert_store(), set_allocno_somewhere_renamed_p(), and thread_prologue_and_epilogue_insns().
#define EDGE_INDEX | ( | el, | |
pred, | |||
succ | |||
) | (find_edge_index ((el), (pred), (succ))) |
EDGE_INDEX returns an integer index for an edge, or EDGE_INDEX_NO_EDGE if there is no edge between the 2 basic blocks.
Referenced by insert_insn_start_basic_block(), print_edge_list(), and verify_edge_list().
#define EDGE_INDEX_NO_EDGE -1 |
This is the value which indicates no edge is present.
Referenced by print_edge_list(), and verify_edge_list().
#define EDGE_PRED | ( | bb, | |
i | |||
) | (*(bb)->preds)[(i)] |
#define EDGE_SUCC | ( | bb, | |
i | |||
) | (*(bb)->succs)[(i)] |
#define ei_last | ( | iter | ) | ei_last_1 (&(iter)) |
#define ei_start | ( | iter | ) | ei_start_1 (&(iter)) |
Referenced by dfs_find_deadend(), find_edge(), find_implicit_sets(), gimple_expand_cfg(), inner_loop_header_p(), insert_store(), link_roots(), and move_stmt_r().
#define ENTRY_BLOCK (0) |
Special block numbers [markers] for entry and exit. Neither of them is supposed to hold actual statements.
Referenced by df_get_eh_block_artificial_uses(), df_grow_insn_info(), df_set_bb_dirty(), do_partial_partial_insertion(), same_succ_flush_bb(), and unlink_block().
#define ENTRY_BLOCK_PTR (cfun->cfg->x_entry_block_ptr) |
Defines for textual backward source compatibility.
Referenced by alloc_aux_for_edge(), cfg_blocks_empty_p(), copy_bb(), copy_static_chain(), dfs_enumerate_from(), disambiguate_multiple_latches(), do_partial_partial_insertion(), dump_split_point(), find_max_flow(), find_pdom(), find_traces_1_round(), find_working_set(), init_reg_last(), instrument_memory_accesses(), ipa_tm_scan_irr_block(), label_for_bb(), loe_visit_block(), mark_last_stmt_necessary(), merge_blocks_move_successor_nojumps(), output_eh_regions(), partition_is_global(), post_order_compute(), print_edge_list(), probably_never_executed(), redirect_edge_succ(), remap_ssa_name(), replace_locals_op(), set_var_live_on_entry(), unchecked_make_edge(), unlink_block(), and verify_dominators().
#define ENTRY_BLOCK_PTR_FOR_FUNCTION | ( | FN | ) | ((FN)->cfg->x_entry_block_ptr) |
Defines for accessing the fields of the CFG structure for function FN.
Referenced by alloc_loop().
#define EXIT_BLOCK (1) |
#define EXIT_BLOCK_PTR (cfun->cfg->x_exit_block_ptr) |
Referenced by alloc_aux_for_edge(), cfg_blocks_empty_p(), cfg_layout_can_merge_blocks_p(), cfg_layout_initialize(), compute_dominance_frontiers_1(), contains_no_active_insn_p(), count_reg_usage(), disambiguate_multiple_latches(), dump_live_info(), dump_recorded_exit(), fill_sons_in_loop(), find_edge_index(), find_max_flow(), find_traces_1_round(), fix_bb_placement(), get_loop_body(), gimple_purge_dead_eh_edges(), gimple_redirect_edge_and_branch(), inner_loop_header_p(), insert_store(), make_edges(), make_pass_into_cfg_layout_mode(), mark_last_stmt_necessary(), nontemporal_store_p(), one_pre_gcse_pass(), outof_cfg_layout_mode(), partition_is_global(), print_edge_list(), print_loop(), prologue_epilogue_contains(), record_loop_exits(), remove_fake_edges(), remove_fake_exit_edges(), remove_fake_predecessors(), reorder_basic_blocks(), replace_locals_op(), replace_pseudos_in(), set_var_live_on_entry(), tm_memopt_accumulate_memops(), unchecked_make_edge(), and unlink_block().
#define EXIT_BLOCK_PTR_FOR_FUNCTION | ( | FN | ) | ((FN)->cfg->x_exit_block_ptr) |
Referenced by alloc_loop().
#define FALLTHRU_EDGE | ( | bb | ) |
BB is assumed to contain conditional jump. Return the fallthru edge.
Referenced by create_call_for_reduction_1(), and execute_lower_tm().
#define FOR_ALL_BB | ( | BB | ) | for (BB = ENTRY_BLOCK_PTR; BB; BB = BB->next_bb) |
Cycles through all basic blocks, even the fake ones (entry and exit block).
Referenced by alloc_aux_for_block(), df_live_finalize(), df_live_verify_solution_start(), df_lr_free(), draw_cfg_nodes(), dump_bb_for_graph(), and prescan_insns_for_dce().
#define FOR_ALL_BB_FN | ( | BB, | |
FN | |||
) | for (BB = ENTRY_BLOCK_PTR_FOR_FUNCTION (FN); BB; BB = BB->next_bb) |
Referenced by output_eh_regions().
#define FOR_BB_BETWEEN | ( | BB, | |
FROM, | |||
TO, | |||
DIR | |||
) | for (BB = FROM; BB != TO; BB = BB->DIR) |
For iterating over basic blocks.
Referenced by alloc_aux_for_edge(), find_max_flow(), find_working_set(), print_edge_list(), and redirect_edge_succ().
#define FOR_BB_INSNS | ( | BB, | |
INSN | |||
) |
For iterating over insns in basic block.
Referenced by df_chain_remove_problem(), df_get_call_refs(), df_get_exit_block_use_set(), df_insn_rescan_debug_internal(), dump_rtl_slim(), hash_scan_set(), memref_referenced_p(), merge_identical_invariants(), num_loop_insns(), one_code_hoisting_pass(), remove_pseudos(), and reorder_basic_blocks().
#define FOR_BB_INSNS_REVERSE | ( | BB, | |
INSN | |||
) |
Referenced by df_set_regs_ever_live(), gate_ud_dce(), and loop_latch_edge().
#define FOR_BB_INSNS_REVERSE_SAFE | ( | BB, | |
INSN, | |||
CURR | |||
) |
#define FOR_BB_INSNS_SAFE | ( | BB, | |
INSN, | |||
CURR | |||
) |
For iterating over insns in basic block when we might remove the current insn.
Referenced by insert_var_expansion_initialization().
#define FOR_EACH_BB | ( | BB | ) | FOR_EACH_BB_FN (BB, cfun) |
Referenced by compact_blocks(), correct_negative_edge_counts(), coverage_compute_profile_id(), debug_dfa_stats(), dest_safe_for_nrv_p(), df_get_exit_block_use_set(), df_grow_bb_info(), df_grow_insn_info(), df_insn_rescan_debug_internal(), df_set_bb_dirty(), dfs_enumerate_from(), dse_step3(), dump_var_map(), simd_array_to_simduid::equal(), find_refs_for_sm(), fix_crossing_unconditional_branches(), free_cprop_mem(), free_expr_hash_elt_contents(), init_object_sizes(), init_parameter_lattice_values(), init_resource_info(), lower_emutls_phi_arg(), memref_referenced_p(), output_location(), process_assert_insertions_for(), process_switch(), remove_fake_predecessors(), remove_pseudos(), reorder_basic_blocks(), replace_pseudos_in(), sese_record_loop(), set_var_live_on_entry(), setup_loop_tree_level(), and visit_hist().
#define FOR_EACH_BB_FN | ( | BB, | |
FN | |||
) | FOR_BB_BETWEEN (BB, (FN)->cfg->x_entry_block_ptr->next_bb, (FN)->cfg->x_exit_block_ptr, next_bb) |
#define FOR_EACH_BB_REVERSE | ( | BB | ) | FOR_EACH_BB_REVERSE_FN (BB, cfun) |
Referenced by profile_function().
#define FOR_EACH_BB_REVERSE_FN | ( | BB, | |
FN | |||
) | FOR_BB_BETWEEN (BB, (FN)->cfg->x_exit_block_ptr->prev_bb, (FN)->cfg->x_entry_block_ptr, prev_bb) |
#define FOR_EACH_EDGE | ( | EDGE, | |
ITER, | |||
EDGE_VEC | |||
) |
This macro serves as a convenient way to iterate each edge in a vector of predecessor or successor edges. It must not be used when an element might be removed during the traversal, otherwise elements will be missed. Instead, use a for-loop like that shown in the following pseudo-code:
FOR (ei = ei_start (bb->succs); (e = ei_safe_edge (ei)); ) { IF (e != taken_edge) remove_edge (e); ELSE ei_next (&ei); }
Referenced by add_ranges_and_copies(), alloc_aux_for_edge(), attempt_coalesce(), bb_dom_dfs_in(), check_bb_profile(), clear_edges(), compute_available(), compute_hash_table(), conditional_probability(), contains_no_active_insn_p(), count_reg_usage(), coverage_compute_profile_id(), create_fixup_graph(), debug_var_infos_r(), dfs_enumerate_from(), dominated_by_forbidden(), dump_function_to_file(), dump_split_point(), duplicate_loop(), expand_switch_as_decision_tree_p(), expected_loop_iterations_unbounded(), fill_sons_in_loop(), find_clusters_1(), find_implicit_sets(), find_max_flow(), find_same_succ(), find_traces_1_round(), find_working_set(), finish_copies(), flow_loop_nodes_find(), flow_loops_cfg_dump(), free_aux_for_blocks(), free_expr_hash_elt_contents(), gate_ud_dce(), get_last_bb_insn(), get_tm_region_blocks(), get_uncond_jump_length(), gimple_make_forwarder_block(), gimple_purge_dead_eh_edges(), ssa_names_hasher::hash(), independent_of_stmt_p(), insert_insn_start_basic_block(), ipa_tm_create_version(), ipa_tm_scan_calls_transaction(), ipa_uninstrument_transaction(), lower_eh_constructs(), lv_flush_pending_stmts(), make_edges(), mark_regno_dead(), one_pre_gcse_pass(), output_eh_regions(), output_location(), pre_and_rev_post_order_compute(), print_edge_list(), print_loop(), record_const_or_copy(), record_loop_exits(), remove_conditions_and_labels(), remove_forwarder_block(), reorder_basic_blocks(), replace_pseudos_in(), same_phi_alternatives_1(), sanitize_hot_paths(), sese_insert_phis_for_liveouts(), set_bb_counts(), set_var_live_on_entry(), simplify_cond_using_ranges(), simulate_stmt(), split_edge(), split_function(), thread_single_edge(), tm_memopt_accumulate_memops(), update_bb_profile_for_threading(), verify_dominators(), verify_edge_list(), and control_dependences::~control_dependences().
#define GCOV_COMPUTE_SCALE | ( | num, | |
den | |||
) | ((den) ? RDIV ((num) * REG_BR_PROB_BASE, (den)) : REG_BR_PROB_BASE) |
Compute a scale factor (or probability) suitable for scaling of gcov_type values via apply_probability() and apply_scale().
Referenced by conditional_probability(), find_clusters(), and input_profile_summary().
INDEX_EDGE returns a pointer to the edge.
Referenced by find_group(), and find_pdom().
INDEX_EDGE_PRED_BB and INDEX_EDGE_SUCC_BB return a pointer to the basic block which is either the pred or succ end of the indexed edge.
Referenced by print_edge_list().
Referenced by print_edge_list(), and process_insert_insn().
#define label_to_block_map (cfun->cfg->x_label_to_block_map) |
Referenced by gimple_call_arg_flags().
#define label_to_block_map_for_function | ( | FN | ) | ((FN)->cfg->x_label_to_block_map) |
#define last_basic_block (cfun->cfg->x_last_basic_block) |
Referenced by alloc_gcse_mem(), associate_equivalences_with_edges(), compact_blocks(), compute_kill(), df_live_finalize(), df_lr_free(), find_refs_for_sm(), fixup_noreturn_call(), init_loop_tree_node(), insert_store(), mark_def_interesting(), pre_insert_copies(), remove_unnecessary_allocnos(), split_live_ranges_for_shrink_wrap(), and dom_walker::walk().
#define last_basic_block_for_function | ( | FN | ) | ((FN)->cfg->x_last_basic_block) |
Referenced by output_eh_regions().
#define n_basic_blocks (cfun->cfg->x_n_basic_blocks) |
Referenced by associate_equivalences_with_edges(), cancel_loop(), compact_blocks(), coverage_compute_profile_id(), do_partial_partial_insertion(), dump_bb_for_graph(), duplicate_computed_gotos(), insert_store(), pre_insert_copies(), print_ldst_list(), reorder_basic_blocks(), replace_pseudos_in(), and dom_walker::walk().
#define n_basic_blocks_for_function | ( | FN | ) | ((FN)->cfg->x_n_basic_blocks) |
Referenced by alloc_loop().
#define n_edges (cfun->cfg->x_n_edges) |
Referenced by disconnect_dest(), dump_bb_for_graph(), and print_ldst_list().
#define n_edges_for_function | ( | FN | ) | ((FN)->cfg->x_n_edges) |
Number of edges in the compressed edge list.
Referenced by compute_insert_delete().
#define NUM_FIXED_BLOCKS (2) |
The two blocks that are always in the cfg.
Referenced by bb_seen_p(), compact_blocks(), compute_kill(), df_grow_bb_info(), df_set_bb_dirty(), duplicate_computed_gotos(), fixup_noreturn_call(), pre_insert_copies(), and reorder_basic_blocks().
#define profile_status (cfun->cfg->x_profile_status) |
Referenced by get_last_bb_insn(), and optimize_loop_nest_for_speed_p().
#define profile_status_for_function | ( | FN | ) | ((FN)->cfg->x_profile_status) |
Referenced by maybe_hot_count_p(), and output_eh_regions().
Referenced by probably_never_executed().
#define REG_BR_PROB_BASE 10000 |
The base value for branch probability notes and edge probabilities.
Referenced by block_has_only_trap(), cgraph_remove_node_duplication_hook(), cheap_bb_rtx_cost_p(), combine_predictions_for_bb(), copy_phi_args(), create_outofssa_var_map(), draw_cfg_node_succ_edges(), dump_prediction(), evaluate_predicate(), expand_return(), expand_transaction(), find_traces(), fixup_new_cold_bb(), input_refs(), make_pass_into_cfg_layout_mode(), optimize_loop_nest_for_speed_p(), outgoing_edges_match(), scale_dominated_blocks_in_loop(), split_function(), stmt_starts_bb_p(), update_bb_profile_for_threading(), update_call_expr(), and vect_create_cond_for_alias_checks().
#define SET_BASIC_BLOCK | ( | N, | |
BB | |||
) | ((*basic_block_info)[(N)] = (BB)) |
Referenced by compact_blocks(), and unlink_block().
#define SET_BASIC_BLOCK_FOR_FUNCTION | ( | FN, | |
N, | |||
BB | |||
) | ((*basic_block_info_for_function (FN))[(N)] = (BB)) |
#define set_block_for_insn | ( | INSN, | |
BB | |||
) | (BLOCK_FOR_INSN (INSN) = BB) |
typedef int __assert_gimple_bb_smaller_rtl_bb[(int) sizeof(struct rtl_bb_info)-(int) sizeof(struct gimple_bb_info)] |
This ensures that struct gimple_bb_info is smaller than struct rtl_bb_info, so that inlining the former into basic_block_def is the better choice.
typedef struct ce_if_block ce_if_block_t |
Structure to group all of the information to process IF-THEN and IF-THEN-ELSE blocks for the conditional execution support. This needs to be in a public file in case the IFCVT macros call functions passing the ce_if_block data structure.
typedef struct gcov_working_set_info gcov_working_set_t |
In profile.c.
enum cdi_direction |
In dominance.c
enum cfg_bb_flags |
DEF_BASIC_BLOCK_FLAG |
Flags on basic blocks and edges. Copyright (C) 2012-2013 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GCC; see the file COPYING3. If not see http://www.gnu.org/licenses/. This file defines flags that may appear on basic blocks or on edges. Source files define DEF_BASIC_BLOCK_FLAG or DEF_EDGE_FLAG appropriately before including this file. Masks for basic_block.flags. The format of this file is: DEF_BASIC_BLOCK_FLAG(NAME, IDX). NAME is the name of the basic block flag. A flag BB_::NAME will be created and the name is used in dump_edge_info. IDX is a sequence number that is used to determine the value of the flag, which is 1 << IDX). BB_HOT_PARTITION and BB_COLD_PARTITION should be preserved throughout the compilation, so they are never cleared. All other flags may be cleared by clear_bb_flags(). It is generally a bad idea to rely on any flags being up-to-date. Only set on blocks that have just been created by create_bb. |
enum cfg_edge_flags |
LAST_CFG_EDGE_FLAG |
Flags on basic blocks and edges. Copyright (C) 2012-2013 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GCC; see the file COPYING3. If not see http://www.gnu.org/licenses/. This file defines flags that may appear on basic blocks or on edges. Source files define DEF_BASIC_BLOCK_FLAG or DEF_EDGE_FLAG appropriately before including this file. Masks for edge.flags. The format of this file is: DEF_EDGE_FLAG(NAME, IDX, STRING). NAME is the name of the edge flag. A flag EDGE_::NAME will be created and the name is used in dump_edge_info. IDX is a sequence number that is used to determine the value of the flag, which is 1 << IDX). 'Straight line' flow. In GIMPLE and in cfglayout mode, all normal edges are fallthru edges. In cfgrtl mode, this flag really means that control flow falls through to the next basic block in the line. Strange flow, like a computed jump or exception handling. Usually this means that the edge cannot be split. Edge out of a basic block that ends with a CALL_INSN with abnormal exit, like an exception or a non-local goto. ABNORMAL_CALL edges also have ABNORMAL set. This flag is only used for the RTL CFG. Exception edge. Exception handling edges represent possible control transfers from a trapping instruction to an exception handler. EH edges also have ABNORMAL set for the RTL CFG. Never merge blocks via this edge. This is used for exception handling, to prevent merging away edges to the post-landing-pad basic block. This flag is only used for the RTL CFG. Not a real edge. This is used to connect parts of the CFG that do not halt, such as infinite loops and noreturn functions, to the EXIT_BLOCK, so that traversing of the reverse CFG is possible. A back edge, marked in a depth-first search of the CFG. Back edges are hints that this edge may be part of a loop in the CFG. Edge in a part of the CFG that is an irreducible loop. Edge taken when controlling predicate is nonzero. This is only used for the GIMPLE CFG. Edge taken when controlling predicate is zero. This is only used for the GIMPLE CFG. Edge is executable. This is only used in GIMPLE SSA-CCP and VRP. This is only used for the GIMPLE CFG. Edge crosses between hot and cold sections, when we do partitioning. This flag is only used for the RTL CFG. Edge from a sibcall CALL_INSN to exit. SIBCALL edges also have ABNORMAL set. This flag is only used for the RTL CFG. Candidate for straight line flow. Only used in bb-reorder.c. This flag is only used for the RTL CFG. Exit of a loop. This is only used in ifcvt.c. This flag is only used for the RTL CFG. Uninstrumented edge out of a GIMPLE_TRANSACTION statement. Abort (over) edge out of a GIMPLE_TRANSACTION statement. |
enum dom_state |
enum profile_status_d |
enum replace_direction |
void add_noreturn_fake_exit_edges | ( | void | ) |
This function will add a fake edge between any block which has no successors, and the exit block. Some data flow equations require these edges to exist.
Referenced by output_location(), and pre_insert_copies().
void add_to_dominance_info | ( | enum | cdi_direction, |
basic_block | |||
) |
void alloc_aux_for_blocks | ( | int | ) |
void alloc_aux_for_edge | ( | edge | , |
int | |||
) |
Referenced by free_aux_for_blocks().
void alloc_aux_for_edges | ( | int | ) |
basic_block alloc_block | ( | void | ) |
Allocate memory for basic_block.
References basic_block_def::next_bb, and basic_block_def::prev_bb.
|
inlinestatic |
Apply probability PROB on frequency or count FREQ.
Referenced by cgraph_clone_edge(), and expand_transaction().
|
inlinestatic |
Apply scale factor SCALE on frequency or count FREQ. Use this interface when potentially scaling up, so that SCALE is not constrained to be < REG_BR_PROB_BASE.
Referenced by input_cfg(), and input_profile_summary().
unsigned bb_dom_dfs_in | ( | enum | cdi_direction, |
basic_block | |||
) |
Referenced by cmp_dfsnum().
unsigned bb_dom_dfs_out | ( | enum | cdi_direction, |
basic_block | |||
) |
Referenced by cmp_dfsnum().
|
inlinestatic |
Return true when one of the predecessor edges of BB is marked with EDGE_ABNORMAL.
Referenced by replace_pseudos_in().
|
inlinestatic |
Return true when one of the predecessor edges of BB is marked with EDGE_EH.
rtx bb_note | ( | basic_block | ) |
Referenced by delete_insn().
void bitmap_intersection_of_preds | ( | sbitmap | , |
sbitmap * | , | ||
basic_block | |||
) |
Referenced by compute_available().
void bitmap_intersection_of_succs | ( | sbitmap | , |
sbitmap * | , | ||
basic_block | |||
) |
In cfganal.c
void bitmap_union_of_preds | ( | sbitmap | , |
sbitmap * | , | ||
basic_block | |||
) |
Referenced by compute_kill(), and compute_out().
void bitmap_union_of_succs | ( | sbitmap | , |
sbitmap * | , | ||
basic_block | |||
) |
rtx block_label | ( | basic_block | ) |
In cfgrtl.c
Referenced by add_labels_and_missing_jumps(), emit_barrier_after_bb(), and fixup_new_cold_bb().
void break_superblocks | ( | void | ) |
Splits superblocks.
void brief_dump_cfg | ( | FILE * | , |
int | |||
) |
edge cached_make_edge | ( | sbitmap | , |
basic_block | , | ||
basic_block | , | ||
int | |||
) |
void calculate_dominance_info | ( | enum | cdi_direction | ) |
bool can_fallthru | ( | basic_block | , |
basic_block | |||
) |
|
inlinestatic |
Check tha probability is sane.
bool cleanup_cfg | ( | int | ) |
In cfgcleanup.c.
Referenced by migrate_btr_defs(), and remove_death().
void clear_aux_for_blocks | ( | void | ) |
Clear AUX pointers of all blocks.
References edge_aux_obstack, and gcc_obstack_init.
Referenced by alloc_aux_for_blocks(), and duplicate_computed_gotos().
void clear_aux_for_edges | ( | void | ) |
Clear AUX pointers of all edges.
References alloca, first, and NULL.
Referenced by alloc_aux_for_edges().
void clear_bb_flags | ( | void | ) |
Clear all basic block flags that do not have to be preserved.
Referenced by reorder_basic_blocks().
void clear_edges | ( | void | ) |
Free the memory associated with the edge structures.
References FOR_EACH_EDGE, free_edge(), basic_block_def::preds, basic_block_def::succs, and vec_safe_truncate().
|
inlinestatic |
Given PROB1 and PROB2, return PROB1*PROB2/REG_BR_PROB_BASE. Used to combine BB probabilities.
Referenced by estimate_ipcp_clone_size_and_time().
void commit_edge_insertions | ( | void | ) |
Update the CFG for all queued instructions.
Optimization passes that invoke this routine can cause hot blocks previously reached by both hot and cold blocks to become dominated only by cold blocks. This will cause the verification below to fail, and lead to now cold code in the hot section. In some cases this may only be visible after newly unreachable blocks are deleted, which will be done by fixup_partitions.
Referenced by cfg_layout_can_merge_blocks_p().
void commit_one_edge_insertion | ( | edge | e | ) |
void compact_blocks | ( | void | ) |
Sequentially order blocks and compact the arrays.
References FOR_EACH_BB, gcc_assert, basic_block_def::index, last_basic_block, n_basic_blocks, NULL, NUM_FIXED_BLOCKS, and SET_BASIC_BLOCK.
Referenced by cleanup_tree_cfg_1().
Compute the AVIN and AVOUT vectors from the AVLOC and KILL vectors. Return the number of passes we performed to iterate to a solution.
Allocate a worklist array/queue. Entries are only added to the list if they were not already on the list. So the size is bounded by the number of basic blocks.
We want a maximal solution.
Put every block on the worklist; this is necessary because of the optimistic initialization of AVOUT above.
Mark blocks which are successors of the entry block so that we can easily identify them below.
Iterate until the worklist is empty.
Take the first entry off the worklist.
If one of the predecessor blocks is the ENTRY block, then the intersection of avouts is the null set. We can identify such blocks by the special value in the AUX field in the block structure.
Do not clear the aux field for blocks which are successors of the ENTRY block. That way we never add then to the worklist again.
Clear the aux field of this block so that it can be added to the worklist again if necessary.
If the out state of this block changed, then we need to add the successors of this block to the worklist if they are not already on the worklist.
References basic_block_def::aux, bitmap_clear(), bitmap_intersection_of_preds(), bitmap_ior_and_compl(), edge_def::dest, FOR_EACH_EDGE, basic_block_def::index, NULL, basic_block_def::succs, and worklist.
Referenced by compute_insert_delete(), and free_cprop_mem().
void compute_bb_for_insn | ( | void | ) |
Records the basic block struct in BLOCK_FOR_INSN for every insn.
References crtl, df_analyze(), df_note_add_problem(), free_bb_for_insn(), and insert_section_boundary_note().
void compute_dominance_frontiers | ( | struct bitmap_head_def * | ) |
bitmap compute_idf | ( | bitmap | , |
struct bitmap_head_def * | |||
) |
void connect_infinite_loops_to_exit | ( | void | ) |
This function adds a fake edge between any infinite loops to the exit block. Some optimizations require a path from each node to the exit node.
See also Morgan, Figure 3.10, pp. 82-83.
The current implementation is ugly, not attempting to minimize the number of inserted fake edges. To reduce the number of fake edges to insert, add fake edges from innermost loops containing only nodes not reachable from the exit block.
Perform depth-first search in the reverse graph to find nodes reachable from the exit block.
Repeatedly add fake edges, updating the unreachable nodes.
bool contains_no_active_insn_p | ( | const_basic_block | ) |
Referenced by rtl_verify_edges().
basic_block create_basic_block_structure | ( | rtx | , |
rtx | , | ||
rtx | , | ||
basic_block | |||
) |
|
read |
Functions to access an edge list with a vector representation. Enough data is kept such that given an index number, the pred and succ that edge represents can be determined, or given a pred and a succ, its index number can be returned. This allows algorithms which consume a lot of memory to represent the normally full matrix of edge (pred,succ) with a single indexed vector, edge (EDGE_INDEX (pred, succ)), with no wasted space in the client code due to sparse flow graphs. This functions initializes the edge list. Basically the entire flowgraph is processed, and all edges are assigned a number, and the data structure is filled in.
Determine the number of edges in the flow graph by counting successor edges on each basic block.
Follow successors of blocks, and register these edges.
Referenced by compute_insert_delete().
void debug | ( | edge_def & | ref | ) |
void debug | ( | edge_def * | ptr | ) |
void debug_bb | ( | basic_block | ) |
basic_block debug_bb_n | ( | int | ) |
void default_rtl_profile | ( | void | ) |
Set RTL expansion to default mode (i.e. when profile info is not known).
References pointer_map_contains().
Referenced by blocks_nreverse().
void delete_from_dominance_info | ( | enum | cdi_direction, |
basic_block | |||
) |
bool delete_unreachable_blocks | ( | void | ) |
Delete all unreachable basic blocks.
When we're in GIMPLE mode and there may be debug insns, we should delete blocks in reverse dominator order, so as to get a chance to substitute all released DEFs into debug stmts. If we don't have dominators information, walking blocks backward gets us a better chance of retaining most debug information than otherwise.
Speed up the removal of blocks that don't dominate others. Walking backwards, this should be the common case.
Referenced by cleanup_empty_eh_unsplit(), cleanup_tree_cfg_1(), and split_live_ranges_for_shrink_wrap().
int dfs_enumerate_from | ( | basic_block | bb, |
int | reverse, | ||
bool(*)(const_basic_block, const void *) | predicate, | ||
basic_block * | rslt, | ||
int | rslt_max, | ||
const void * | data | ||
) |
Performs dfs search from BB over vertices satisfying PREDICATE; if REVERSE, go against direction of edges. Returns number of blocks found and their list in RSLT. RSLT can contain at most RSLT_MAX items.
A bitmap to keep track of visited blocks. Allocating it each time this function is called is not possible, since dfs_enumerate_from is often used on small (almost) disjoint parts of cfg (bodies of loops), and allocating a large sbitmap would lead to quadratic behavior.
Resize the VISITED sbitmap if necessary.
Ensure that we increase the size of the sbitmap exponentially.
References bitmap_set_bit, CDI_DOMINATORS, EDGE_COUNT, ENTRY_BLOCK_PTR, FOR_EACH_BB, FOR_EACH_EDGE, get_immediate_dominator(), basic_block_def::index, basic_block_def::preds, and edge_def::src.
Referenced by thread_single_edge().
basic_block dfs_find_deadend | ( | basic_block | ) |
Referenced by remove_fake_exit_edges().
bool dom_info_available_p | ( | enum | cdi_direction | ) |
Referenced by case_bit_test_cmp(), cleanup_tree_cfg_1(), redirect_edge_succ_nodup(), and tidy_fallthru_edges().
enum dom_state dom_info_state | ( | enum | cdi_direction | ) |
bool dominated_by_p | ( | enum | cdi_direction, |
const_basic_block | , | ||
const_basic_block | |||
) |
Referenced by bb_dom_dfs_in(), btr_def_live_range(), can_sm_ref_p(), dump_value_range(), eliminate_local_variables(), find_basis_for_base_expr(), find_dom(), find_identical_invariants(), find_subloop_latch_edge_by_profile(), get_instantiated_value_entry(), get_loop_latch_edges(), glb_enum_p(), move_stmt_r(), ref_indep_loop_p(), replace_conditional_candidate(), same_phi_alternatives_1(), simple_mem_ref_in_stmt(), simplify_using_outer_evolutions(), split_edge(), stmt_kills_ref_p(), strlen_optimize_stmt(), tm_log_emit_restores(), verify_dominators(), and zero_one_operation().
void dump_bb_info | ( | FILE * | outf, |
basic_block | bb, | ||
int | indent, | ||
int | flags, | ||
bool | do_header, | ||
bool | do_footer | ||
) |
Dumps cfg related information about basic block BB to OUTF. If HEADER is true, dump things that appear before the instructions contained in BB. If FOOTER is true, dump things that appear after. Flags are the TDF_* masks as documented in dumpfile.h. NB: With TDF_DETAILS, it is assumed that cfun is available, so that maybe_hot_bb_p and probably_never_executed_bb_p don't ICE.
Flags on basic blocks and edges. Copyright (C) 2012-2013 Free Software Foundation, Inc.
This file is part of GCC.
GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version.
GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with GCC; see the file COPYING3. If not see http://www.gnu.org/licenses/.
This file defines flags that may appear on basic blocks or on edges. Source files define DEF_BASIC_BLOCK_FLAG or DEF_EDGE_FLAG appropriately before including this file.
Masks for basic_block.flags.
The format of this file is: DEF_BASIC_BLOCK_FLAG(NAME, IDX). NAME is the name of the basic block flag. A flag BB_::NAME will be created and the name is used in dump_edge_info. IDX is a sequence number that is used to determine the value of the flag, which is 1 << IDX).
BB_HOT_PARTITION and BB_COLD_PARTITION should be preserved throughout the compilation, so they are never cleared.
All other flags may be cleared by clear_bb_flags(). It is generally a bad idea to rely on any flags being up-to-date.
Only set on blocks that have just been created by create_bb.
Set by find_unreachable_blocks. Do not rely on this being set in any pass.
Set for blocks in an irreducible loop by loop analysis.
Set on blocks that may actually not be single-entry single-exit block.
Set on basic blocks that the scheduler should not touch. This is used by SMS to prevent other schedulers from messing with the loop schedule.
Set on blocks that should be put in a hot section.
Set on blocks that should be put in a cold section.
Set on block that was duplicated.
Set if the label at the top of this block is the target of a non-local goto.
Set on blocks that are in RTL format.
Set on blocks that are forwarder blocks. Only used in cfgcleanup.c.
Set on blocks that cannot be threaded through. Only used in cfgcleanup.c.
Set on blocks that were modified in some way. This bit is set in df_set_bb_dirty, but not cleared by df_analyze, so it can be used to test whether a block has been modified prior to a df_analyze call.
A general visited flag for passes to use.
Set on blocks that are in a transaction. This is calculated on demand, and is available after calling compute_transaction_bits().
Masks for edge.flags.
The format of this file is: DEF_EDGE_FLAG(NAME, IDX, STRING). NAME is the name of the edge flag. A flag EDGE_::NAME will be created and the name is used in dump_edge_info. IDX is a sequence number that is used to determine the value of the flag, which is 1 << IDX).
'Straight line' flow. In GIMPLE and in cfglayout mode, all normal edges are fallthru edges. In cfgrtl mode, this flag really means that control flow falls through to the next basic block in the line.
Strange flow, like a computed jump or exception handling. Usually this means that the edge cannot be split.
Edge out of a basic block that ends with a CALL_INSN with abnormal exit, like an exception or a non-local goto. ABNORMAL_CALL edges also have ABNORMAL set. This flag is only used for the RTL CFG.
Exception edge. Exception handling edges represent possible control transfers from a trapping instruction to an exception handler. EH edges also have ABNORMAL set for the RTL CFG.
Never merge blocks via this edge. This is used for exception handling, to prevent merging away edges to the post-landing-pad basic block. This flag is only used for the RTL CFG.
Not a real edge. This is used to connect parts of the CFG that do not halt, such as infinite loops and noreturn functions, to the EXIT_BLOCK, so that traversing of the reverse CFG is possible.
A back edge, marked in a depth-first search of the CFG. Back edges are hints that this edge may be part of a loop in the CFG.
Edge in a part of the CFG that is an irreducible loop.
Edge taken when controlling predicate is nonzero. This is only used for the GIMPLE CFG.
Edge taken when controlling predicate is zero. This is only used for the GIMPLE CFG.
Edge is executable. This is only used in GIMPLE SSA-CCP and VRP. This is only used for the GIMPLE CFG.
Edge crosses between hot and cold sections, when we do partitioning. This flag is only used for the RTL CFG.
Edge from a sibcall CALL_INSN to exit. SIBCALL edges also have ABNORMAL set. This flag is only used for the RTL CFG.
Candidate for straight line flow. Only used in bb-reorder.c. This flag is only used for the RTL CFG.
Exit of a loop. This is only used in ifcvt.c. This flag is only used for the RTL CFG.
Uninstrumented edge out of a GIMPLE_TRANSACTION statement.
Abort (over) edge out of a GIMPLE_TRANSACTION statement.
void dump_edge_info | ( | FILE * | , |
edge | , | ||
int | , | ||
int | |||
) |
void dump_flow_info | ( | FILE * | , |
int | |||
) |
Referenced by dump_flow_info().
bool edge_probability_reliable_p | ( | const_edge | ) |
|
inlinestatic |
Return 1 if we should continue to iterate. Return 0 otherwise. *Edge P is set to the next edge if we are to continue to iterate and NULL otherwise.
Referenced by insert_store().
|
inlinestatic |
Return the edge pointed to by the iterator `i'.
Referenced by insert_store(), and link_roots().
|
inlinestatic |
Is the iterator `i' at the end of the sequence?
Referenced by insert_store(), and link_roots().
|
inlinestatic |
Return an iterator pointing to the last element of an edge vector.
|
inlinestatic |
Advance the iterator to the next element.
Referenced by find_edge(), find_implicit_sets(), get_all_loop_exits(), gimple_expand_cfg(), insert_store(), link_roots(), post_order_compute(), print_loops(), remove_ctrl_stmt_and_useless_edges(), rewrite_trees(), rtl_verify_bb_layout(), and try_forward_edges().
|
inlinestatic |
Is the iterator `i' at one position before the end of the sequence?
Referenced by post_order_compute().
|
inlinestatic |
Move the iterator to the previous element.
|
inlinestatic |
Return an edge pointed to by the iterator. Do it safely so that NULL is returned when the iterator is pointing at the end of the sequence.
Referenced by find_edge(), find_implicit_sets(), gimple_expand_cfg(), and move_stmt_r().
|
inlinestatic |
Return an iterator pointing to the start of an edge vector.
void emit_barrier_after_bb | ( | basic_block | bb | ) |
void expunge_block | ( | basic_block | ) |
edge find_edge | ( | basic_block | , |
basic_block | |||
) |
int find_edge_index | ( | struct edge_list * | , |
basic_block | , | ||
basic_block | |||
) |
|
inlinestatic |
Return the fallthru edge in EDGES if it exists, NULL otherwise.
Referenced by cfg_layout_initialize(), and find_active_insn_after().
void find_many_sub_basic_blocks | ( | sbitmap | ) |
In cfgbuild.c.
void find_unreachable_blocks | ( | void | ) |
In cfganal.c
Find unreachable blocks. An unreachable block will have 0 in the reachable bit in block->flags. A nonzero value indicates the block is reachable.
Clear all the reachability flags.
Add our starting points to the worklist. Almost always there will be only one. It isn't inconceivable that we might one day directly support Fortran alternate entry points.
Mark the block reachable.
Iterate: find everything reachable from what we've already seen.
References basic_block_def::flags.
Referenced by replace_locals_op().
gcov_working_set_t* find_working_set | ( | unsigned | pct_times_10 | ) |
basic_block first_dom_son | ( | enum | cdi_direction, |
basic_block | |||
) |
Referenced by do_partial_partial_insertion(), get_immediate_dominator(), and glb_enum_p().
bool fixup_abnormal_edges | ( | void | ) |
This is used by a few passes that emit some instructions after abnormal calls, moving the basic block's end, while they in fact do want to emit them on the fallthru edge. Look for abnormal call edges, find backward the call in the block and insert the instructions on the edge instead.
Similarly, handle instructions throwing exceptions internally.
Return true when instructions have been found and inserted on edges.
Look for cases we are interested in - calls or instructions causing exceptions.
Get past the new insns generated. Allow notes, as the insns may be already deleted.
Sometimes there's still the return value USE. If it's placed after a trapping call (i.e. that call is the last insn anyway), we have no fallthru edge. Simply delete this use and don't try to insert on the non-existent edge.
We're not deleting it, we're moving it.
It may be that we don't find any trapping insn. In this case we discovered quite late that the insn that had been marked as can_throw_internal in fact couldn't trap at all. So we should in fact delete the EH edges out of the block.
void fixup_partitions | ( | void | ) |
Perform cleanup on the hot/cold bb partitioning after optimization passes that modify the cfg.
Delete any blocks that became unreachable and weren't already cleaned up, for example during edge forwarding and convert_jumps_to_returns. This will expose more opportunities for fixing the partition boundaries here. Also, the calculation of the dominance graph during verification will assert if there are unreachable nodes.
If there are partitions, do a sanity check on them: A basic block in
 a cold partition cannot dominate a basic block in a hot partition. Fixup any that now violate this requirement, as a result of edge forwarding and unreachable block deletion. Â
Do the partition fixup after all necessary blocks have been converted to cold, so that we only update the region crossings the minimum number of places, which can require forcing edges to be non fallthru.
References error(), get_insns(), basic_block_def::index, print_rtl_with_bb(), and TDF_RTL.
int flow_find_cross_jump | ( | basic_block | bb1, |
basic_block | bb2, | ||
rtx * | f1, | ||
rtx * | f2, | ||
enum replace_direction * | dir_p | ||
) |
Look through the insns at the end of BB1 and BB2 and find the longest sequence that are either equivalent, or allow forward or backward replacement. Store the first insns for that sequence in *F1 and *F2 and return the sequence length.
DIR_P indicates the allowed replacement direction on function entry, and the actual replacement direction on function exit. If NULL, only equivalent sequences are allowed.
To simplify callers of this function, if the blocks match exactly, store the head of the blocks in *F1 and *F2.
Skip simple jumps at the end of the blocks. Complex jumps still need to be compared for equivalence, which we'll do below.
Count everything except for unconditional jump as insn.
In the following example, we can replace all jumps to C by jumps to A. This removes 4 duplicate insns. [bb A] insn1 [bb C] insn1 insn2 insn2 [bb B] insn3 insn3 insn4 insn4 jump_insn jump_insn We could also replace all jumps to A by jumps to C, but that leaves B alive, and removes only 2 duplicate insns. In a subsequent crossjump step, all jumps to B would be replaced with jumps to the middle of C, achieving the same result with more effort. So we allow only the first possibility, which means that we don't allow fallthru in the block that's being replaced.
Don't begin a cross-jump with a NOTE insn.
Include preceding notes and labels in the cross-jump. One, this may bring us to the head of the blocks as requested above. Two, it keeps line number notes as matched as may be.
int flow_find_head_matching_sequence | ( | basic_block | bb1, |
basic_block | bb2, | ||
rtx * | f1, | ||
rtx * | f2, | ||
int | stop_after | ||
) |
Like flow_find_cross_jump, except start looking for a matching sequence from the head of the two blocks. Do not include jumps at the end. If STOP_AFTER is nonzero, stop after finding that many matching instructions.
Ignore notes, except NOTE_INSN_EPILOGUE_BEG.
A sanity check to make sure we're not merging insns with different effects on EH. If only one of them ends a basic block, it shouldn't have an EH edge; if both end a basic block, there should be the same number of EH edges.
Don't begin a cross-jump with a NOTE insn.
basic_block force_nonfallthru_and_redirect | ( | edge | , |
basic_block | , | ||
rtx | |||
) |
bool forwarder_block_p | ( | const_basic_block | ) |
void free_aux_for_blocks | ( | void | ) |
Free data allocated in block_aux_obstack and clear AUX pointers of all blocks.
References alloc_aux_for_edge(), FOR_EACH_EDGE, and basic_block_def::succs.
void free_aux_for_edges | ( | void | ) |
Free data allocated in edge_aux_obstack and clear AUX pointers of all edges.
unsigned int free_bb_for_insn | ( | void | ) |
Release the basic_block_for_insn array.
References OPTGROUP_NONE, RTL_PASS, and TV_NONE.
Referenced by compute_bb_for_insn().
void free_dominance_info | ( | enum | cdi_direction | ) |
void free_edge_list | ( | struct edge_list * | ) |
Referenced by pre_insert_copies().
void free_original_copy_tables | ( | void | ) |
Free the data structures to maintain mapping between blocks and its copies.
References BASIC_BLOCK, hash_table< Descriptor, Allocator >::find(), gcc_assert, basic_block_def::index, htab_bb_copy_original_entry::index1, htab_bb_copy_original_entry::index2, and NULL.
Referenced by ssa_name_has_uses_outside_loop_p(), vect_create_cond_for_alias_checks(), and vect_update_ivs_after_vectorizer().
vec<basic_block> get_all_dominated_blocks | ( | enum | cdi_direction, |
basic_block | |||
) |
basic_block get_bb_copy | ( | basic_block | ) |
basic_block get_bb_original | ( | basic_block | ) |
Referenced by insert_var_expansion_initialization().
vec<basic_block> get_dominated_by | ( | enum | cdi_direction, |
basic_block | |||
) |
Referenced by split_edge_and_insert().
vec<basic_block> get_dominated_by_region | ( | enum cdi_direction | dir, |
basic_block * | region, | ||
unsigned | n_region | ||
) |
Returns the list of basic blocks that are immediately dominated (in direction DIR) by some block between N_REGION ones stored in REGION, except for blocks in the REGION itself.
References basic_block_def::dom, dom_computed, dom_convert_dir_to_idx(), DOM_NO_FAST_QUERY, DOM_OK, et_set_father(), et_split(), gcc_checking_assert, and et_node::son.
Referenced by move_stmt_r().
vec<basic_block> get_dominated_to_depth | ( | enum | cdi_direction, |
basic_block | , | ||
int | |||
) |
basic_block get_immediate_dominator | ( | enum | cdi_direction, |
basic_block | |||
) |
Referenced by dfs_enumerate_from(), do_partial_partial_insertion(), find_pdom(), move_stmt_r(), select_best_block(), and split_edge().
rtx get_last_bb_insn | ( | basic_block | ) |
void gimple_predict_edge | ( | edge | , |
enum | br_predictor, | ||
int | |||
) |
bool gimple_predicted_by_p | ( | const_basic_block | , |
enum | br_predictor | ||
) |
void gt_pch_nx | ( | edge_def * | e | ) |
Referenced by vec< T, A, vl_embed >::embedded_size(), and gimplify_build3().
void gt_pch_nx | ( | edge_def * | e, |
gt_pointer_operator | , | ||
void * | |||
) |
void guess_outgoing_edge_probabilities | ( | basic_block | ) |
void init_rtl_bb_info | ( | basic_block | ) |
void initialize_original_copy_tables | ( | void | ) |
Initialize the data structures to maintain mapping between blocks and its copies.
Referenced by ssa_name_has_uses_outside_loop_p(), vect_create_cond_for_alias_checks(), and vect_update_ivs_after_vectorizer().
Referenced by cfg_layout_can_merge_blocks_p(), insert_rtx_to_part_on_edge(), and reg_killed_on_edge().
|
inlinestatic |
Return inverse probability for PROB.
int inverted_post_order_compute | ( | int * | ) |
Referenced by dom_walker::walk().
void iterate_fix_dominators | ( | enum cdi_direction | dir, |
vec< basic_block > | bbs, | ||
bool | conservative | ||
) |
Recompute dominance information for basic blocks in the set BBS. The function assumes that the immediate dominators of all the other blocks in CFG are correct, and that there are no unreachable blocks.
If CONSERVATIVE is true, we additionally assume that all the ancestors of a block of BBS in the current dominance tree dominate it.
We only support updating dominators. There are some problems with updating postdominators (need to add fake edges from infinite loops and noreturn functions), and since we do not currently use iterate_fix_dominators for postdominators, any attempt to handle these problems would be unused, untested, and almost surely buggy. We keep the DIR argument for consistency with the rest of the dominator analysis interface.
The algorithm we use takes inspiration from the following papers, although the details are quite different from any of them: [1] G. Ramalingam, T. Reps, An Incremental Algorithm for Maintaining the Dominator Tree of a Reducible Flowgraph [2] V. C. Sreedhar, G. R. Gao, Y.-F. Lee: Incremental computation of dominator trees [3] K. D. Cooper, T. J. Harvey and K. Kennedy: A Simple, Fast Dominance Algorithm First, we use the following heuristics to decrease the size of the BBS set: a) if BB has a single predecessor, then its immediate dominator is this predecessor additionally, if CONSERVATIVE is true: b) if all the predecessors of BB except for one (X) are dominated by BB, then X is the immediate dominator of BB c) if the nearest common ancestor of the predecessors of BB is X and X -> BB is an edge in CFG, then X is the immediate dominator of BB Then, we need to establish the dominance relation among the basic blocks in BBS. We split the dominance tree by removing the immediate dominator edges from BBS, creating a forest F. We form a graph G whose vertices are BBS and ENTRY and X -> Y is an edge of G if there exists an edge X' -> Y in CFG such that X' belongs to the tree of the dominance forest whose root is X. We then determine dominance tree of G. Note that for X, Y in BBS, X dominates Y in CFG if and only if X dominates Y in G. In this step, we can use arbitrary algorithm to determine dominators. We decided to prefer the algorithm [3] to the algorithm of Lengauer and Tarjan, since the set BBS is usually small (rarely exceeding 10 during gcc bootstrap), and [3] should perform better in this case. Finally, we need to determine the immediate dominators for the basic blocks of BBS. If the immediate dominator of X in G is Y, then the immediate dominator of X in CFG belongs to the tree of F rooted in Y. We process the dominator tree T of G recursively, starting from leaves. Suppose that X_1, X_2, ..., X_k are the sons of Y in T, and that the subtrees of the dominance tree of CFG rooted in X_i are already correct. Let G' be the subgraph of G induced by {X_1, X_2, ..., X_k}. We make the following observations: (i) the immediate dominator of all blocks in a strongly connected component of G' is the same (ii) if X has no predecessors in G', then the immediate dominator of X is the nearest common ancestor of the predecessors of X in the subtree of F rooted in Y Therefore, it suffices to find the topological ordering of G', and process the nodes X_i in this order using the rules (i) and (ii). Then, we contract all the nodes X_i with Y in G, so that the further steps work correctly.
Split the tree now. If the idoms of blocks in BBS are not conservatively correct, setting the dominators using the heuristics in prune_bbs_to_update_dominators could create cycles in the dominance "tree", and cause ICE.
Construct the graph G.
If the dominance tree is conservatively correct, split it now.
Do not include parallel edges to G.
Find the dominator tree of G.
Finally, traverse the tree and find the immediate dominators.
void link_block | ( | basic_block | , |
basic_block | |||
) |
edge make_edge | ( | basic_block | , |
basic_block | , | ||
int | |||
) |
edge make_single_succ_edge | ( | basic_block | , |
basic_block | , | ||
int | |||
) |
Referenced by remove_fake_predecessors().
bool mark_dfs_back_edges | ( | void | ) |
Mark the back edges in DFS traversal. Return nonzero if a loop (natural or otherwise) is present. Inspired by Depth_First_Search_PP described in:
Advanced Compiler Design and Implementation Steven Muchnick Morgan Kaufmann, 1997
and heavily borrowed from pre_and_rev_post_order_compute.
Allocate the preorder and postorder number arrays.
Allocate stack for back-tracking up CFG.
Allocate bitmap to track nodes that have been visited.
None of the nodes in the CFG have been visited yet.
Push the first edge on to the stack.
Look at the edge on the top of the stack.
Check if the edge destination has been visited yet.
Mark that we have visited the destination.
Since the DEST node has been visited for the first time, check its successors.
Referenced by draw_cfg_nodes().
bool maybe_hot_bb_p | ( | struct function * | , |
const_basic_block | |||
) |
In predict.c
Referenced by optimize_function_for_speed_p(), and optimize_loop_nest_for_size_p().
basic_block nearest_common_dominator | ( | enum | cdi_direction, |
basic_block | , | ||
basic_block | |||
) |
Referenced by bb_dom_dfs_in(), occ_new(), and verify_dominators().
basic_block nearest_common_dominator_for_set | ( | enum | cdi_direction, |
bitmap | |||
) |
Referenced by same_phi_alternatives_1().
basic_block next_dom_son | ( | enum | cdi_direction, |
basic_block | |||
) |
Referenced by do_partial_partial_insertion(), get_immediate_dominator(), and glb_enum_p().
bool optimize_bb_for_size_p | ( | const_basic_block | ) |
Referenced by create_outofssa_var_map().
bool optimize_bb_for_speed_p | ( | const_basic_block | ) |
Referenced by optimize_bb_for_size_p().
Referenced by find_traces_1_round().
Referenced by tree_ssa_unswitch_loops().
Referenced by optimize_insn_for_size_p(), optimize_insn_for_speed_p(), and rewrite_use_compare().
Compute reverse top sort order. This is computing a post order numbering of the graph. If INCLUDE_ENTRY_EXIT is true, then ENTRY_BLOCK and EXIT_BLOCK are included. If DELETE_UNREACHABLE is true, unreachable blocks are deleted.
Allocate stack for back-tracking up CFG.
Allocate bitmap to track nodes that have been visited.
None of the nodes in the CFG have been visited yet.
Push the first edge on to the stack.
Look at the edge on the top of the stack.
Check if the edge destination has been visited yet.
Mark that we have visited the destination.
Since the DEST node has been visited for the first time, check its successors.
Delete the unreachable blocks if some were found and we are supposed to do it.
References ei_next(), ei_one_before_end_p(), ENTRY_BLOCK_PTR, and basic_block_def::index.
int pre_and_rev_post_order_compute | ( | int * | pre_order, |
int * | rev_post_order, | ||
bool | include_entry_exit | ||
) |
Like pre_and_rev_post_order_compute_fn but operating on the current function and asserting that all nodes were visited.
The number of nodes visited should be the number of blocks.
The number of nodes visited should be the number of blocks minus the entry and exit blocks which are not visited here.
References bitmap_bit_p, flow_dfs_compute_reverse_add_bb(), FOR_EACH_EDGE, basic_block_def::index, basic_block_def::preds, depth_first_search_dsS::sp, edge_def::src, depth_first_search_dsS::stack, and depth_first_search_dsS::visited_blocks.
int pre_and_rev_post_order_compute_fn | ( | struct function * | fn, |
int * | pre_order, | ||
int * | rev_post_order, | ||
bool | include_entry_exit | ||
) |
Compute the depth first search order of FN and store in the array PRE_ORDER if nonzero. If REV_POST_ORDER is nonzero, return the reverse completion number for each node. Returns the number of nodes visited. A depth first search tries to get as far away from the starting point as quickly as possible.
In case the function has unreachable blocks the number of nodes visited does not include them.
pre_order is a really a preorder numbering of the graph. rev_post_order is really a reverse postorder numbering of the graph.
Allocate stack for back-tracking up CFG.
Allocate bitmap to track nodes that have been visited.
None of the nodes in the CFG have been visited yet.
Push the first edge on to the stack.
Look at the edge on the top of the stack.
Check if the edge destination has been visited yet.
Mark that we have visited the destination.
Since the DEST node has been visited for the first time, check its successors.
There are no successors for the DEST node so assign its reverse completion number.
There are no more successors for the SRC node so assign its reverse completion number.
|
read |
In lcm.c
Given local properties TRANSP, ANTLOC, AVOUT, KILL return the insert and delete vectors for edge based LCM. Returns an edgelist which is used to map the insert vector to what edge an expression should be inserted on.
Compute global availability.
Compute global anticipatability.
Compute earliestness.
Allocate an extra element for the exit block in the laterin vector.
|
read |
Given local properties TRANSP, ST_AVLOC, ST_ANTLOC, KILL return the insert and delete vectors for edge based reverse LCM. Returns an edgelist which is used to map the insert vector to what edge an expression should be inserted on.
Compute global anticipatability.
Compute farthestness.
Allocate an extra element for the entry block.
void predict_edge_def | ( | edge | e, |
enum br_predictor | predictor, | ||
enum prediction | taken | ||
) |
Predict edge E by given predictor if possible.
Referenced by apply_return_prediction(), and tree_bb_level_predictions().
void print_edge_list | ( | FILE * | , |
struct edge_list * | |||
) |
Referenced by compute_insert_delete().
bool probably_never_executed_bb_p | ( | struct function * | , |
const_basic_block | |||
) |
Referenced by sanitize_hot_paths().
Referenced by sanitize_hot_paths().
bool purge_all_dead_edges | ( | void | ) |
Search all basic blocks for potentially dead edges and purge them. Return true if some edge has been eliminated.
Referenced by split_live_ranges_for_shrink_wrap().
bool purge_dead_edges | ( | basic_block | ) |
basic_block recompute_dominator | ( | enum | cdi_direction, |
basic_block | |||
) |
Referenced by first_mem_ref_loc_1::operator()(), and prune_bbs_to_update_dominators().
void redirect_edge_pred | ( | edge | , |
basic_block | |||
) |
Referenced by expand_transaction().
void redirect_edge_succ | ( | edge | , |
basic_block | |||
) |
Referenced by first_mem_ref_loc_1::operator()(), and prologue_epilogue_contains().
edge redirect_edge_succ_nodup | ( | edge | , |
basic_block | |||
) |
Referenced by create_empty_if_region_on_edge().
void redirect_immediate_dominators | ( | enum cdi_direction | dir, |
basic_block | bb, | ||
basic_block | to | ||
) |
Redirect all edges pointing to BB to TO.
void relink_block_chain | ( | bool | ) |
void remove_edge_raw | ( | edge | ) |
Referenced by remove_branch().
void remove_fake_edges | ( | void | ) |
This routine will remove all fake edges from the flow graph. If we remove all fake successors, it will automatically remove all fake predecessors.
References EXIT_BLOCK_PTR, flow_dfs_compute_reverse_add_bb(), and flow_dfs_compute_reverse_init().
void remove_fake_exit_edges | ( | void | ) |
This routine will remove all fake edges to the EXIT_BLOCK.
References dfs_find_deadend(), EXIT_BLOCK_PTR, flow_dfs_compute_reverse_add_bb(), flow_dfs_compute_reverse_execute(), and make_edge().
Referenced by pre_insert_copies().
void remove_predictions_associated_with_edge | ( | edge | ) |
void rtl_make_eh_edge | ( | sbitmap | , |
basic_block | , | ||
rtx | |||
) |
void rtl_predict_edge | ( | edge | , |
enum | br_predictor, | ||
int | |||
) |
bool rtl_predicted_by_p | ( | const_basic_block | , |
enum | br_predictor | ||
) |
void rtl_profile_for_bb | ( | basic_block | ) |
In cfgexpand.c.
void rtl_profile_for_edge | ( | edge | ) |
void scale_bbs_frequencies_gcov_type | ( | basic_block * | bbs, |
int | nbbs, | ||
gcov_type | num, | ||
gcov_type | den | ||
) |
Multiply all frequencies of basic blocks in array BBS of length NBBS by NUM/DEN, in gcov_type arithmetic. More accurate than previous function but considerably slower.
void scale_bbs_frequencies_int | ( | basic_block * | , |
int | , | ||
int | , | ||
int | |||
) |
void set_bb_copy | ( | basic_block | , |
basic_block | |||
) |
void set_bb_original | ( | basic_block | , |
basic_block | |||
) |
void set_dom_info_availability | ( | enum | cdi_direction, |
enum | dom_state | ||
) |
void set_immediate_dominator | ( | enum cdi_direction | dir, |
basic_block | bb, | ||
basic_block | dominated_by | ||
) |
Set the immediate dominator of the block possibly removing existing edge. NULL can be used to remove any edge.
Referenced by create_empty_if_region_on_edge(), determine_dominators_for_sons(), first_mem_ref_loc_1::operator()(), prune_bbs_to_update_dominators(), recompute_dominator(), redirect_edge_succ_nodup(), remove_conditions_and_labels(), split_edge(), tidy_fallthru_edges(), update_dominators_in_loop(), and verify_dominators().
|
inlinestatic |
Returns the single predecessor block of basic block BB. Aborts if BB does not have exactly one predecessor.
Referenced by create_loads_and_stores_for_name(), find_comparison_dom_walker::find_comparison_dom_walker(), get_ancestor_addr_info(), maybe_instrument_assignment(), redirect_edge_succ_nodup(), split_edge(), tidy_fallthru_edges(), and verify_dominators().
basic_block* single_pred_before_succ_order | ( | void | ) |
Returns the list of basic blocks in the function in an order that guarantees that if a block X has just a single predecessor Y, then Y is after X in the ordering.
Walk the predecessors of x as long as they have precisely one predecessor and add them to the list, so that they get stored after x.
|
inlinestatic |
Returns the single predecessor edge of basic block BB. Aborts if BB does not have exactly one predecessor.
Referenced by create_if_region_on_edge(), and rewrite_trees().
|
inlinestatic |
Returns true if BB has precisely one predecessor.
Referenced by cond_move_convert_if_block(), find_dom(), find_traces_1_round(), get_ancestor_addr_info(), rewrite_trees(), simple_mem_ref_in_stmt(), threadedge_finalize_values(), update_dominators_in_loop(), vect_can_advance_ivs_p(), and verify_dominators().
|
inlinestatic |
Returns the single successor block of basic block BB. Aborts if BB does not have exactly one successor.
Referenced by cond_move_convert_if_block(), create_empty_if_region_on_edge(), create_loop_fn(), dependent_clean(), expand_omp_atomic_load(), expand_omp_sections(), find_traces_1_round(), instrument_memory_accesses(), ipa_tm_scan_irr_block(), redirect_edge_succ_nodup(), remap_ssa_name(), remove_exit_barriers(), split_bbs_on_noreturn_calls(), split_edge(), and tidy_fallthru_edges().
|
inlinestatic |
Returns the single successor edge of basic block BB. Aborts if BB does not have exactly one successor.
Referenced by cond_exec_find_if_block(), cond_move_convert_if_block(), create_empty_if_region_on_edge(), create_if_region_on_edge(), create_loads_and_stores_for_name(), create_loop_fn(), create_temp_arrays(), find_traces_1_round(), phi_alternatives_equal(), split_edge(), unsplit_all_eh(), update_dominators_in_loop(), value_replacement(), and verify_loop_closed_ssa().
|
inlinestatic |
Returns true if BB has precisely one successor.
Referenced by cond_move_convert_if_block(), create_preheader(), find_dom(), find_traces_1_round(), prologue_epilogue_contains(), remap_ssa_name(), threadedge_finalize_values(), and unsplit_all_eh().
basic_block split_edge_and_insert | ( | edge | , |
rtx | |||
) |
edge try_redirect_by_replacing_jump | ( | edge | , |
basic_block | , | ||
bool | |||
) |
edge unchecked_make_edge | ( | basic_block | , |
basic_block | , | ||
int | |||
) |
Referenced by fixup_new_cold_bb(), and unchecked_make_edge().
void unlink_block | ( | basic_block | ) |
void update_bb_for_insn | ( | basic_block | ) |
void update_bb_profile_for_threading | ( | basic_block | bb, |
int | edge_frequency, | ||
gcov_type | count, | ||
edge | taken_edge | ||
) |
An edge originally destinating BB of FREQUENCY and COUNT has been proved to leave the block by TAKEN_EDGE. Update profile of BB such that edge E can be redirected to destination of TAKEN_EDGE.
This function may leave the profile inconsistent in the case TAKEN_EDGE frequency or count is believed to be lower than FREQUENCY or COUNT respectively.
Compute the probability of TAKEN_EDGE being reached via threaded edge. Watch for overflows.
Now rescale the probabilities.
Protect from overflow due to additional scaling.
References FOR_EACH_EDGE, edge_def::probability, RDIV, REG_BR_PROB_BASE, and basic_block_def::succs.
void update_br_prob_note | ( | basic_block | ) |
Referenced by add_labels_and_missing_jumps(), and make_pass_into_cfg_layout_mode().
void verify_dominators | ( | enum | cdi_direction | ) |
Referenced by cleanup_tree_cfg_1().
void verify_edge_list | ( | FILE * | , |
struct edge_list * | |||
) |
Referenced by compute_insert_delete().
edge mfb_kj_edge |
In cfgloopmanip.c.
A callback for make_forwarder block, to redirect all edges except for MFB_KJ_EDGE to the entry part. E is the edge for that we should decide whether to redirect it.
struct gcov_ctr_summary* profile_info |
Counter summary from the last set of coverage counts read by profile.c.
Counter summary from the last set of coverage counts read.