GCC Middle and Back End API Reference
|
Functions | |
static bool | remove_fallthru_edge () |
static bool | cleanup_control_expr_graph () |
static bool | cleanup_control_flow_bb () |
static bool | tree_forwarder_block_p () |
static bool | phi_alternatives_equal () |
static bool | remove_forwarder_block () |
bool | fixup_noreturn_call () |
static bool | split_bbs_on_noreturn_calls () |
static bool | cleanup_tree_cfg_bb () |
static bool | cleanup_tree_cfg_1 () |
static bool | cleanup_tree_cfg_noloop () |
static void | repair_loop_structures () |
bool | cleanup_tree_cfg () |
static bool | remove_forwarder_block_with_phi () |
static unsigned int | merge_phi_nodes () |
static bool | gate_merge_phi () |
gimple_opt_pass * | make_pass_merge_phi () |
Variables | |
bitmap | cfgcleanup_altered_bbs |
|
static |
Disconnect an unreachable block in the control expression starting at block BB.
References bitmap_set_bit(), edge_def::count, ei_next(), ei_safe_edge(), find_taken_edge(), edge_def::flags, fold_binary_loc(), fold_defer_overflow_warnings(), fold_undefer_and_ignore_overflow_warnings(), fold_undefer_overflow_warnings(), gimple_cond_code(), gimple_cond_lhs(), gimple_cond_rhs(), gimple_location(), gimple_switch_index(), gsi_remove(), gsi_stmt(), basic_block_def::index, edge_def::probability, remove_edge_and_dominated_blocks(), single_succ_edge(), single_succ_p(), basic_block_def::succs, and WARN_STRICT_OVERFLOW_CONDITIONAL.
Referenced by cleanup_control_flow_bb().
|
static |
Try to remove superfluous control structures in basic block BB. Returns true if anything changes.
References bitmap_set_bit(), cleanup_control_expr_graph(), edge_def::dest, ei_next(), ei_safe_edge(), edge_def::flags, gimple_call_noreturn_p(), gimple_goto_dest(), gimple_purge_dead_eh_edges(), gsi_end_p(), gsi_last_bb(), gsi_remove(), gsi_stmt(), basic_block_def::index, is_gimple_call(), remove_edge_and_dominated_blocks(), remove_fallthru_edge(), and basic_block_def::succs.
Referenced by cleanup_tree_cfg_bb().
bool cleanup_tree_cfg | ( | void | ) |
Cleanup cfg and repair loop structures.
References changed, cleanup_tree_cfg_noloop(), LOOPS_NEED_FIXUP, loops_state_satisfies_p(), and repair_loop_structures().
Referenced by execute_build_cfg(), execute_cleanup_cfg_post_optimizing(), execute_expand_omp(), execute_function_todo(), expand_omp_taskreg(), graphite_finalize(), tree_profiling(), tree_ssa_dse(), and tree_unroll_loops_completely().
|
static |
Iterate the cfg cleanups, while anything changes.
References bitmap_clear_bit(), bitmap_empty_p(), bitmap_first_set_bit(), cleanup_tree_cfg_bb(), end_recording_case_labels(), split_bbs_on_noreturn_calls(), and start_recording_case_labels().
Referenced by cleanup_tree_cfg_noloop().
|
static |
Tries to cleanup cfg in basic block BB. Returns true if anything changes.
References can_merge_blocks_p(), cleanup_control_flow_bb(), merge_blocks(), remove_forwarder_block(), single_succ(), single_succ_p(), and tree_forwarder_block_p().
Referenced by cleanup_tree_cfg_1().
|
static |
Remove unreachable blocks and other miscellaneous clean up work. Return true if the flowgraph was modified, false otherwise.
References calculate_dominance_info(), CDI_DOMINATORS, changed, cleanup_tree_cfg_1(), compact_blocks(), delete_unreachable_blocks(), dom_info_available_p(), LOOPS_NEED_FIXUP, loops_state_set(), timevar_pop(), timevar_push(), verify_dominators(), and verify_flow_info().
Referenced by cleanup_tree_cfg().
bool fixup_noreturn_call | ( | ) |
STMT is a call that has been discovered noreturn. Fixup the CFG and remove LHS. Return true if something changed.
References bitmap_set_bit(), changed, delete_basic_block(), gimple_bb(), gimple_call_builtin_p(), gimple_call_lhs(), gimple_call_set_lhs(), gimple_vdef(), gsi_last_bb(), gsi_stmt(), release_ssa_name(), remove_fallthru_edge(), split_block(), basic_block_def::succs, and update_stmt().
Referenced by execute_fixup_cfg(), and split_bbs_on_noreturn_calls().
|
static |
gimple_opt_pass* make_pass_merge_phi | ( | ) |
|
static |
@verbatim This pass merges PHI nodes if one feeds into another. For example,
suppose we have the following:
goto <bb 9> (<L9>);
<L8>:; tem_17 = foo ();
<L9>:;
<L10>:;
Then we merge the first PHI node into the second one like so:
goto <bb 9> (<L10>);
<L8>:; tem_17 = foo ();
<L10>:;
References bb_has_abnormal_pred(), calculate_dominance_info(), CDI_DOMINATORS, changed, edge_def::dest_idx, dominated_by_p(), free(), gimple_phi_arg_def(), gimple_phi_result(), gimple_seq_empty_p(), gsi_end_p(), gsi_next(), gsi_start_phis(), gsi_stmt(), has_zero_uses(), LOOPS_NEED_FIXUP, loops_state_set(), phi_nodes(), remove_forwarder_block_with_phi(), single_imm_use(), single_succ(), single_succ_edge(), tree_forwarder_block_p(), and worklist.
|
static |
If all the PHI nodes in DEST have alternatives for E1 and E2 and those alternatives are equal in each of the PHI nodes, then return true, else return false.
References edge_def::dest_idx, gimple_phi_arg_def(), gsi_end_p(), gsi_next(), gsi_start_phis(), gsi_stmt(), and operand_equal_for_phi_arg_p().
Referenced by remove_forwarder_block(), and remove_forwarder_block_with_phi().
|
static |
Remove any fallthru edge from EV. Return true if an edge was removed.
References edge_def::flags, and remove_edge_and_dominated_blocks().
Referenced by cleanup_control_flow_bb(), and fixup_noreturn_call().
|
static |
Removes forwarder block BB. Returns false if this failed.
References add_phi_arg(), bb_has_abnormal_pred(), bitmap_set_bit(), CDI_DOMINATORS, debug, delete_basic_block(), edge_def::dest, edge_def::dest_idx, dom, dom_info_available_p(), ei_safe_edge(), find_edge(), first_stmt(), get_immediate_dominator(), gimple_label_label(), gimple_phi_arg_def(), gimple_phi_arg_location_from_edge(), gimple_seq_empty_p(), gsi_after_labels(), gsi_end_p(), gsi_insert_before(), gsi_next(), gsi_remove(), GSI_SAME_STMT, gsi_start_bb(), gsi_start_phis(), gsi_stmt(), basic_block_def::index, is_gimple_debug(), nearest_common_dominator(), phi_alternatives_equal(), phi_nodes(), basic_block_def::preds, redirect_edge_and_branch(), redirect_edge_succ_nodup(), set_immediate_dominator(), single_pred_p(), single_succ_edge(), and unshare_expr().
Referenced by cleanup_tree_cfg_bb().
|
static |
Tries to merge the PHI nodes at BB into those at BB's sole successor. Returns true if successful.
References add_phi_arg(), CDI_DOMINATORS, delete_basic_block(), edge_def::dest, edge_def::dest_idx, dom, find_edge(), first_stmt(), get_immediate_dominator(), gimple_label_label(), gimple_phi_arg_def(), gimple_phi_arg_location_from_edge(), gsi_end_p(), gsi_next(), gsi_start_phis(), gsi_stmt(), nearest_common_dominator(), phi_alternatives_equal(), basic_block_def::preds, redirect_edge_and_branch(), redirect_edge_var_map_clear(), redirect_edge_var_map_def(), redirect_edge_var_map_location(), redirect_edge_var_map_result(), redirect_edge_var_map_vector(), set_immediate_dominator(), single_succ_edge(), split_edge(), and edge_def::src.
Referenced by merge_phi_nodes().
|
static |
Repairs loop structures.
References calculate_dominance_info(), CDI_DOMINATORS, fix_loop_structure(), LOOP_CLOSED_SSA, loops_state_satisfies_p(), rewrite_into_loop_closed_ssa(), scev_reset(), timevar_pop(), timevar_push(), and verify_loop_structure().
Referenced by cleanup_tree_cfg().
|
static |
Split basic blocks on calls in the middle of a basic block that are now known not to return, and remove the unreachable code.
References cfun, changed, fixup_noreturn_call(), gimple_bb(), gimple_call_noreturn_p(), function::gimple_df, basic_block_def::index, and vec_safe_length().
Referenced by cleanup_tree_cfg_1().
|
static |
Return true if basic block BB does nothing except pass control flow to another block and that we can safely insert a label at the start of the successor block. As a precondition, we require that BB be not equal to ENTRY_BLOCK_PTR.
References edge_def::flags, gimple_label_label(), gimple_location(), gimple_seq_empty_p(), edge_def::goto_locus, gsi_end_p(), gsi_last_bb(), gsi_prev(), gsi_stmt(), loop::header, basic_block_def::loop_father, phi_nodes(), basic_block_def::preds, single_succ(), single_succ_edge(), single_succ_p(), and edge_def::src.
Referenced by cleanup_tree_cfg_bb(), and merge_phi_nodes().
bitmap cfgcleanup_altered_bbs |
@verbatim CFG cleanup for trees.
Copyright (C) 2001-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/.
The set of blocks in that at least one of the following changes happened: -- the statement at the end of the block was changed -- the block was newly created -- the set of the predecessors of the block changed -- the set of the successors of the block changed ??? Maybe we could track these changes separately, since they determine what cleanups it makes sense to try on the block.
Referenced by gimple_merge_blocks(), remove_edge_and_dominated_blocks(), and replace_uses_by().