GCC Middle and Back End API Reference
cfghooks.h File Reference

Go to the source code of this file.

Data Structures

struct  cfg_hooks

Functions

void verify_flow_info (void)
void dump_bb (FILE *, basic_block, int, int)
void dump_bb_for_graph (pretty_printer *, basic_block)
edge redirect_edge_and_branch (edge, basic_block)
basic_block redirect_edge_and_branch_force (edge, basic_block)
bool can_remove_branch_p (const_edge)
void remove_branch (edge)
void remove_edge (edge)
edge split_block (basic_block, void *)
edge split_block_after_labels (basic_block)
bool move_block_after (basic_block, basic_block)
void delete_basic_block (basic_block)
basic_block split_edge (edge)
basic_block create_basic_block (void *, void *, basic_block)
basic_block create_empty_bb (basic_block)
bool can_merge_blocks_p (basic_block, basic_block)
void merge_blocks (basic_block, basic_block)
edge make_forwarder_block (basic_block, bool(*)(edge), void(*)(basic_block))
basic_block force_nonfallthru (edge)
void tidy_fallthru_edge (edge)
void tidy_fallthru_edges (void)
void predict_edge (edge e, enum br_predictor predictor, int probability)
bool predicted_by_p (const_basic_block bb, enum br_predictor predictor)
bool can_duplicate_block_p (const_basic_block)
basic_block duplicate_block (basic_block, edge, basic_block)
bool block_ends_with_call_p (basic_block bb)
bool empty_block_p (basic_block)
basic_block split_block_before_cond_jump (basic_block)
bool block_ends_with_condjump_p (const_basic_block bb)
int flow_call_edges_add (sbitmap)
void execute_on_growing_pred (edge)
void execute_on_shrinking_pred (edge)
bool cfg_hook_duplicate_loop_to_header_edge (struct loop *loop, edge, unsigned int ndupl, sbitmap wont_exit, edge orig, vec< edge > *to_remove, int flags)
void lv_flush_pending_stmts (edge)
void extract_cond_bb_edges (basic_block, edge *, edge *)
void lv_adjust_loop_header_phi (basic_block, basic_block, basic_block, edge)
void lv_add_condition_to_bb (basic_block, basic_block, basic_block, void *)
bool can_copy_bbs_p (basic_block *, unsigned)
void copy_bbs (basic_block *, unsigned, basic_block *, edge *, unsigned, edge *, struct loop *, basic_block, bool)
void account_profile_record (struct profile_record *, int)
void cfg_layout_initialize (unsigned int)
void cfg_layout_finalize (void)
enum ir_type current_ir_type (void)
void rtl_register_cfg_hooks (void)
void cfg_layout_rtl_register_cfg_hooks (void)
void gimple_register_cfg_hooks (void)
struct cfg_hooks get_cfg_hooks (void)
void set_cfg_hooks (struct cfg_hooks)

Variables

struct cfg_hooks gimple_cfg_hooks
struct cfg_hooks rtl_cfg_hooks
struct cfg_hooks cfg_layout_rtl_cfg_hooks

Function Documentation

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_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  )
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  )
struct cfg_hooks get_cfg_hooks ( void  )
read

References cfg_hooks.

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


Variable Documentation

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