GCC Middle and Back End API Reference
|
Go to the source code of this file.
Data Structures | |
struct | cfg_hooks |
Variables | |
struct cfg_hooks | gimple_cfg_hooks |
struct cfg_hooks | rtl_cfg_hooks |
struct cfg_hooks | cfg_layout_rtl_cfg_hooks |
void account_profile_record | ( | struct profile_record * | , |
int | |||
) |
bool block_ends_with_call_p | ( | basic_block | bb | ) |
bool block_ends_with_condjump_p | ( | const_basic_block | bb | ) |
bool can_copy_bbs_p | ( | basic_block * | , |
unsigned | |||
) |
bool can_duplicate_block_p | ( | const_basic_block | ) |
bool can_merge_blocks_p | ( | basic_block | , |
basic_block | |||
) |
bool can_remove_branch_p | ( | const_edge | ) |
bool cfg_hook_duplicate_loop_to_header_edge | ( | struct loop * | loop, |
edge | e, | ||
unsigned int | ndupl, | ||
sbitmap | wont_exit, | ||
edge | orig, | ||
vec< edge > * | to_remove, | ||
int | flags | ||
) |
Loop versioning uses the duplicate_loop_to_header_edge to create a new version of the loop basic-blocks, the parameters here are exactly the same as in duplicate_loop_to_header_edge or tree_duplicate_loop_to_header_edge; while in tree-ssa there is additional work to maintain ssa information that's why there is a need to call the tree_duplicate_loop_to_header_edge rather than duplicate_loop_to_header_edge when we are in tree mode.
References cfg_hooks::cfg_hook_duplicate_loop_to_header_edge.
Referenced by loop_version().
void cfg_layout_finalize | ( | void | ) |
Finalize the changes: reorder insn list according to the sequence specified by aux pointers, enter compensation code, rebuild scope forest.
References delete_dead_jumptables(), fixup_fallthru_exit_predecessor(), fixup_reorder_chain(), force_one_exit_fallthru(), get_insns(), HAVE_epilogue, rebuild_jump_labels(), reload_completed, rtl_register_cfg_hooks(), verify_flow_info(), and verify_insn_chain().
Referenced by duplicate_computed_gotos(), outof_cfg_layout_mode(), reorder_loops(), rest_of_handle_reorder_blocks(), rest_of_handle_sms(), and thread_prologue_and_epilogue_insns().
void cfg_layout_initialize | ( | unsigned | int | ) |
void cfg_layout_rtl_register_cfg_hooks | ( | void | ) |
Initialization of functions specific to the rtl IR.
References cfg_layout_rtl_cfg_hooks.
Referenced by cfg_layout_initialize().
void copy_bbs | ( | basic_block * | bbs, |
unsigned | n, | ||
basic_block * | new_bbs, | ||
edge * | edges, | ||
unsigned | num_edges, | ||
edge * | new_edges, | ||
struct loop * | base, | ||
basic_block | after, | ||
bool | update_dominance | ||
) |
Duplicates N basic blocks stored in array BBS. Newly created basic blocks are placed into array NEW_BBS in the same order. Edges from basic blocks in BBS are also duplicated and copies of those that lead into BBS are redirected to appropriate newly created block. The function assigns bbs into loops (copy of basic block bb is assigned to bb->loop_father->copy loop, so this must be set up correctly in advance) If UPDATE_DOMINANCE is true then this function updates dominators locally (LOOPS structure that contains the information about dominators is passed to enable this), otherwise it does not update the dominator information and it assumed that the caller will do this, perhaps by destroying and recreating it instead of trying to do an incremental update like this function does when update_dominance is true. BASE is the superloop to that basic block belongs; if its header or latch is copied, we do not set the new blocks as header or latch. Created copies of N_EDGES edges in array EDGES are stored in array NEW_EDGES, also in the same order. Newly created basic blocks are put after the basic block AFTER in the instruction stream, and the order of the blocks in BBS array is preserved.
References CDI_DOMINATORS, edge_def::dest, duplicate_block(), basic_block_def::flags, get_bb_copy(), get_immediate_dominator(), loop::header, loop::latch, basic_block_def::loop_father, redirect_edge_and_branch_force(), set_immediate_dominator(), and basic_block_def::succs.
Referenced by duplicate_loop_to_header_edge(), gimple_duplicate_sese_region(), gimple_duplicate_sese_tail(), ipa_uninstrument_transaction(), and slpeel_tree_duplicate_loop_to_edge_cfg().
basic_block create_basic_block | ( | void * | , |
void * | , | ||
basic_block | |||
) |
basic_block create_empty_bb | ( | basic_block | ) |
enum ir_type current_ir_type | ( | void | ) |
Declarations.
Returns current ir type.
References cfg_layout_rtl_cfg_hooks, gimple_cfg_hooks, IR_GIMPLE, IR_RTL_CFGLAYOUT, IR_RTL_CFGRTL, and rtl_cfg_hooks.
Referenced by cleanup_cfg(), delete_unreachable_blocks(), dump_eh_tree(), emit_barrier_after_bb(), find_cond_trap(), find_subloop_latch_edge(), gt_ggc_mx(), gt_pch_nx(), lv_adjust_loop_entry_edge(), mark_all_labels(), remove_edge(), reorder_basic_blocks(), rtl_loop_init(), try_optimize_cfg(), and verify_hot_cold_block_grouping().
void delete_basic_block | ( | basic_block | ) |
void dump_bb | ( | FILE * | , |
basic_block | , | ||
int | , | ||
int | |||
) |
void dump_bb_for_graph | ( | pretty_printer * | , |
basic_block | |||
) |
basic_block duplicate_block | ( | basic_block | , |
edge | , | ||
basic_block | |||
) |
bool empty_block_p | ( | basic_block | ) |
void execute_on_growing_pred | ( | edge | ) |
void execute_on_shrinking_pred | ( | edge | ) |
void extract_cond_bb_edges | ( | basic_block | , |
edge * | , | ||
edge * | |||
) |
int flow_call_edges_add | ( | sbitmap | ) |
basic_block force_nonfallthru | ( | edge | ) |
void gimple_register_cfg_hooks | ( | void | ) |
Initialization of functions specific to the tree IR.
References gimple_cfg_hooks.
Referenced by analyze_function(), build_gimple_cfg(), cgraph_add_new_function(), cgraph_process_new_functions(), copy_cfg_body(), expand_function(), init_lowered_empty_function(), initialize_cfun(), input_function(), ipa_passes(), and optimize_inline_calls().
void lv_add_condition_to_bb | ( | basic_block | first, |
basic_block | second, | ||
basic_block | new_block, | ||
void * | cond | ||
) |
Conditions in trees and RTL are different so we need a different handling when we add the condition to the versioning code.
References cfg_hooks::lv_add_condition_to_bb.
Referenced by lv_adjust_loop_entry_edge().
void lv_adjust_loop_header_phi | ( | basic_block | first, |
basic_block | second, | ||
basic_block | new_block, | ||
edge | e | ||
) |
Responsible for updating the ssa info (PHI nodes) on the new condition basic block that guards the versioned loop.
References cfg_hooks::lv_adjust_loop_header_phi.
Referenced by lv_adjust_loop_entry_edge().
void lv_flush_pending_stmts | ( | edge | ) |
edge make_forwarder_block | ( | basic_block | bb, |
bool(*)(edge) | redirect_edge_p, | ||
void(*)(basic_block) | new_bb_cbk | ||
) |
Split BB into entry part and the rest (the rest is the newly created block). Redirect those edges for that REDIRECT_EDGE_P returns true to the entry part. Returns the edge connecting the entry part to the rest.
References add_bb_to_loop(), CDI_DOMINATORS, edge_def::count, basic_block_def::count, edge_def::dest, dom_info_available_p(), ei_next(), ei_safe_edge(), find_common_loop(), find_edge(), basic_block_def::frequency, loop::header, internal_error(), iterate_fix_dominators(), loop::latch, basic_block_def::loop_father, loop_outer(), cfg_hooks::make_forwarder_block, cfg_hooks::name, basic_block_def::preds, redirect_edge_and_branch_force(), remove_bb_from_loops(), split_block_after_labels(), and edge_def::src.
Referenced by create_preheader(), create_single_exit_edge(), form_subloop(), merge_latch_edges(), and thread_through_loop_header().
void merge_blocks | ( | basic_block | , |
basic_block | |||
) |
bool move_block_after | ( | basic_block | , |
basic_block | |||
) |
void predict_edge | ( | edge | e, |
enum br_predictor | predictor, | ||
int | probability | ||
) |
bool predicted_by_p | ( | const_basic_block | bb, |
enum br_predictor | predictor | ||
) |
edge redirect_edge_and_branch | ( | edge | , |
basic_block | |||
) |
basic_block redirect_edge_and_branch_force | ( | edge | , |
basic_block | |||
) |
void remove_branch | ( | edge | ) |
void remove_edge | ( | edge | ) |
void rtl_register_cfg_hooks | ( | void | ) |
Initialization of functions specific to the rtl IR.
References rtl_cfg_hooks.
Referenced by cfg_layout_finalize(), and gimple_expand_cfg().
void set_cfg_hooks | ( | struct cfg_hooks | ) |
edge split_block | ( | basic_block | , |
void * | |||
) |
edge split_block_after_labels | ( | basic_block | ) |
basic_block split_block_before_cond_jump | ( | basic_block | ) |
basic_block split_edge | ( | edge | ) |
void tidy_fallthru_edge | ( | edge | ) |
void tidy_fallthru_edges | ( | void | ) |
Fix up edges that now fall through, or rather should now fall through but previously required a jump around now deleted blocks. Simplify the search by only examining blocks numerically adjacent, since this is how they were created. ??? This routine is currently RTL specific.
References edge_def::dest, find_reg_note(), edge_def::flags, basic_block_def::next_bb, basic_block_def::prev_bb, single_succ_edge(), single_succ_p(), cfg_hooks::tidy_fallthru_edge, and tidy_fallthru_edge().
Referenced by delete_unreachable_blocks(), and post_order_compute().
void verify_flow_info | ( | void | ) |
Verify the CFG consistency. Currently it does following: checks edge and basic block list correctness and calls into IL dependent checking then.
References edge_def::count, basic_block_def::count, edge_def::dest, edge_def::dest_idx, dump_edge_info(), error(), edge_def::flags, free(), basic_block_def::frequency, basic_block_def::index, edge_iterator::index, internal_error(), basic_block_def::loop_father, basic_block_def::next_bb, basic_block_def::preds, basic_block_def::prev_bb, edge_def::probability, edge_def::src, basic_block_def::succs, timevar_pop(), timevar_push(), and cfg_hooks::verify_flow_info.
Referenced by cfg_layout_finalize(), cleanup_tree_cfg_noloop(), commit_edge_insertions(), execute_function_todo(), expand_thunk(), gimple_expand_cfg(), gimple_flow_call_edges_add(), if_convert(), move_loop_invariants(), rtl_flow_call_edges_add(), split_all_insns(), tree_transform_and_unroll_loop(), and try_optimize_cfg().
struct cfg_hooks cfg_layout_rtl_cfg_hooks |
Implementation of CFG manipulation for cfg layout RTL, where basic block connected via fallthru edges does not have to be adjacent. This representation will hopefully become the default one in future version of the compiler.
Referenced by cfg_layout_rtl_register_cfg_hooks(), and current_ir_type().
struct cfg_hooks gimple_cfg_hooks |
Hooks containers.
Referenced by current_ir_type(), and gimple_register_cfg_hooks().
struct cfg_hooks rtl_cfg_hooks |
Implementation of CFG manipulation for linearized RTL.
Referenced by current_ir_type(), and rtl_register_cfg_hooks().