GCC Middle and Back End API Reference
tree-ssa-propagate.h File Reference

Go to the source code of this file.


typedef enum ssa_prop_result(* ssa_prop_visit_stmt_fn )(gimple, edge *, tree *)
typedef enum ssa_prop_result(* ssa_prop_visit_phi_fn )(gimple)
typedef bool(* ssa_prop_fold_stmt_fn )(gimple_stmt_iterator *gsi)
typedef tree(* ssa_prop_get_value_fn )(tree)




static void prop_set_simulate_again ()
static bool prop_simulate_again_p ()
bool valid_gimple_rhs_p (tree)
void move_ssa_defining_stmt_for_defs (gimple, gimple)
bool update_gimple_call (gimple_stmt_iterator *, tree, int,...)
bool update_call_from_tree (gimple_stmt_iterator *, tree)
void ssa_propagate (ssa_prop_visit_stmt_fn, ssa_prop_visit_phi_fn)
bool stmt_makes_single_store (gimple)
bool substitute_and_fold (ssa_prop_get_value_fn, ssa_prop_fold_stmt_fn, bool)
bool may_propagate_copy (tree, tree)
bool may_propagate_copy_into_stmt (gimple, tree)
bool may_propagate_copy_into_asm (tree)
void propagate_value (use_operand_p, tree)
void replace_exp (use_operand_p, tree)
void propagate_tree_value (tree *, tree)
void propagate_tree_value_into_stmt (gimple_stmt_iterator *, tree)

Typedef Documentation

typedef bool(* ssa_prop_fold_stmt_fn)(gimple_stmt_iterator *gsi)
typedef tree(* ssa_prop_get_value_fn)(tree)
typedef enum ssa_prop_result(* ssa_prop_visit_phi_fn)(gimple)
typedef enum ssa_prop_result(* ssa_prop_visit_stmt_fn)(gimple, edge *, tree *)
   Call-back functions used by the value propagation engine.  

Enumeration Type Documentation

   Lattice values used for propagation purposes.  Specific instances
   of a propagation engine must return these values from the statement
   and PHI visit functions to direct the engine.  
       The statement produces nothing of interest.  No edges will be
       added to the work lists.  
       The statement produces an interesting value.  The set SSA_NAMEs
       returned by SSA_PROP_VISIT_STMT should be added to
       INTERESTING_SSA_EDGES.  If the statement being visited is a
       conditional jump, SSA_PROP_VISIT_STMT should indicate which edge
       out of the basic block should be marked executable.  
       The statement produces a varying (i.e., useless) value and
       should not be simulated again.  If the statement being visited
       is a conditional jump, all the edges coming out of the block
       will be considered executable.  

Function Documentation

bool may_propagate_copy ( tree  ,
bool may_propagate_copy_into_asm ( tree  )
bool may_propagate_copy_into_stmt ( gimple  ,
void move_ssa_defining_stmt_for_defs ( gimple  ,
static void prop_set_simulate_again ( )
   If SIM_P is true, statement S will be simulated again.  

Referenced by init_parameter_lattice_values(), insert_range_assertions(), simulate_stmt(), and surely_varying_stmt_p().

static bool prop_simulate_again_p ( )
   Return true if statement T should be simulated again.  
void propagate_tree_value ( tree ,
void propagate_tree_value_into_stmt ( gimple_stmt_iterator ,
void propagate_value ( use_operand_p  ,
void replace_exp ( use_operand_p  ,
void ssa_propagate ( ssa_prop_visit_stmt_fn  visit_stmt,
ssa_prop_visit_phi_fn  visit_phi 
   Entry point to the propagation engine.

   VISIT_STMT is called for every statement visited.
   VISIT_PHI is called for every PHI node visited.  
     Iterate until the worklists are empty.  
             Pull the next block to simulate off the worklist.  
         In order to move things to varying as quickly as
         possible,process the VARYING_SSA_EDGES worklist first.  
         Now process the INTERESTING_SSA_EDGES worklist.  

Referenced by visit_assignment().

bool stmt_makes_single_store ( gimple  )
bool substitute_and_fold ( ssa_prop_get_value_fn  get_value_fn,
ssa_prop_fold_stmt_fn  fold_fn,
bool  do_dce 
   Perform final substitution and folding of propagated values.

   PROP_VALUE[I] contains the single value that should be substituted
   at every use of SSA name N_I.  If PROP_VALUE is NULL, no values are

   If FOLD_FN is non-NULL the function will be invoked on all statements
   before propagating values for pass specific simplification.

   DO_DCE is true if trivially dead stmts can be removed.

   If DO_DCE is true, the statements within a BB are walked from
   last to first element.  Otherwise we scan from first to last element.

   Return TRUE when something changed.  
     Substitute lattice values at definition sites.  
               Do not substitute ASSERT_EXPR rhs, this will confuse VRP.  
               Don't optimize away calls that have side-effects.  
     Propagate into all uses and fold.  
         Propagate known values into PHI nodes.  
         Propagate known values into stmts.  Do a backward walk if
         do_dce is true. In some case it exposes
         more trivially deletable stmts to walk backward.  
             Ignore ASSERT_EXPRs.  They are used by VRP to generate
             range information for names and they are discarded
             No point propagating into a stmt whose result is not used,
             but instead we might be able to remove a trivially dead stmt.
             Don't do this when called from VRP, since the SSA_NAME which
             is going to be released could be still referenced in VRP
             Replace the statement with its folded version and mark it
             Some statements may be simplified using propagator
             specific information.  Do this before propagating
             into the stmt to not disturb pass specific information.  
             Replace real uses in the statement.  
             If we made a replacement, fold the statement.  
             Now cleanup.  
                 If we cleaned up EH information from the statement,
                 remove EH edges.  
                 Determine what needs to be done to update the SSA form.  
bool update_call_from_tree ( gimple_stmt_iterator ,
bool update_gimple_call ( gimple_stmt_iterator ,
tree  ,
int  ,
bool valid_gimple_rhs_p ( tree  )