GCC Middle and Back End API Reference
tree-cfgcleanup.c File 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_passmake_pass_merge_phi ()

Variables

bitmap cfgcleanup_altered_bbs

Function Documentation

static bool cleanup_tree_cfg_1 ( )
static
static bool cleanup_tree_cfg_bb ( )
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 bool cleanup_tree_cfg_noloop ( )
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 ( )
static bool gate_merge_phi ( )
static
gimple_opt_pass* make_pass_merge_phi ( )
static unsigned int merge_phi_nodes ( )
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 ();

tem_6 = PHI <tem_17(8), tem_23(7)>;

<L9>:;

tem_3 = PHI <tem_6(9), tem_2(5)>;

<L10>:;

Then we merge the first PHI node into the second one like so:

goto <bb 9> (<L10>);

<L8>:; tem_17 = foo ();

tem_3 = PHI <tem_23(7), tem_2(5), tem_17(8)>;

<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 bool phi_alternatives_equal ( )
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 bool remove_fallthru_edge ( )
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 bool split_bbs_on_noreturn_calls ( )
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 bool tree_forwarder_block_p ( )
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().


Variable Documentation

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().