GCC Middle and Back End API Reference
|
Go to the source code of this file.
Enumerations | |
enum | replace_direction { dir_none , dir_forward , dir_backward , dir_both } |
Functions | |
int | flow_find_cross_jump (basic_block, basic_block, rtx_insn **, rtx_insn **, enum replace_direction *) |
int | flow_find_head_matching_sequence (basic_block, basic_block, rtx_insn **, rtx_insn **, int) |
bool | delete_unreachable_blocks (void) |
void | delete_dead_jumptables (void) |
bool | cleanup_cfg (int) |
bool | bb_is_just_return (basic_block, rtx_insn **, rtx_insn **) |
enum replace_direction |
Control flow optimization header file. Copyright (C) 2014-2024 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GCC; see the file COPYING3. If not see <http://www.gnu.org/licenses/>.
Enumerator | |
---|---|
dir_none | |
dir_forward | |
dir_backward | |
dir_both |
|
extern |
Return true if BB contains just a return and possibly a USE of the return value. Fill in *RET and *USE with the return and use insns if any found, otherwise NULL. All CLOBBERs are ignored.
References ANY_RETURN_P, cfun, EXIT_BLOCK_PTR_FOR_FN, FOR_BB_INSNS_REVERSE, GET_CODE, NONDEBUG_INSN_P, NULL, PATTERN(), REG_FUNCTION_VALUE_P, REG_P, and XEXP.
Referenced by fixup_reorder_chain(), and try_optimize_cfg().
|
extern |
Tidy the CFG by deleting unreachable code and whatnot.
References add_noreturn_fake_exit_edges(), calculate_dominance_info(), CDI_DOMINATORS, changed, CLEANUP_CFG_CHANGED, CLEANUP_CFGLAYOUT, CLEANUP_CROSSJUMP, CLEANUP_EXPENSIVE, CLEANUP_FORCE_FAST_DCE, CLEANUP_NO_INSN_DEL, compact_blocks(), crossjumps_occurred, current_ir_type(), current_loops, dbg_cnt(), delete_dead_jumptables(), delete_trivially_dead_insns(), delete_unreachable_blocks(), dom_info_available_p(), fix_loop_structure(), free_dominance_info(), gcc_assert, get_insns(), IR_RTL_CFGLAYOUT, max_reg_num(), NULL, reload_completed, remove_fake_exit_edges(), run_fast_dce(), timevar_pop(), timevar_push(), and try_optimize_cfg().
Referenced by cfg_layout_initialize(), do_reload(), duplicate_computed_gotos(), execute_rtl_cprop(), execute_rtl_hoist(), execute_rtl_pre(), fwprop_done(), peephole2_optimize(), reload_cse_regs_1(), rest_of_handle_combine(), rest_of_handle_cse(), rest_of_handle_cse2(), rest_of_handle_cse_after_global_opts(), rest_of_handle_dse(), rest_of_handle_if_conversion(), rest_of_handle_thread_prologue_and_epilogue(), split_all_insns(), and pair_fusion::~pair_fusion().
|
extern |
Delete any jump tables never referenced. We can't delete them at the time of removing tablejump insn as they are referenced by the preceding insns computing the destination, so we delay deleting and garbagecollect them once life information is computed.
References BB_END, cfun, delete_insn(), dump_file, FOR_EACH_BB_FN, INSN_UID(), JUMP_TABLE_DATA_P, LABEL_NUSES, LABEL_P, LABEL_PRESERVE_P, NEXT_INSN(), and NOTE_INSN_BASIC_BLOCK_P.
Referenced by cfg_layout_finalize(), and cleanup_cfg().
|
extern |
Delete all unreachable basic blocks.
References b, CDI_DOMINATORS, cfun, changed, current_ir_type(), delete_basic_block(), dom_info_available_p(), ENTRY_BLOCK_PTR_FOR_FN, EXIT_BLOCK_PTR_FOR_FN, find_unreachable_blocks(), first_dom_son(), gcc_assert, get_all_dominated_blocks(), IR_GIMPLE, MAY_HAVE_DEBUG_BIND_INSNS, basic_block_def::prev_bb, and tidy_fallthru_edges().
Referenced by cleanup_cfg(), delete_unmarked_insns(), execute_cleanup_eh_1(), execute_rtl_cprop(), execute_rtl_hoist(), execute_rtl_pre(), execute_rtl_store_motion(), expand_thunk(), fixup_partitions(), fixup_reorder_chain(), indirect_jump_optimize(), one_cprop_pass(), rest_of_handle_dse(), tail_merge_optimize(), and unsplit_eh_edges().
|
extern |
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.
References active_insn_p(), BB_END, BB_HEAD, BB_PARTITION, BLOCK_FOR_INSN(), dir_backward, dir_both, dir_forward, dir_none, f1, f2, i1, i2, INSN_P, LABEL_P, merge_dir(), merge_memattrs(), merge_notes(), NONDEBUG_INSN_P, NULL, old_insns_match_p(), onlyjump_p(), PATTERN(), PREV_INSN(), reload_completed, returnjump_p(), side_effects_p(), simplejump_p(), and walk_to_nondebug_insn().
Referenced by cond_exec_process_if_block(), and try_crossjump_to_edge().
|
extern |
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. If STOP_AFTER is zero, count all INSN_P insns, if it is non-zero, only count active insns.
References active_insn_p(), BB_END, BB_HEAD, dir_both, f1, f2, FOR_EACH_EDGE, i1, i2, INSN_P, JUMP_P, merge_memattrs(), merge_notes(), NEXT_INSN(), NONDEBUG_INSN_P, NOTE_KIND, NOTE_P, NULL, old_insns_match_p(), and basic_block_def::succs.
Referenced by cond_exec_process_if_block(), and try_head_merge_bb().