GCC Middle and Back End API Reference
tree-phinodes.c File Reference

Functions

static int ideal_phi_node_len (int)
void phinodes_print_statistics ()
static gimple_statement_phiallocate_phi_node ()
static int ideal_phi_node_len ()
static gimple make_phi_node ()
void release_phi_node ()
static gimple_statement_phiresize_phi_node ()
void reserve_phi_args_for_new_edge ()
void add_phi_node_to_bb ()
gimple create_phi_node ()
void add_phi_arg ()
static void remove_phi_arg_num ()
void remove_phi_args ()
void remove_phi_node ()
void remove_phi_nodes ()

Variables

static vec< gimple, va_gc > * free_phinodes [NUM_BUCKETS-2]
static unsigned long free_phinode_count
unsigned int phi_nodes_reused
unsigned int phi_nodes_created

Function Documentation

void add_phi_arg ( )
Add a new argument to PHI node PHI.  DEF is the incoming reaching
   definition and E is the edge through which DEF reaches PHI.  The new
   argument is added at the end of the argument list.
   If PHI has reached its maximum capacity, add a few slots.  In this case,
   PHI points to the reallocated phi node when we return.   

References edge_def::dest, edge_def::dest_idx, edge_def::flags, gimple_phi_arg_set_location(), gimple_phi_capacity(), and gimple_phi_num_args().

void add_phi_node_to_bb ( )
static gimple_statement_phi* allocate_phi_node ( )
inlinestatic
Allocate a PHI node with at least LEN arguments.  If the free list
   happens to contain a PHI node with LEN arguments or more, return
   that one.   

References free_phinode_count, free_phinodes, ggc_internal_alloc_stat(), gimple_alloc_counts, gimple_alloc_sizes, gimple_phi_capacity(), is_empty(), phi_nodes_created, phi_nodes_reused, and vec_free().

Referenced by make_phi_node(), and resize_phi_node().

gimple create_phi_node ( )
Create a new PHI node for variable VAR at basic block BB.   

References add_phi_node_to_bb(), make_phi_node(), and basic_block_def::preds.

static int ideal_phi_node_len ( int  )
static
static int ideal_phi_node_len ( )
static
Given LEN, the original number of requested PHI arguments, return
   a new, "ideal" length for the PHI node.  The "ideal" length rounds
   the total size of the PHI node up to the next power of two bytes.

   Rounding up will not result in wasting any memory since the size request
   will be rounded up by the GC system anyway.  [ Note this is not entirely
   true since the original length might have fit on one of the special
   GC pages. ]  By rounding up, we may avoid the need to reallocate the
   PHI node later if we increase the number of arguments for the PHI.   

References ceil_log2().

void phinodes_print_statistics ( void  )
Dump some simple statistics regarding the re-use of PHI nodes.   

Referenced by dump_tree_statistics().

void release_phi_node ( )
We no longer need PHI, release it so that it may be reused.   

References delink_imm_use(), free_phinode_count, free_phinodes, gimple_phi_arg_imm_use_ptr(), gimple_phi_capacity(), gimple_phi_num_args(), len, and vec_safe_push().

static void remove_phi_arg_num ( )
static
Remove the Ith argument from PHI's argument list.  This routine
   implements removal by swapping the last alternative with the
   alternative we want to delete and then shrinking the vector, which
   is consistent with how we remove an edge from the edge vector.   

References delink_imm_use(), gimple_phi_arg_imm_use_ptr(), gimple_phi_arg_location(), gimple_phi_arg_set_location(), gimple_phi_num_args(), gimple_statement_phi::nargs, relink_imm_use(), and ssa_use_operand_d::use.

Referenced by remove_phi_args().

void remove_phi_args ( )
Remove all PHI arguments associated with edge E.   

References edge_def::dest, edge_def::dest_idx, gsi_end_p(), gsi_next(), gsi_start_phis(), gsi_stmt(), and remove_phi_arg_num().

void remove_phi_node ( )
Remove the PHI node pointed-to by iterator GSI from basic block BB.  After
   removal, iterator GSI is updated to point to the next PHI node in the
   sequence. If RELEASE_LHS_P is true, the LHS of this PHI node is released
   into the free pool of SSA names.   

References gimple_phi_result(), gsi_remove(), gsi_stmt(), insert_debug_temps_for_defs(), release_phi_node(), and release_ssa_name().

void remove_phi_nodes ( )
Remove all the phi nodes from BB.   

References gsi_end_p(), gsi_start_phis(), remove_phi_node(), and set_phi_nodes().


Variable Documentation

unsigned long free_phinode_count
static
vec<gimple, va_gc>* free_phinodes[NUM_BUCKETS-2]
static
unsigned int phi_nodes_created

Referenced by allocate_phi_node().

unsigned int phi_nodes_reused

Referenced by allocate_phi_node().