Polaris: constant.cc File Reference

constant.cc File Reference

Go to the source code of this file.

Functions

static Boolean _substitutable_type (EXPR_TYPE type, PC_REAL_BOOL subst_reals)
 substitutable_type Returns true if the given type may be legally substituted
static void _add_refs (RefSet< Symbol > &vars, const RefSet< Expression > &refs)
 add_refs - Add the given set of references to the given variable set.
static void _filter_vars (RefSet< Symbol > &vars, PC_REAL_BOOL subst_reals, PC_ARRAY_BOOL subst_arrays)
 filter_vars - Filter out all variables from the given set that are disallowed by my switch values.
static void _init_candidates (const RefSet< Symbol > &def_vars, const RefSet< Symbol > &use_vars, Map< Symbol, IntElem > &def_candidates, Map< Symbol, IntElem > &use_candidates, Array< Symbol * > &tag_to_candidate)
 init_candidates - Initialize def_candidates and use_candidates to be mappings from elements in def_vars or use_vars to integers.
static void _collect_candidates (const RefSet< Symbol > &def_vars, const StmtList &stmts, const Statement &first_stmt, const Statement &last_stmt, Map< Symbol, IntElem > &def_candidates, Map< Symbol, IntElem > &use_candidates, Array< Symbol * > &tag_to_candidate)
 collect_candidates - Determine all the variables that are candidates for forward substitution and initialize the _candidates and _tag_to_candidates data structures to contain these variables.
static void _collect_candidates (const StmtList &stmts, const Statement &first_stmt, const Statement &last_stmt, Map< Symbol, IntElem > &def_candidates, Map< Symbol, IntElem > &use_candidates, Array< Symbol * > &tag_to_candidate, PC_REAL_BOOL subst_reals, PC_ARRAY_BOOL subst_arrays)
static List< Statement > * _create_data_assigns (ProgramUnit &pgm, const RefSet< Symbol > *candidates, PC_REAL_BOOL subst_reals)
 create_data_assigns - Create a list of pseudo assignment statements which assign all variables in the program unit's data statements to their constant values.
static void _add_data_assigns (ProgramUnit &pgm, const RefSet< Symbol > *candidates, PC_REAL_BOOL subst_reals, RefSet< Statement > &pseudo_stmts)
 add_data_assigns - Add a list of pseudo assignment statements at the beginning of a program unit which assign all variables in the program unit's data statements to their constant values.
static void _add_control_assigns (StmtList &stmts, const Statement &first_stmt, const Statement &last_stmt, const RefSet< Symbol > *candidates, RefSet< Statement > &pseudo_stmts)
 add_control_assigns - Add a list of pseudo assignment statements at the start of the loop bodies of IF statements that represent constants derived from the conditional statement of the IF statement.
static void _init_workspaces (StmtList &stmts, const Statement &first_stmt, const Statement &last_stmt, const Map< Symbol, IntElem > &def_candidates, const Map< Symbol, IntElem > &use_candidates, const Array< Symbol * > &tag_to_candidate)
 init_workspaces Initialize the workspaces for each statement in the program.
static PropConstWS_get_workspace (const Statement &stmt)
 get_workspace Get the workspace for the given statement.
static void _dump_workspaces (ostream &o, const StmtList &stmts, const Statement &first_stmt, const Statement &last_stmt)
 dump_workspaces Dump out the data inside all of the workspaces of the program
static void _make_nonlocals_modified_at_calls (StmtList &stmts, const Statement &first_stmt, const Statement &last_stmt, const Map< Symbol, IntElem > &use_candidates, const Array< Symbol * > &tag_to_candidate)
 _make_nonlocals_modified_at_calls Make all non-local variables be marked as potentially modified for all call statements and all statements containing function calls.
static void _patch_flow_graph (StmtList &stmts, const Statement &first_stmt, const Statement &last_stmt)
 patch_flow_graph Add flow edges from all ENDDO statements in the flow graph to the statement following the ENDDO.
static int _num_stmts_in_block (const StmtList &stmts, const Statement &first_stmt, const Statement &last_stmt)
 num_stmts_in_block Return the number of statements in the given block.
static void _determine_entry_points (StmtList &stmts, const Statement &first_stmt, const Statement &last_stmt, RefSet< Statement > &entry_points)
 determine_entry_points.
static void _calc_toporder1 (PropConstWS &my_ws, int &toporder)
 _calc_toporder Calculate toporder for the flow graph.
static void _calc_toporder (StmtList &stmts, const Statement &first_stmt, const Statement &last_stmt, const RefSet< Statement > &entry_points, Array< Statement * > &toporder_to_stmt)
static Expression_annotate_expr (Expression *expr, const PropConstMap &orig_const_map, const PropConstMap &curr_const_map, const Map< Symbol, IntElem > &use_candidates)
 _annotate_expr Annotate the substituted field of variables of the given expression with their constant values.
static Expression_annotate_expr (Expression *expr, const PropConstMap &const_map, const Map< Symbol, IntElem > &use_candidates)
 _annotate_expr Annotate the substituted field of variables of the given expression with their constant values.
Expression_annotate_expr (Expression *expr, const Statement &stmt, const Map< Symbol, IntElem > &use_candidates)
static void _annotate_assert (Statement &stmt, const PropConstMap &const_map, const Map< Symbol, IntElem > &use_candidates)
 _annotate_assert Annotate assertions of the given statement with the calculated constant expressions
static void _annotate_stmt (Statement &stmt, const Map< Symbol, IntElem > &use_candidates)
 _annotate_stmt Annotate expressions the given statement with the calculated constant expressions
static void _annotate_stmts (StmtList &stmts, const Statement &first_stmt, const Statement &last_stmt, const Map< Symbol, IntElem > &use_candidates)
 annotate_stmts Annotate each statement of the given block of statements with its calculated constant expressions.
void _kill_bad_join_consts (Statement &stmt, PropConstMap &const_map)
 kill_bad_join_consts Kill any constant expressions formed by the join of two or more reaching definitions, whose constant expression is no longer valid for one of these definitions.
static Boolean _const_if_took_then (const Statement &stmt)
 _const_if_took_then Return true if I am an IF statement with a constant conditional expression that took only the THEN clause.
Statement_const_if_succ (Statement &stmt, const Map< Symbol, IntElem > &use_candidates)
 _const_if_succ If I am a constant IF statement, return my single successor.
static void _put_succ_on_work_list (IntSet &work_list, Statement &stmt, const Map< Symbol, IntElem > &use_candidates)
 put_succ_on_work_list Put all of my successors on the work list.
static void _iterate_to_fixed_point (StmtList &, const Statement &, const Statement &, const RefSet< Statement > &entry_points, const Array< Statement * > &toporder_to_stmt, const Map< Symbol, IntElem > &use_candidates, const Array< Symbol * > &tag_to_candidate, const Map< Symbol, Expression > &entering_constants)
 iterate_to_fixed_point Propagate the constants contained in the statement's const_maps until a fixed point is reached.
static Boolean _is_block_unreachable (const StmtList &stmts, const Statement &first_stmt, const Statement &last_stmt)
 is_block_unreachable Return True if the block fo code between the given pair of statements is unreachable code.
static void _remove_unreachable (StmtList &stmts, const Statement &first_stmt, const Statement &last_stmt, const Map< Symbol, IntElem > &use_candidates)
 remove_unreachable Remove any dead code in the program.
static void _propagate_constants1 (StmtList &stmts, const Statement &first_stmt, const Statement &last_stmt, Map< Symbol, IntElem > &def_candidates, Map< Symbol, IntElem > &use_candidates, Array< Symbol * > &tag_to_candidate, RefSet< Statement > &pseudo_stmts, PC_UNREACH_BOOL remove_unreachable, int debug)
 propagate_constants1 - Main routine of propagate_constants.
static void _propagate_constants_all_vars (StmtList &stmts, const Statement &first_stmt, const Statement &last_stmt, RefSet< Statement > &pseudo_stmts, PC_REAL_BOOL subst_reals, PC_ARRAY_BOOL subst_arrays, PC_UNREACH_BOOL remove_unreachable, int debug)
 propagate_constants_all_vars Perform constant propagation for all variables in the given statement block.
static void _propagate_constants_some_vars (StmtList &stmts, const Statement &first_stmt, const Statement &last_stmt, const RefSet< Symbol > &candidates, RefSet< Statement > &pseudo_stmts, PC_UNREACH_BOOL remove_unreachable, int debug)
 propagate_constants_all_vars Perform constant propagation for only the variables in candidates for the given statement block.
void propagate_constants (StmtList &stmts, const Statement &first_stmt, const Statement &last_stmt, PC_REAL_BOOL subst_reals, PC_ARRAY_BOOL subst_arrays, PC_UNREACH_BOOL remove_unreachable, int debug GIV(0))
 propagate_constants - Perform forward substitution of scalar variables throughout pgm.
void propagate_constants (ProgramUnit &pgm, PC_REAL_BOOL subst_reals, PC_ARRAY_BOOL subst_arrays, PC_UNREACH_BOOL remove_unreachable, int debug GIV(0))
void propagate_constants (StmtList &stmts, const Statement &first_stmt, const Statement &last_stmt, const RefSet< Symbol > &candidates, PC_UNREACH_BOOL remove_unreachable, int debug GIV(0))
void propagate_constants (ProgramUnit &pgm, const RefSet< Symbol > &candidates, PC_UNREACH_BOOL remove_unreachable, int debug GIV(0))
int propagate_constants_pu (char **data, int *len)
 Description: Used by InterProcConstProp to compute the side effects of a single program unit.
static void _init_ipcp_workspaces (StmtList &stmts, const IPCPProcData &proc_data, const Map< Symbol, IntElem > &def_candidates, const Map< Symbol, IntElem > &use_candidates, const Array< Symbol * > &tag_to_candidate)
 init_ipcp_workspaces Initialize the workspaces for each statement in the program.
static RefSet< Symbol > * _build_modified_vars (const StmtList &stmts, const RefSet< Statement > &ignorable_stmts, const Array< Symbol * > &tag_to_candidate)
 _build_modified_vars.
static void _alias_consts (RefSet< Symbol > &alias_consts, RefMap< Symbol, Symbol > &alias_const_map, const RefList< Symbol > &formals, const List< Expression > &actuals, const RefSet< Symbol > &keepable_vars)
 alias_consts Compute the set of actual parameters that are aliased to formal parameters, where it is safe to replace the actual parameters with the formal parameters.
static void _rename_alias_consts (Expression &expr, const RefMap< Symbol, Symbol > &alias_const_map)
 rename_alias_consts Rename all variables in the given mapping to their mapped values.
static Expression_remove_local_effects_from_expr1 (Expression *expr, const PropConstMap &const_map, const Map< Symbol, IntElem > &candidates)
 _remove_local_effects_from_expr Given an expression and a constant map, eliminate all locally modified variables form the expression, so that the final expression would be in terms of the initial values of the subroutine.
static Expression_remove_local_effects_from_expr (Expression *expr, const PropConstMap &const_map, const Map< Symbol, IntElem > &candidates)
static Map< Symbol, Expression > * _create_old_const_mods (const Map< Symbol, IntElem > &candidates, const PropConstMap &const_map, const RefSet< Symbol > &keepable_vars, const RefSet< Symbol > *modified_vars_ref)
 _create_old_const_mods Create a mapping from old constants to new constants.
static Expression_subst_unkeepable_vars (Expression *expr, const RefSet< Symbol > &keepable_vars)
 subst_unkeepable_vars Substitute all unkeepable variables.
static Map< Symbol, Expression > * _create_new_consts (const Map< Symbol, IntElem > &candidates, const PropConstMap &const_map, const RefSet< Symbol > &keepable_vars)
 _create_new_consts Create a set of newly generated symbolic constants.
static const List< Expression > & _call_arg_list (const Statement &call_site)
 call_arg_list Return a reference to the argument list of the given call site.
static Boolean _contains_non_candidate_vars (const Expression &expr, const Map< Symbol, IntElem > &candidates)
 contains_non_candidate_vars Return true if the expression contains a variable not in cadidates.
static List< Expression > * _create_new_actual_consts (const Map< Symbol, IntElem > &candidates, const Statement &stmt, const IPCPProcData &, const IPCPProcData &call_proc_data, const RefSet< Symbol > &keepable_vars)
 create_new_actual_consts Build a set of new actual expressions.
static void _build_call_jump_functions (ProgramUnit &pgm, IPCPProcData &proc_data, const Map< Symbol, IntElem > &candidates, const RefSet< Symbol > *modified_vars_ref)
 build_call_jump_function Build a jump function for each call site.
static void _ipcp_compute_constants (ProgramUnit &pgm, IPCPProcData &proc_data, const Map< Symbol, IntElem > &def_candidates, const Map< Symbol, IntElem > &use_candidates, Array< Symbol * > &tag_to_candidate, const Map< Symbol, Expression > &entering_constants)
 ipcp_compute_constants Compute the constants for single procedure for interprocedural constant propagation.
void _ipcp_build_jump_functions (ProgramUnit &pgm, IPCPProcData &proc_data, const RefSet< Symbol > &def_vars, const RefSet< Symbol > &use_vars, const Map< Symbol, Expression > &entering_constants, int debug GIV(0))
 ipcp_build_jump_functions Build the jump functions for the given proc_data object.
void _ipcp_propagate_constants (ProgramUnit &pgm, IPCPProcData &proc_data, const RefSet< Symbol > &def_vars, const RefSet< Symbol > &use_vars, PC_UNREACH_BOOL remove_unreachable, const Map< Symbol, Expression > &entering_constants, int debug GIV(0))
 ipcp_propagate_constants Propagate constants within a single procedure for interprocedural constant propagation.
static void _assert_clear_substituted (Statement &stmt)
 _assert_clear_substituted Remove all constant subexpression annotations from all expressions in all assertions of the given statement.
void clear_substituted (ProgramUnit &pgm)
 Description: See previous function.
void clear_substituted (StmtList &stmts, const Statement &first_stmt, const Statement &last_stmt)
 Description: See previous function.
void clear_substituted (Statement &stmt)
 Description: See previous function.
void clear_substituted (Expression &expr)
 Description: Interface to clear_substituted(pgm) from SETL.
int clear_substituted_pu (char **data, int *len)
 Description: Replace some variables with their precomputed constant expressions for all expressions in the given object.
Boolean substituted_var ()
 Description: Reset the substituted_var flag to False.
void clear_substituted_var ()
 Description: Substitute all precomputed values for PARAMETER constants.
static void _assert_expand_substituted (Statement &stmt, Boolean(*expr_filter)(const Expression &), Boolean(*const_filter)(const Expression &))
 Do this for all assertions except INDUCTION, FIRSTVALUE, RANGEWRITTEN assertions.
static void _call_args_expand_substituted (Expression &comma_expr, Boolean(*expr_filter)(const Expression &), Boolean(*const_filter)(const Expression &))
 call_args_expand_substituted Expand all constants in the given list of expressions, except for those constants at the top level.
void expand_substituted (ProgramUnit &pgm, Boolean(*expr_filter)(const Expression &) GIV(0), Boolean(*const_filter)(const Expression &) GIV(0))
 expand_substituted Replace some variables with their precomputed constant expressions for all expressions in the given object.
void expand_substituted (StmtList &stmts, const Statement &first_stmt, const Statement &last_stmt, Boolean(*expr_filter)(const Expression &) GIV(0), Boolean(*const_filter)(const Expression &) GIV(0))
void expand_substituted (Statement &stmt, Boolean(*expr_filter)(const Expression &) GIV(0), Boolean(*const_filter)(const Expression &) GIV(0))
int expand_substituted_pu (char **data, int *len)
 Description: Acts similarly to the function expand_substituted() except that it applies to only a single expression.
static Boolean _is_constant_expr (const Expression &expr)
 is_constant_expr Return True if the given expression would simplify down to an integer constant or logical constant.
Expressionexpr_expand_substituted (Expression *expr, Boolean(*expr_filter)(const Expression &) GIV(0), Boolean(*const_filter)(const Expression &) GIV(0))
 expr_expand_substituted Acts similarly to the method expand_substituted() except that it applies to only a single expression.
static Boolean _is_expr_top_linear (const Expression &expr)
 expand_linear_substituted Expand the variables whose constant expressions are linear for all expressions in the object.
static Boolean _linear_const_filter (const Expression &expr)
void expand_linear_substituted (ProgramUnit &pgm)
 Description: See previous function.
void expand_linear_substituted (StmtList &stmts, const Statement &first_stmt, const Statement &last_stmt)
 Description: See previous function.
void expand_linear_substituted (Statement &stmt)
 Description: See previous function.
Expressionexpr_expand_linear_substituted (Expression *expr)
 Description: Expand the variables whose constant expressions are either an ID expression or an expression that can be simplified to an integer or logical constant.
static Boolean _is_constant_expr_filter (const Expression &expr)
 expand_small_substituted Expand the variables whose constant expressions are ID expressions or integer or logical constant expressions.
static Boolean _small_const_filter (const Expression &expr)
void expand_small_substituted (ProgramUnit &pgm)
 Description: See previous function.
void expand_small_substituted (StmtList &stmts, const Statement &first_stmt, const Statement &last_stmt)
 Description: See previous function.
void expand_small_substituted (Statement &stmt)
 Description: See previous function.
Expressionexpr_expand_small_substituted (Expression *expr)
 Description: Return True if any calls to the expand_substituted routines substitutes a variable in an expression.
static Boolean _has_param_in_expr (const Expression &expr)
 has_param_in_expr Return true if the given expression has a parameter variable contained within it.
static void _assert_substitute_parameters (Statement &stmt, PC_REAL_BOOL subst_reals)
 _assert_substitute_parameters Substitute all precomputed values for PARAMETER constants in all assertions of the given statement.
static void substitute_parameters_data (ProgramUnit &pgm, PC_REAL_BOOL subst_reals)
void substitute_parameters (ProgramUnit &pgm, PC_REAL_BOOL subst_reals)
 Description: See previous function.
void substitute_parameters (Symtab &symtab, PC_REAL_BOOL subst_reals)
 Description: See previous function.
void substitute_parameters (StmtList &stmts, const Statement &first_stmt, const Statement &last_stmt, PC_REAL_BOOL subst_reals)
 Description: See previous function.
void substitute_parameters (Statement &stmt, PC_REAL_BOOL subst_reals)
 Description: Interface to substutute_parameters(pgm) from SETL.
Expressionexpr_substitute_parameters (Expression *expr, PC_REAL_BOOL subst_reals)
 expr_substitute_parameters Acts similarly to the method substitute_parameters() except that it applies to only a single expression.
int substitute_parameters_pu (char **data, int *len)
 Description: Acts similarly to the function substitute_parameters() except that it applies to only a single expression.

Variables

static unsigned int _pass_tag
static int _debug_level = 0
 ... Pass tag associated with this pass
static Boolean _substituted_var = False
static Boolean _stmt_substituted_var = False
 ...


Detailed Description

Definition in file constant.cc.


Function Documentation

static Boolean _substitutable_type EXPR_TYPE  type,
PC_REAL_BOOL  subst_reals
[inline, static]
 

substitutable_type Returns true if the given type may be legally substituted

Definition at line 50 of file constant.cc.

References COMPLEX_TYPE, DOUBLE_PRECISION_TYPE, False, INTEGER_TYPE, LOGICAL_TYPE, REAL_TYPE, SUBST_REALS, and True.

Referenced by _collect_candidates(), _create_data_assigns(), _filter_vars(), and expr_substitute_parameters().

static void _add_refs RefSet< Symbol > &  vars,
const RefSet< Expression > &  refs
[static]
 

add_refs - Add the given set of references to the given variable set.

Definition at line 68 of file constant.cc.

References Expression::base_variable_ref(), Iterator< T >::current(), and Iterator< T >::valid().

Referenced by _collect_candidates().

static void _filter_vars RefSet< Symbol > &  vars,
PC_REAL_BOOL  subst_reals,
PC_ARRAY_BOOL  subst_arrays
[static]
 

filter_vars - Filter out all variables from the given set that are disallowed by my switch values.

Definition at line 83 of file constant.cc.

References _substitutable_type(), Iterator< T >::current(), Type::data_type(), Mutator< T >::del(), Symbol::is_array(), SUBST_ARRAYS, Symbol::sym_class(), Symbol::type(), Iterator< T >::valid(), and VARIABLE_CLASS.

Referenced by _collect_candidates().

static void _init_candidates const RefSet< Symbol > &  def_vars,
const RefSet< Symbol > &  use_vars,
Map< Symbol, IntElem > &  def_candidates,
Map< Symbol, IntElem > &  use_candidates,
Array< Symbol * > &  tag_to_candidate
[static]
 

init_candidates - Initialize def_candidates and use_candidates to be mappings from elements in def_vars or use_vars to integers.

Also initialize tag_to_candidates to be a reverse mapping of def_candidates and use_candidates. Variables in use_candidates and in def_candidates will be assigned the same integer for both data structures. Variables in def_candidates are assigned the smallest numbers. It is assumed that use_candidates is a superset of def_candidates.

... Initialize def_candidates.

... Initialize use_candidates.

Definition at line 110 of file constant.cc.

References Iterator< T >::current(), Iterator< T >::valid(), and IntElem::value().

Referenced by _collect_candidates(), _ipcp_build_jump_functions(), and _ipcp_propagate_constants().

static void _collect_candidates const RefSet< Symbol > &  def_vars,
const StmtList stmts,
const Statement first_stmt,
const Statement last_stmt,
Map< Symbol, IntElem > &  def_candidates,
Map< Symbol, IntElem > &  use_candidates,
Array< Symbol * > &  tag_to_candidate
[static]
 

collect_candidates - Determine all the variables that are candidates for forward substitution and initialize the _candidates and _tag_to_candidates data structures to contain these variables.

Definition at line 159 of file constant.cc.

References _add_refs(), _init_candidates(), ASSIGNMENT_STMT, Iterator< T >::current(), ID_OP, Statement::in_refs(), Statement::lhs(), Expression::op(), Statement::stmt_class(), Expression::symbol(), and Iterator< T >::valid().

Referenced by _propagate_constants_all_vars(), _propagate_constants_some_vars(), and eliminate_dead_code().

static void _collect_candidates const StmtList stmts,
const Statement first_stmt,
const Statement last_stmt,
Map< Symbol, IntElem > &  def_candidates,
Map< Symbol, IntElem > &  use_candidates,
Array< Symbol * > &  tag_to_candidate,
PC_REAL_BOOL  subst_reals,
PC_ARRAY_BOOL  subst_arrays
[static]
 

Definition at line 185 of file constant.cc.

References _add_refs(), _filter_vars(), _init_candidates(), _substitutable_type(), ASSIGNMENT_STMT, Iterator< T >::current(), Type::data_type(), ID_OP, Statement::in_refs(), RefSet< T >::ins(), Symbol::is_array(), Expression::is_side_effect_free(), Statement::lhs(), Expression::op(), Statement::rhs(), Statement::stmt_class(), Symbol::sym_class(), Expression::symbol(), Symbol::type(), Iterator< T >::valid(), and VARIABLE_CLASS.

static List<Statement>* _create_data_assigns ProgramUnit pgm,
const RefSet< Symbol > *  candidates,
PC_REAL_BOOL  subst_reals
[static]
 

create_data_assigns - Create a list of pseudo assignment statements which assign all variables in the program unit's data statements to their constant values.

Definition at line 229 of file constant.cc.

References _substitutable_type(), NonBinaryExpr::arg_list(), Expression::base_variable_ref(), Expression::clone(), Iterator< T >::current(), Type::data_type(), List< T >::entries(), List< T >::ins_last(), Symbol::is_array(), Symbol::type(), Iterator< T >::valid(), Data::value_list(), and Data::variable_list().

Referenced by _add_data_assigns().

static void _add_data_assigns ProgramUnit pgm,
const RefSet< Symbol > *  candidates,
PC_REAL_BOOL  subst_reals,
RefSet< Statement > &  pseudo_stmts
[static]
 

add_data_assigns - Add a list of pseudo assignment statements at the beginning of a program unit which assign all variables in the program unit's data statements to their constant values.

A RefList of these statements is returned for future deletion. This function will only add such assignments if the program unit is the main program.

Definition at line 274 of file constant.cc.

References _create_data_assigns(), Iterator< T >::current(), List< T >::entries(), List< T >::ins(), List< T >::ins_after(), PROGRAM_PU_TYPE, and Iterator< T >::valid().

Referenced by propagate_constants().

static void _add_control_assigns StmtList stmts,
const Statement first_stmt,
const Statement last_stmt,
const RefSet< Symbol > *  candidates,
RefSet< Statement > &  pseudo_stmts
[static]
 

add_control_assigns - Add a list of pseudo assignment statements at the start of the loop bodies of IF statements that represent constants derived from the conditional statement of the IF statement.

A RefList of these statements is returned for future deletion.

... Make sure that we have an ELSE clause.

... Handle IF (FLAG) THEN ... or IF (.NOT. FLAG) THEN ...

... Handle IF (X .EQ. 1) THEN ... or IF (X .NE. 1) THEN ...

Definition at line 308 of file constant.cc.

References Expression::clone(), constant(), Iterator< T >::current(), Type::data_type(), ELSE_STMT, ELSEIF_STMT, ENDIF_STMT, EQ_OP, Statement::expr(), Expression::expr_guarded(), Statement::follow_ref(), ID_OP, IF_STMT, IMPLIED_GOTO_STMT, INTEGER_CONSTANT_OP, INTEGER_TYPE, Expression::left_guarded(), LOGICAL_TYPE, NE_OP, NOT_OP, Expression::op(), Statement::prev_ref(), Expression::right_guarded(), Statement::stmt_class(), Expression::symbol(), Symbol::type(), and Iterator< T >::valid().

Referenced by _ipcp_build_jump_functions(), _ipcp_propagate_constants(), _propagate_constants_all_vars(), and _propagate_constants_some_vars().

static void _init_workspaces StmtList stmts,
const Statement first_stmt,
const Statement last_stmt,
const Map< Symbol, IntElem > &  def_candidates,
const Map< Symbol, IntElem > &  use_candidates,
const Array< Symbol * > &  tag_to_candidate
[static]
 

init_workspaces Initialize the workspaces for each statement in the program.

Note: A lot of the initialization for propagate_constants are hidden in the constructor for PropConstWS.

Definition at line 418 of file constant.cc.

References _pass_tag, Iterator< T >::current(), Expression::iterator(), WorkSpaceStack::push(), Iterator< T >::valid(), and Statement::work_stack().

Referenced by _propagate_constants1(), and eliminate_dead_code().

static PropConstWS& _get_workspace const Statement stmt  )  [static]
 

get_workspace Get the workspace for the given statement.

Definition at line 440 of file constant.cc.

References _pass_tag.

Referenced by _add_flow_edges(), _annotate_expr(), _annotate_stmt(), _build_call_jump_functions(), _build_modified_vars(), _calc_loop_variants(), _calc_toporder(), _calc_toporder1(), _collect_stats(), _compute_private_kill_sets(), _const_if_succ(), _const_if_took_then(), _create_new_actual_consts(), _delete_dead_code(), _determine_entry_points(), _dump_workspaces(), _ipcp_build_jump_functions(), _is_block_unreachable(), _iterate_to_fixed_point(), _iterate_to_fixed_point_phase(), _kill_bad_join_consts(), _make_nonlocals_modified_at_calls(), _make_nonlocals_used_at_calls(), _patch_flow_graph(), _put_pred_on_work_list(), _put_succ_on_work_list(), _remove_local_effects_from_expr1(), _remove_unreachable(), _set_needs_widening(), _update_do_succs(), _update_enddo_succs(), _update_if_succs(), _update_succ_edges(), and stmt_toporder().

static void _dump_workspaces ostream &  o,
const StmtList stmts,
const Statement first_stmt,
const Statement last_stmt
[static]
 

dump_workspaces Dump out the data inside all of the workspaces of the program

Definition at line 454 of file constant.cc.

References _get_workspace(), Iterator< T >::current(), PropConstWS::pretty_print(), Statement::print_debug(), Statement::structures_OK(), Statement::tag(), and Iterator< T >::valid().

Referenced by _ipcp_compute_constants(), _propagate_constants1(), and eliminate_dead_code().

static void _make_nonlocals_modified_at_calls StmtList stmts,
const Statement first_stmt,
const Statement last_stmt,
const Map< Symbol, IntElem > &  use_candidates,
const Array< Symbol * > &  tag_to_candidate
[static]
 

_make_nonlocals_modified_at_calls Make all non-local variables be marked as potentially modified for all call statements and all statements containing function calls.

... Calculate the set of non-local variables.

... Mark any variables aliased to the non-local variable ... as also non-local.

... Add the non-local variables to the mod_set of all statements that ... are either call statements or contain function calls.

Definition at line 474 of file constant.cc.

References _get_workspace(), Statement::act_refs(), ASSIGNMENT_STMT, Expression::base_variable_ref(), Symbol::common_ref(), Iterator< T >::current(), IntSet::del(), equiv_aliases(), Symbol::formal(), IntSet::ins(), RefSet< T >::ins(), PropConstMap::int_non_const(), IS_FORMAL, Statement::lhs(), PropConstWS::lhs_tag(), PropConstWS::mod_set, PropConstWS::out_const_map, Statement::stmt_class(), stmt_maymods(), switch_value(), PropConstWS::unknown_call, Iterator< T >::valid(), and IntElem::value().

Referenced by _ipcp_compute_constants(), and _propagate_constants1().

static void _patch_flow_graph StmtList stmts,
const Statement first_stmt,
const Statement last_stmt
[static]
 

patch_flow_graph Add flow edges from all ENDDO statements in the flow graph to the statement following the ENDDO.

These edges are added so to allow constant information calculated inside a DO loop to be propagated to statements after a DO loop in the same iteration. Without these additional edges, constant information calculated inside a loop can affect statements after the loop only on the successive iteration. This would mean that the the number of iterations required will be a multiple of the depth of the maximum loop nesting of the program.

Definition at line 594 of file constant.cc.

References _get_workspace(), _pass_tag, Iterator< T >::current(), ENDDO_STMT, RefSet< T >::ins(), Statement::next_ref(), PropConstWS::pred, Statement::stmt_class(), PropConstWS::succ, WorkSpaceStack::top_ref(), Iterator< T >::valid(), and Statement::work_stack().

Referenced by _ipcp_compute_constants(), and _propagate_constants1().

static int _num_stmts_in_block const StmtList stmts,
const Statement first_stmt,
const Statement last_stmt
[static]
 

num_stmts_in_block Return the number of statements in the given block.

Definition at line 618 of file constant.cc.

References Iterator< T >::valid().

Referenced by _calc_toporder(), _ipcp_build_jump_functions(), _ipcp_propagate_constants(), and _propagate_constants1().

static void _determine_entry_points StmtList stmts,
const Statement first_stmt,
const Statement last_stmt,
RefSet< Statement > &  entry_points
[static]
 

determine_entry_points.

Determine all the entry statements for the given block of statements. Simultaneously, delete all predecessors and successor edges entering/ exiting the block.

Definition at line 645 of file constant.cc.

References _get_workspace(), Iterator< T >::current(), Mutator< T >::del(), entry_points(), ENTRY_STMT, FLOW_ENTRY_STMT, RefDatabase< S, T >::ins(), RefList< T >::ins_last(), RefList< T >::member(), PropConstWS::pred, Statement::stmt_class(), PropConstWS::succ, and Iterator< T >::valid().

Referenced by _ipcp_compute_constants(), and _propagate_constants1().

static void _calc_toporder1 PropConstWS my_ws,
int &  toporder
[static]
 

_calc_toporder Calculate toporder for the flow graph.

Essentially, this algorithm performs a topological sort on the flow graph, ignoring back edges.

Definition at line 695 of file constant.cc.

References _get_workspace(), Iterator< T >::current(), PropConstWS::toporder(), Iterator< T >::valid(), and PropConstWS::visited().

Referenced by _calc_toporder(), and _calc_toporder1().

static void _calc_toporder StmtList stmts,
const Statement first_stmt,
const Statement last_stmt,
const RefSet< Statement > &  entry_points,
Array< Statement * > &  toporder_to_stmt
[static]
 

... Calculate the topological order for each statement

... Initialize toporder_to_stmt

Definition at line 712 of file constant.cc.

References _calc_toporder1(), _get_workspace(), _num_stmts_in_block(), Iterator< T >::current(), entry_points(), stmt_toporder(), PropConstWS::toporder(), Iterator< T >::valid(), and PropConstWS::visited().

Referenced by _ipcp_compute_constants(), _propagate_constants1(), eliminate_dead_code(), and stmt_toporder().

static Expression* _annotate_expr Expression expr,
const PropConstMap orig_const_map,
const PropConstMap curr_const_map,
const Map< Symbol, IntElem > &  use_candidates
[static]
 

_annotate_expr Annotate the substituted field of variables of the given expression with their constant values.

If certain constant values must be substituted, this algorithm will perform the substitution. If any of the variables that must be substituted in the given expression is non-constant, this function will return NULL.

... We must substitute the constant value of ... the variable because either an earlier ... substitution poisoned the variable or the ... definition point of that variable for the ... given expression differs from the ... definition point of that variable for the ... statement being annotated.

... Expression already has a filled substituted field.

Definition at line 762 of file constant.cc.

References _get_workspace(), Expression::arg_list(), Mutator< T >::assign(), clear_substituted(), Expression::clone(), CONST, constant(), IntSet::del(), PropConstElem::expr(), False, ID_OP, PropConstWS::in_const_map, IntSet::ins(), PropConstElem::last_mod(), LOGICAL_TYPE, PropConstWS::poisoned_vars, Mutator< T >::pull(), PropConstElem::state(), Expression::substituted(), Iterator< T >::valid(), and IntElem::value().

Referenced by _annotate_assert(), _annotate_expr(), _annotate_stmt(), _create_new_actual_consts(), and _create_new_consts().

static Expression* _annotate_expr Expression expr,
const PropConstMap const_map,
const Map< Symbol, IntElem > &  use_candidates
[static]
 

_annotate_expr Annotate the substituted field of variables of the given expression with their constant values.

Definition at line 867 of file constant.cc.

References _annotate_expr().

Expression* _annotate_expr Expression expr,
const Statement stmt,
const Map< Symbol, IntElem > &  use_candidates
 

Definition at line 879 of file constant.cc.

References _annotate_expr(), _get_workspace(), and PropConstWS::out_const_map.

static void _annotate_assert Statement stmt,
const PropConstMap const_map,
const Map< Symbol, IntElem > &  use_candidates
[static]
 

_annotate_assert Annotate assertions of the given statement with the calculated constant expressions

Definition at line 894 of file constant.cc.

References _annotate_expr(), Assertion::arg_list_guarded(), Assertion::arg_list_valid(), Mutator< T >::assign(), Iterator< T >::current(), ID_OP, Expression::op(), Mutator< T >::pull(), and Iterator< T >::valid().

Referenced by _annotate_stmt().

static void _annotate_stmt Statement stmt,
const Map< Symbol, IntElem > &  use_candidates
[static]
 

_annotate_stmt Annotate expressions the given statement with the calculated constant expressions

... Create a copy of my entering constants, where all variables ... modified by myself is marked as non-constant.

... Annotate all the expressions in myself.

... Update lhs.

... Update rhs, ignoring the modification to the lhs variable.

Definition at line 921 of file constant.cc.

References _annotate_assert(), _annotate_expr(), _debug_level, _get_workspace(), Mutator< T >::assign(), ASSIGNMENT_STMT, IntSet::first(), PropConstWS::in_const_map, PropConstWS::mod_set, IntSet::next(), Expression::print_debug(), Mutator< T >::pull(), and Iterator< T >::valid().

Referenced by _annotate_stmts().

static void _annotate_stmts StmtList stmts,
const Statement first_stmt,
const Statement last_stmt,
const Map< Symbol, IntElem > &  use_candidates
[static]
 

annotate_stmts Annotate each statement of the given block of statements with its calculated constant expressions.

Definition at line 985 of file constant.cc.

References _annotate_stmt(), Iterator< T >::current(), Expression::iterator(), and Iterator< T >::valid().

Referenced by _ipcp_propagate_constants(), and _propagate_constants1().

void _kill_bad_join_consts Statement stmt,
PropConstMap const_map
 

kill_bad_join_consts Kill any constant expressions formed by the join of two or more reaching definitions, whose constant expression is no longer valid for one of these definitions.

That is, one of the variables used by the constant expression was modified somewhere along a control flow path from the definition to the current statement.

... We have a join of two or more definitions of a constant ... symbolic expression.

... Test each of its reaching definitions.

... Test each of its uses.

Definition at line 1004 of file constant.cc.

References _get_workspace(), CONST, Iterator< T >::current(), IntSet::entries(), RefSet< T >::entries(), False, IntSet::first(), PropConstElem::last_mod(), MAY_BE_CONST, IntSet::next(), PropConstElem::non_const(), PropConstWS::num_visits(), PropConstWS::out_const_map, PropConstWS::pred, PropConstElem::state(), True, PropConstElem::use_set(), and Iterator< T >::valid().

Referenced by _iterate_to_fixed_point().

static Boolean _const_if_took_then const Statement stmt  )  [static]
 

_const_if_took_then Return true if I am an IF statement with a constant conditional expression that took only the THEN clause.

Definition at line 1065 of file constant.cc.

References _get_workspace(), PropConstWS::const_cond, ELSEIF_STMT, False, IF_STMT, and PropConstWS::num_visits().

Referenced by _iterate_to_fixed_point().

Statement* _const_if_succ Statement stmt,
const Map< Symbol, IntElem > &  use_candidates
 

_const_if_succ If I am a constant IF statement, return my single successor.

Otherwise return NULL.

Definition at line 1084 of file constant.cc.

References _get_workspace(), ARITHMETIC_IF_STMT, ELSEIF_STMT, Statement::follow_ref(), IF_STMT, PropConstWS::in_const_map, int_const_val(), Statement::label_list(), and Statement::next_ref().

Referenced by _iterate_to_fixed_point(), _put_succ_on_work_list(), and _remove_unreachable().

static void _put_succ_on_work_list IntSet work_list,
Statement stmt,
const Map< Symbol, IntElem > &  use_candidates
[static]
 

put_succ_on_work_list Put all of my successors on the work list.

Definition at line 1123 of file constant.cc.

References _const_if_succ(), _debug_level, _get_workspace(), PropConstWS::const_cond, Iterator< T >::current(), False, RefSet< T >::ins(), PropConstWS::succ, PropConstWS::toporder(), and Iterator< T >::valid().

Referenced by _iterate_to_fixed_point(), and _iterate_to_fixed_point_phase().

static void _iterate_to_fixed_point StmtList ,
const Statement ,
const Statement ,
const RefSet< Statement > &  entry_points,
const Array< Statement * > &  toporder_to_stmt,
const Map< Symbol, IntElem > &  use_candidates,
const Array< Symbol * > &  tag_to_candidate,
const Map< Symbol, Expression > &  entering_constants
[static]
 

iterate_to_fixed_point Propagate the constants contained in the statement's const_maps until a fixed point is reached.

... List of statements that need to be updated.

... Put all entries on the work list.

... Iterate until there are no more elements on the work list

... Visit each statement in the work list, in topological order

... Generate the new constant mapping entering the statement.

... New entering constant mapping differs from the old ... one. So update the entering and exiting constant ... mappings for the statement.

... Exiting constant map has changed, so place ... the statements successors on the work list so ... that they can update their constant mappings ... with my new constant mapping.

Definition at line 1158 of file constant.cc.

References _const_if_succ(), _const_if_took_then(), _debug_level, _get_workspace(), _kill_bad_join_consts(), _put_succ_on_work_list(), PropConstWS::add_consts(), PropConstWS::const_cond, Iterator< T >::current(), ENDIF_STMT, entry_points(), False, PropConstWS::in_const_map, PropConstWS::incr_num_visits(), RefDatabase< S, T >::ins(), ProtoRefDatabase< S, T >::member(), PropConstWS::num_visits(), PropConstWS::out_const_map, PropConstWS::pred, PropConstWS::pretty_print(), Statement::print_debug(), Statement::stmt_class(), PropConstWS::toporder(), True, PropConstWS::update_out_const_map(), and Iterator< T >::valid().

Referenced by _ipcp_compute_constants(), _propagate_constants1(), and eliminate_dead_code().

static Boolean _is_block_unreachable const StmtList stmts,
const Statement first_stmt,
const Statement last_stmt
[static]
 

is_block_unreachable Return True if the block fo code between the given pair of statements is unreachable code.

... Note: implied goto statements must be ignored because the ... insertion and deletion of the pseudo-ELSEs may leave visited ... implied gotos.

Definition at line 1265 of file constant.cc.

References _get_workspace(), Iterator< T >::current(), False, IMPLIED_GOTO_STMT, PropConstWS::num_visits(), Statement::stmt_class(), True, and Iterator< T >::valid().

Referenced by _remove_unreachable().

static void _remove_unreachable StmtList stmts,
const Statement first_stmt,
const Statement last_stmt,
const Map< Symbol, IntElem > &  use_candidates
[static]
 

remove_unreachable Remove any dead code in the program.

... Delete all IF statements where only one branch is taken.

... Replace the arithmetic if with a goto to its single ... successor.

... Currently, don't allow ELSEIF stmts to be deleted.

... Delete the IF part of an IF () THEN ... ELSEIF statement ... Currently, do nothing.

... Delete the IF statement only if none of the statements ... in the not-taken branch is reachable.

... Make sure that the ELSE or ELSEIF part of IF ... statement isn't deleted by marking it as reachable.

... Delete all unreachable code.

... Check for the case of an ENDDO statement being unreachable. ... In this case, if the associated DO is reachable, ... then DO will be deleted when the ENDDO is deleted, ... so we must place an assignment statement for the loop index, ... assigning the initial value of the index, ... plus the loop-entry test. ... If the associated DO is not reachable either, then don't ... insert the assignment or the IF at all (and the ... whole loop should vanish).

... Statement &newif =

... remove_trivial_gotos(pgm);

Definition at line 1289 of file constant.cc.

References _const_if_succ(), _debug_level, _get_workspace(), _is_block_unreachable(), ARITHMETIC_IF_STMT, Expression::clone(), PropConstWS::const_cond, Iterator< T >::current(), Iterator< T >::current_valid(), ELSEIF_STMT, ENDDO_STMT, ENDIF_STMT, RefSet< T >::entries(), False, FLOW_ENTRY_STMT, Statement::follow_ref(), ge(), IF_STMT, PropConstWS::incr_num_visits(), Statement::index(), Statement::init(), RefSet< T >::ins(), Statement::limit(), Statement::matching_endif_ref(), RefSet< T >::member(), Statement::next_ref(), PropConstWS::num_visits(), Statement::prev_ref(), Statement::print_debug(), WorkSpaceStack::push(), Iterator< T >::reset(), Statement::stmt_class(), True, RefSet< T >::valid(), Iterator< T >::valid(), and Statement::work_stack().

Referenced by _ipcp_propagate_constants(), and _propagate_constants1().

static void _propagate_constants1 StmtList stmts,
const Statement first_stmt,
const Statement last_stmt,
Map< Symbol, IntElem > &  def_candidates,
Map< Symbol, IntElem > &  use_candidates,
Array< Symbol * > &  tag_to_candidate,
RefSet< Statement > &  pseudo_stmts,
PC_UNREACH_BOOL  remove_unreachable,
int  debug
[static]
 

propagate_constants1 - Main routine of propagate_constants.

Perform forward substitution of scalar variables throughout given statement block.

... Set of entry points into the given block of statements.

... An array that maps integers to statements.

... Initialize ... clear_substituted_var();

... Iteratively propagate the constants throughout the program until a ... fixed point is reached.

... Annotate all the expressions in the program with the calculated ... constant values

... Remove any deadcode from the program, if desired.

... Clean up

Definition at line 1427 of file constant.cc.

References _annotate_stmts(), _calc_toporder(), _debug_level, _determine_entry_points(), _dump_workspaces(), _init_workspaces(), _iterate_to_fixed_point(), _make_nonlocals_modified_at_calls(), _num_stmts_in_block(), _pass_tag, _patch_flow_graph(), _remove_unreachable(), create_pass_tag(), Iterator< T >::current(), entry_points(), WorkSpaceStack::pop(), REMOVE_UNREACH_CODE, Timer::reset(), Iterator< T >::valid(), and Statement::work_stack().

Referenced by _propagate_constants_all_vars(), and _propagate_constants_some_vars().

static void _propagate_constants_all_vars StmtList stmts,
const Statement first_stmt,
const Statement last_stmt,
RefSet< Statement > &  pseudo_stmts,
PC_REAL_BOOL  subst_reals,
PC_ARRAY_BOOL  subst_arrays,
PC_UNREACH_BOOL  remove_unreachable,
int  debug
[static]
 

propagate_constants_all_vars Perform constant propagation for all variables in the given statement block.

... Set of all variables that are candidates for forward substitution

... Set of all variables that may be in the constant symbolic values ... for a variable in def_candidates.

... An array that maps integers to variable candidates.

Definition at line 1523 of file constant.cc.

References _add_control_assigns(), _collect_candidates(), _propagate_constants1(), and REMOVE_UNREACH_CODE.

Referenced by propagate_constants().

static void _propagate_constants_some_vars StmtList stmts,
const Statement first_stmt,
const Statement last_stmt,
const RefSet< Symbol > &  candidates,
RefSet< Statement > &  pseudo_stmts,
PC_UNREACH_BOOL  remove_unreachable,
int  debug
[static]
 

propagate_constants_all_vars Perform constant propagation for only the variables in candidates for the given statement block.

... Set of all variables that are candidates for forward substitution

... Set of all variables that may be in the constant symbolic values ... for a variable in def_candidates.

... An array that maps integers to variable candidates.

Definition at line 1559 of file constant.cc.

References _add_control_assigns(), _collect_candidates(), _propagate_constants1(), and REMOVE_UNREACH_CODE.

Referenced by propagate_constants().

void propagate_constants StmtList stmts,
const Statement first_stmt,
const Statement last_stmt,
PC_REAL_BOOL  subst_reals,
PC_ARRAY_BOOL  subst_arrays,
PC_UNREACH_BOOL  remove_unreachable,
int debug   GIV(0)
 

propagate_constants - Perform forward substitution of scalar variables throughout pgm.

Definition at line 1593 of file constant.cc.

References _propagate_constants_all_vars().

Referenced by cleanup_program(), main(), propagate_constants_pu(), and propagate_outermost_DOs().

void propagate_constants ProgramUnit pgm,
PC_REAL_BOOL  subst_reals,
PC_ARRAY_BOOL  subst_arrays,
PC_UNREACH_BOOL  remove_unreachable,
int debug   GIV(0)
 

Definition at line 1608 of file constant.cc.

References _add_data_assigns(), _propagate_constants_all_vars(), List< T >::first_ref(), List< T >::last_ref(), remove_trivial_gotos(), and REMOVE_UNREACH_CODE.

void propagate_constants StmtList stmts,
const Statement first_stmt,
const Statement last_stmt,
const RefSet< Symbol > &  candidates,
PC_UNREACH_BOOL  remove_unreachable,
int debug   GIV(0)
 

Definition at line 1633 of file constant.cc.

References _propagate_constants_some_vars().

void propagate_constants ProgramUnit pgm,
const RefSet< Symbol > &  candidates,
PC_UNREACH_BOOL  remove_unreachable,
int debug   GIV(0)
 

Definition at line 1646 of file constant.cc.

References _add_data_assigns(), _propagate_constants_some_vars(), List< T >::first_ref(), List< T >::last_ref(), remove_trivial_gotos(), REMOVE_UNREACH_CODE, and SUBST_REALS.

int propagate_constants_pu char **  data,
int *  len
 

Description: Used by InterProcConstProp to compute the side effects of a single program unit.

Not for external use. If ingested, induce vomiting.

Definition at line 1672 of file constant.cc.

References external_interface_init(), external_program_unit(), propagate_constants(), ProgramUnit::pu_tag_ref(), setup_to_return_handle(), and switch_value().

static void _init_ipcp_workspaces StmtList stmts,
const IPCPProcData proc_data,
const Map< Symbol, IntElem > &  def_candidates,
const Map< Symbol, IntElem > &  use_candidates,
const Array< Symbol * > &  tag_to_candidate
[static]
 

init_ipcp_workspaces Initialize the workspaces for each statement in the program.

Note: A lot of the initialization for propagate_constants are hidden in the constructor for PropConstWS.

Definition at line 1695 of file constant.cc.

References _pass_tag, Iterator< T >::current(), IPCPCallData::data_ref(), False, LABEL_STMT, WorkSpaceStack::push(), Statement::stmt_class(), True, Iterator< T >::valid(), and Statement::work_stack().

Referenced by _ipcp_compute_constants().

static RefSet<Symbol>* _build_modified_vars const StmtList stmts,
const RefSet< Statement > &  ignorable_stmts,
const Array< Symbol * > &  tag_to_candidate
[static]
 

_build_modified_vars.

Build and return the set of variables modified by the program, ignoring the side-effect of the given statements.

Definition at line 1739 of file constant.cc.

References _get_workspace(), Iterator< T >::current(), IntSet::first(), RefSet< T >::ins(), PropConstWS::mod_set, modified_vars(), IntSet::next(), PropConstWS::num_visits(), and Iterator< T >::valid().

Referenced by _ipcp_build_jump_functions().

static void _alias_consts RefSet< Symbol > &  alias_consts,
RefMap< Symbol, Symbol > &  alias_const_map,
const RefList< Symbol > &  formals,
const List< Expression > &  actuals,
const RefSet< Symbol > &  keepable_vars
[static]
 

alias_consts Compute the set of actual parameters that are aliased to formal parameters, where it is safe to replace the actual parameters with the formal parameters.

Definition at line 1770 of file constant.cc.

References Iterator< T >::current(), ID_OP, Symbol::is_array(), Expression::op(), Expression::symbol(), Symbol::type(), and Iterator< T >::valid().

Referenced by _create_new_actual_consts().

static void _rename_alias_consts Expression expr,
const RefMap< Symbol, Symbol > &  alias_const_map
[static]
 

rename_alias_consts Rename all variables in the given mapping to their mapped values.

Definition at line 1804 of file constant.cc.

References Iterator< T >::current(), ID_OP, and Iterator< T >::valid().

Referenced by _create_new_actual_consts().

static Expression* _remove_local_effects_from_expr1 Expression expr,
const PropConstMap const_map,
const Map< Symbol, IntElem > &  candidates
[static]
 

_remove_local_effects_from_expr Given an expression and a constant map, eliminate all locally modified variables form the expression, so that the final expression would be in terms of the initial values of the subroutine.

Definition at line 1828 of file constant.cc.

References _get_workspace(), Expression::arg_list(), Mutator< T >::assign(), Expression::base_variable_ref(), Expression::clone(), CONST, IntSet::del(), ENTRY_STMT, PropConstElem::expr(), FLOW_ENTRY_STMT, ID_OP, PropConstWS::in_const_map, IntSet::ins(), PropConstElem::last_mod(), paren(), PropConstWS::poisoned_vars, Mutator< T >::pull(), PropConstElem::state(), Statement::stmt_class(), Iterator< T >::valid(), IntElem::value(), and VARIABLE_CLASS.

Referenced by _remove_local_effects_from_expr().

static Expression* _remove_local_effects_from_expr Expression expr,
const PropConstMap const_map,
const Map< Symbol, IntElem > &  candidates
[static]
 

Definition at line 1897 of file constant.cc.

References _remove_local_effects_from_expr1(), and omega().

Referenced by _create_old_const_mods().

static Map<Symbol, Expression>* _create_old_const_mods const Map< Symbol, IntElem > &  candidates,
const PropConstMap const_map,
const RefSet< Symbol > &  keepable_vars,
const RefSet< Symbol > *  modified_vars_ref
[static]
 

_create_old_const_mods Create a mapping from old constants to new constants.

Definition at line 1915 of file constant.cc.

References _remove_local_effects_from_expr(), KeyIterator< S, T >::current_key(), ID_OP, Map< S, T >::ins(), OMEGA_OP, Expression::op(), Expression::symbol(), and KeyIterator< S, T >::valid().

Referenced by _build_call_jump_functions(), and _ipcp_build_jump_functions().

static Expression* _subst_unkeepable_vars Expression expr,
const RefSet< Symbol > &  keepable_vars
[static]
 

subst_unkeepable_vars Substitute all unkeepable variables.

Definition at line 1950 of file constant.cc.

References Expression::arg_list(), Mutator< T >::assign(), Expression::base_variable_ref(), ID_OP, paren(), Mutator< T >::pull(), Iterator< T >::valid(), and VARIABLE_CLASS.

Referenced by _create_new_actual_consts(), and _create_new_consts().

static Map<Symbol, Expression>* _create_new_consts const Map< Symbol, IntElem > &  candidates,
const PropConstMap const_map,
const RefSet< Symbol > &  keepable_vars
[static]
 

_create_new_consts Create a set of newly generated symbolic constants.

Definition at line 1997 of file constant.cc.

References _annotate_expr(), _subst_unkeepable_vars(), KeyIterator< S, T >::current_key(), Expression::grab_substituted(), Map< S, T >::ins(), and KeyIterator< S, T >::valid().

Referenced by _build_call_jump_functions(), and _ipcp_build_jump_functions().

static const List<Expression>& _call_arg_list const Statement call_site  )  [static]
 

call_arg_list Return a reference to the argument list of the given call site.

Definition at line 2026 of file constant.cc.

References ASSIGNMENT_STMT, CALL_STMT, and FUNCTION_CALL_OP.

Referenced by _create_new_actual_consts(), IPCPProcData::add_constant_set(), IPCPProcData::local_new_consts(), and IPCPProcData::local_old_const_mods().

static Boolean _contains_non_candidate_vars const Expression expr,
const Map< Symbol, IntElem > &  candidates
[static]
 

contains_non_candidate_vars Return true if the expression contains a variable not in cadidates.

Definition at line 2047 of file constant.cc.

References Iterator< T >::current(), False, ID_OP, True, Iterator< T >::valid(), and VARIABLE_CLASS.

Referenced by _create_new_actual_consts().

static List<Expression>* _create_new_actual_consts const Map< Symbol, IntElem > &  candidates,
const Statement stmt,
const IPCPProcData ,
const IPCPProcData call_proc_data,
const RefSet< Symbol > &  keepable_vars
[static]
 

create_new_actual_consts Build a set of new actual expressions.

... Compute the set of variable that are allowable in the actual ... expressions.

... Compute the list of constant actuals.

Definition at line 2070 of file constant.cc.

References _alias_consts(), _annotate_expr(), _call_arg_list(), _contains_non_candidate_vars(), _get_workspace(), _rename_alias_consts(), _subst_unkeepable_vars(), Expression::base_variable_ref(), Expression::clone(), Iterator< T >::current(), List< T >::entries(), RefList< T >::entries(), PropConstWS::in_const_map, RefSet< T >::ins(), List< T >::ins_last(), omega(), and Iterator< T >::valid().

Referenced by _build_call_jump_functions().

static void _build_call_jump_functions ProgramUnit pgm,
IPCPProcData proc_data,
const Map< Symbol, IntElem > &  candidates,
const RefSet< Symbol > *  modified_vars_ref
[static]
 

build_call_jump_function Build a jump function for each call site.

Definition at line 2140 of file constant.cc.

References _create_new_actual_consts(), _create_new_consts(), _create_old_const_mods(), _get_workspace(), ASSIGNMENT_STMT, CALL_STMT, Iterator< T >::current(), IPCPCallData::data_ref(), FUNCTION_CALL_OP, PropConstWS::in_const_map, RefSet< T >::ins(), IPCPProcData::local_vars(), PropConstWS::num_visits(), Expression::op(), Statement::rhs(), Statement::stmt_class(), Expression::symbol(), IPCPProcData::usable_global_vars(), and Iterator< T >::valid().

Referenced by _ipcp_build_jump_functions().

static void _ipcp_compute_constants ProgramUnit pgm,
IPCPProcData proc_data,
const Map< Symbol, IntElem > &  def_candidates,
const Map< Symbol, IntElem > &  use_candidates,
Array< Symbol * > &  tag_to_candidate,
const Map< Symbol, Expression > &  entering_constants
[static]
 

ipcp_compute_constants Compute the constants for single procedure for interprocedural constant propagation.

... Set of entry points into the given block of statements.

... An array that maps integers to statements.

... Iteratively propagate the constants throughout the program until a ... fixed point is reached.

Definition at line 2192 of file constant.cc.

References _calc_toporder(), _debug_level, _determine_entry_points(), _dump_workspaces(), _init_ipcp_workspaces(), _iterate_to_fixed_point(), _make_nonlocals_modified_at_calls(), _pass_tag, _patch_flow_graph(), create_pass_tag(), entry_points(), List< T >::first_ref(), List< T >::last_ref(), and Timer::reset().

Referenced by _ipcp_build_jump_functions(), and _ipcp_propagate_constants().

void _ipcp_build_jump_functions ProgramUnit pgm,
IPCPProcData proc_data,
const RefSet< Symbol > &  def_vars,
const RefSet< Symbol > &  use_vars,
const Map< Symbol, Expression > &  entering_constants,
int debug   GIV(0)
 

ipcp_build_jump_functions Build the jump functions for the given proc_data object.

... Set of all variables that are candidates for forward substitution

... Set of all variables that may be in the constant symbolic values ... for a variable in def_candidates.

... An array that maps integers to variable candidates.

... Set of pseudo statements inserted to represent constants from control ... flow.

... Initialize

... Compute my constants.

... If some pseudo-statements were added to the program, compute the ... set of variables modified by the program, ignoring pseudo-statements ... and unreachable statements.

... Build the jump functions.

... Clean up

Definition at line 2245 of file constant.cc.

References _add_control_assigns(), _build_call_jump_functions(), _build_modified_vars(), _create_new_consts(), _create_old_const_mods(), _debug_level, _get_workspace(), _init_candidates(), _ipcp_compute_constants(), _num_stmts_in_block(), _pass_tag, Iterator< T >::current(), BaseMapRoot::entries(), RefSet< T >::entries(), List< T >::first_ref(), FLOW_EXIT_STMT, PropConstWS::in_const_map, StmtList::iterator(), List< T >::last_ref(), modified_vars(), WorkSpaceStack::pop(), Timer::reset(), Iterator< T >::valid(), and Statement::work_stack().

void _ipcp_propagate_constants ProgramUnit pgm,
IPCPProcData proc_data,
const RefSet< Symbol > &  def_vars,
const RefSet< Symbol > &  use_vars,
PC_UNREACH_BOOL  remove_unreachable,
const Map< Symbol, Expression > &  entering_constants,
int debug   GIV(0)
 

ipcp_propagate_constants Propagate constants within a single procedure for interprocedural constant propagation.

... Set of all variables that are candidates for forward substitution

... Set of all variables that may be in the constant symbolic values ... for a variable in def_candidates.

... An array that maps integers to variable candidates.

... Set of pseudo statements inserted to represent constants from control ... flow.

... Initialize

... Compute my constants.

... Annotate all the expressions in the program with the calculated ... constant values

... Remove any deadcode from the program, if desired.

... Clean up

Definition at line 2347 of file constant.cc.

References _add_control_assigns(), _annotate_stmts(), _debug_level, _init_candidates(), _ipcp_compute_constants(), _num_stmts_in_block(), _pass_tag, _remove_unreachable(), Iterator< T >::current(), BaseMapRoot::entries(), List< T >::first_ref(), StmtList::iterator(), List< T >::last_ref(), WorkSpaceStack::pop(), REMOVE_UNREACH_CODE, Timer::reset(), Iterator< T >::valid(), and Statement::work_stack().

static void _assert_clear_substituted Statement stmt  )  [static]
 

_assert_clear_substituted Remove all constant subexpression annotations from all expressions in all assertions of the given statement.

Definition at line 2429 of file constant.cc.

References Assertion::arg_list_guarded(), Assertion::arg_list_valid(), clear_substituted(), Iterator< T >::current(), and Iterator< T >::valid().

Referenced by clear_substituted().

void clear_substituted ProgramUnit pgm  ) 
 

Description: See previous function.

This object may be a ProgramUnit, a Statement or an Expression. Ain't polymorphism grand.

Definition at line 2451 of file constant.cc.

Referenced by _annotate_expr(), _assert_clear_substituted(), cleanup_program(), clear_substituted(), clear_substituted_pu(), and main().

void clear_substituted StmtList stmts,
const Statement first_stmt,
const Statement last_stmt
 

Description: See previous function.

Definition at line 2459 of file constant.cc.

void clear_substituted Statement stmt  ) 
 

Description: See previous function.

Definition at line 2469 of file constant.cc.

void clear_substituted Expression expr  ) 
 

Description: Interface to clear_substituted(pgm) from SETL.

Definition at line 2480 of file constant.cc.

References clear_substituted(), Iterator< T >::current(), ID_OP, and Iterator< T >::valid().

int clear_substituted_pu char **  data,
int *  len
 

Description: Replace some variables with their precomputed constant expressions for all expressions in the given object.

This function also takes two optional filter functions to determine whether a certain variable is to be substituted.

If non-NULL, the expr_filter() function tests each subexpression of the expression whose variables are to be substituted with constant values. If it returns False for a given subexpression, no variable substitutions will be performed upon that subexpression.

If non-NULL, the const_filter() function tests the constant value associated with each variable. If it returns False for the constant value of a a certain variable, then that constant value will not be substituted for any occurrence of that variable.

Definition at line 2494 of file constant.cc.

References clear_substituted(), external_interface_init(), external_program_unit(), ProgramUnit::pu_tag_ref(), and setup_to_return_handle().

Boolean substituted_var  ) 
 

Description: Reset the substituted_var flag to False.

Definition at line 2512 of file constant.cc.

References _substituted_var.

void clear_substituted_var  ) 
 

Description: Substitute all precomputed values for PARAMETER constants.

If subst_reals == SUBST_REALS, substitute integer, logical, real, double-precision, and complex parameters. Otherwise, only propagate integer and logical parameters.

Definition at line 2522 of file constant.cc.

References _substituted_var, and False.

static void _assert_expand_substituted Statement stmt,
Boolean(*)(const Expression &)  expr_filter,
Boolean(*)(const Expression &)  const_filter
[static]
 

Do this for all assertions except INDUCTION, FIRSTVALUE, RANGEWRITTEN assertions.

... Don't expand in INDUCTION assertions

Definition at line 2535 of file constant.cc.

References Assertion::arg_list_guarded(), Assertion::arg_list_valid(), AS_FIRSTVALUE, AS_INDUCTION, AS_RANGEWRITTEN, Mutator< T >::assign(), Iterator< T >::current(), expr_expand_substituted(), Mutator< T >::pull(), Assertion::type(), and Iterator< T >::valid().

Referenced by expand_substituted().

static void _call_args_expand_substituted Expression comma_expr,
Boolean(*)(const Expression &)  expr_filter,
Boolean(*)(const Expression &)  const_filter
[static]
 

call_args_expand_substituted Expand all constants in the given list of expressions, except for those constants at the top level.

This function is used to make sure that potentially aliased subroutine or function arguments are not removed by constant propagation.

Definition at line 2570 of file constant.cc.

References Expression::arg_list(), Mutator< T >::assign(), COMMA_OP, Iterator< T >::current(), expr_expand_substituted(), ID_OP, Expression::op(), Mutator< T >::pull(), Expression::substituted(), and Iterator< T >::valid().

Referenced by expand_substituted(), and expr_expand_substituted().

void expand_substituted ProgramUnit pgm,
Boolean(*)(const Expression &) GIV expr_filter(0)  ,
Boolean(*)(const Expression &) GIV const_filter(0) 
 

expand_substituted Replace some variables with their precomputed constant expressions for all expressions in the given object.

This method requires two filter functions to determine whether a certain variable is to be substituted. The first filter function tests a subexpression of the current expression whose variables are being substituted. If it returns false, none of the variables inside this subexpression will substituted. The second function tests the constant expression associated with a variable to be substituted. If this function returns false, the variable is not substituted with that expression.

Definition at line 2602 of file constant.cc.

Referenced by IPCPProcData::expand_all_substituted(), expand_linear_substituted(), expand_small_substituted(), expand_substituted(), expand_substituted_pu(), and main().

void expand_substituted StmtList stmts,
const Statement first_stmt,
const Statement last_stmt,
Boolean(*)(const Expression &) GIV expr_filter(0)  ,
Boolean(*)(const Expression &) GIV const_filter(0) 
 

Definition at line 2612 of file constant.cc.

References Iterator< T >::current(), expand_substituted(), Expression::iterator(), and Iterator< T >::valid().

void expand_substituted Statement stmt,
Boolean(*)(const Expression &) GIV expr_filter(0)  ,
Boolean(*)(const Expression &) GIV const_filter(0) 
 

Definition at line 2624 of file constant.cc.

References _assert_expand_substituted(), _call_args_expand_substituted(), _stmt_substituted_var, Mutator< T >::assign(), CALL_STMT, expr_expand_substituted(), False, Mutator< T >::pull(), simplify(), and Iterator< T >::valid().

int expand_substituted_pu char **  data,
int *  len
 

Description: Acts similarly to the function expand_substituted() except that it applies to only a single expression.

This function takes an expression and returns the expanded result. Ownership of the given expression is passed to this routine.

Definition at line 2655 of file constant.cc.

References expand_substituted(), external_interface_init(), external_program_unit(), ProgramUnit::pu_tag_ref(), and setup_to_return_handle().

static Boolean _is_constant_expr const Expression expr  )  [static]
 

is_constant_expr Return True if the given expression would simplify down to an integer constant or logical constant.

Definition at line 2674 of file constant.cc.

References Iterator< T >::current(), False, INTEGER_CONSTANT_OP, INTRINSIC_CALL_OP, LOGICAL_CONSTANT_OP, True, and Iterator< T >::valid().

Referenced by expr_expand_substituted().

Expression* expr_expand_substituted Expression expr,
Boolean(*)(const Expression &) GIV expr_filter(0)  ,
Boolean(*)(const Expression &) GIV const_filter(0) 
 

expr_expand_substituted Acts similarly to the method expand_substituted() except that it applies to only a single expression.

This method modifies the given expression and returns the result.

Definition at line 2699 of file constant.cc.

References _call_args_expand_substituted(), _is_constant_expr(), _stmt_substituted_var, _substituted_var, Mutator< T >::assign(), FUNCTION_CALL_OP, Expression::grab_substituted(), ID_OP, Mutator< T >::pull(), simplify(), Expression::substituted(), True, and Iterator< T >::valid().

Referenced by _assert_expand_substituted(), _call_args_expand_substituted(), RangeComparator::compare(), expand_substituted(), expr_expand_linear_substituted(), expr_expand_small_substituted(), extract_ranges(), intersect_ranges(), and union_ranges().

static Boolean _is_expr_top_linear const Expression expr  )  [inline, static]
 

expand_linear_substituted Expand the variables whose constant expressions are linear for all expressions in the object.

An expression is considered linear if it is made up of only additive and multiplicative operators.

... Let the leaf expressions be linear

... Let the logical operations be linear

Definition at line 2756 of file constant.cc.

References ADD_OP, AND_OP, ARRAY_REF_OP, COMMA_OP, COMPLEX_OP, EQ_OP, EQV_OP, False, GE_OP, GT_OP, HOLLERITH_CONSTANT_OP, ID_OP, INTEGER_CONSTANT_OP, LE_OP, LOGICAL_CONSTANT_OP, LT_OP, MULT_OP, NE_OP, NEQV_OP, NOT_OP, OMEGA_OP, OR_OP, PAREN_OP, REAL_CONSTANT_OP, SUB_OP, True, U_MINUS_OP, and U_PLUS_OP.

Referenced by _linear_const_filter(), expand_linear_substituted(), and expr_expand_linear_substituted().

static Boolean _linear_const_filter const Expression expr  )  [static]
 

Definition at line 2797 of file constant.cc.

References _is_expr_top_linear(), Iterator< T >::current(), False, True, and Iterator< T >::valid().

Referenced by expand_linear_substituted(), and expr_expand_linear_substituted().

void expand_linear_substituted ProgramUnit pgm  ) 
 

Description: See previous function.

Definition at line 2813 of file constant.cc.

void expand_linear_substituted StmtList stmts,
const Statement first_stmt,
const Statement last_stmt
 

Description: See previous function.

Definition at line 2819 of file constant.cc.

void expand_linear_substituted Statement stmt  ) 
 

Description: See previous function.

Definition at line 2827 of file constant.cc.

References _is_expr_top_linear(), _linear_const_filter(), and expand_substituted().

Expression* expr_expand_linear_substituted Expression expr  ) 
 

Description: Expand the variables whose constant expressions are either an ID expression or an expression that can be simplified to an integer or logical constant.

Definition at line 2833 of file constant.cc.

References _is_expr_top_linear(), _linear_const_filter(), and expr_expand_substituted().

static Boolean _is_constant_expr_filter const Expression expr  )  [static]
 

expand_small_substituted Expand the variables whose constant expressions are ID expressions or integer or logical constant expressions.

Definition at line 2845 of file constant.cc.

References Iterator< T >::current(), False, ID_OP, INTEGER_CONSTANT_OP, INTRINSIC_CALL_OP, LOGICAL_CONSTANT_OP, True, and Iterator< T >::valid().

Referenced by _small_const_filter().

static Boolean _small_const_filter const Expression expr  )  [static]
 

Definition at line 2867 of file constant.cc.

References _is_constant_expr_filter(), and ID_OP.

Referenced by expand_small_substituted(), and expr_expand_small_substituted().

void expand_small_substituted ProgramUnit pgm  ) 
 

Description: See previous function.

Definition at line 2873 of file constant.cc.

Referenced by cleanup_program(), and main().

void expand_small_substituted StmtList stmts,
const Statement first_stmt,
const Statement last_stmt
 

Description: See previous function.

Definition at line 2879 of file constant.cc.

void expand_small_substituted Statement stmt  ) 
 

Description: See previous function.

Definition at line 2886 of file constant.cc.

References _small_const_filter(), and expand_substituted().

Expression* expr_expand_small_substituted Expression expr  ) 
 

Description: Return True if any calls to the expand_substituted routines substitutes a variable in an expression.

Calls to propagate_constants() will reset this flag.

Definition at line 2892 of file constant.cc.

References _small_const_filter(), and expr_expand_substituted().

static Boolean _has_param_in_expr const Expression expr  )  [static]
 

has_param_in_expr Return true if the given expression has a parameter variable contained within it.

Definition at line 2903 of file constant.cc.

References Iterator< T >::current(), False, ID_OP, SYMBOLIC_CONSTANT_CLASS, True, and Iterator< T >::valid().

Referenced by substitute_parameters().

static void _assert_substitute_parameters Statement stmt,
PC_REAL_BOOL  subst_reals
[static]
 

_assert_substitute_parameters Substitute all precomputed values for PARAMETER constants in all assertions of the given statement.

Definition at line 2925 of file constant.cc.

References Assertion::arg_list_guarded(), Assertion::arg_list_valid(), Mutator< T >::assign(), Iterator< T >::current(), expr_substitute_parameters(), Mutator< T >::pull(), and Iterator< T >::valid().

Referenced by substitute_parameters().

static void substitute_parameters_data ProgramUnit pgm,
PC_REAL_BOOL  subst_reals
[static]
 

Definition at line 2943 of file constant.cc.

References CommaExpr::clone(), Iterator< T >::current(), expr_substitute_parameters(), Iterator< T >::valid(), and Data::value_list().

Referenced by substitute_parameters().

void substitute_parameters ProgramUnit pgm,
PC_REAL_BOOL  subst_reals
 

Description: See previous function.

... silvius: must substitute them in DATA expressions.

Definition at line 2957 of file constant.cc.

Referenced by InlineObject::inline_expand(), main(), InlineObject::prepare_routines_for_arg_mapping(), substitute_parameters(), and substitute_parameters_pu().

void substitute_parameters Symtab symtab,
PC_REAL_BOOL  subst_reals
 

Description: See previous function.

... Substitute all parameters contained inside other parameters and ... simplify them down.

... Substitute all parameters found in the bounds of arrays.

Definition at line 2970 of file constant.cc.

void substitute_parameters StmtList stmts,
const Statement first_stmt,
const Statement last_stmt,
PC_REAL_BOOL  subst_reals
 

Description: See previous function.

Definition at line 3024 of file constant.cc.

void substitute_parameters Statement stmt,
PC_REAL_BOOL  subst_reals
 

Description: Interface to substutute_parameters(pgm) from SETL.

Definition at line 3034 of file constant.cc.

References _assert_substitute_parameters(), _stmt_substituted_var, Mutator< T >::assign(), expr_substitute_parameters(), False, Mutator< T >::pull(), and Iterator< T >::valid().

Expression* expr_substitute_parameters Expression expr,
PC_REAL_BOOL  subst_reals
 

expr_substitute_parameters Acts similarly to the method substitute_parameters() except that it applies to only a single expression.

This method modifies the given expression and returns the result.

Definition at line 3056 of file constant.cc.

References _stmt_substituted_var, _substitutable_type(), Mutator< T >::assign(), Expression::clone(), Symbol::expr_ref(), expr_substitute_parameters(), ID_OP, Mutator< T >::pull(), Expression::symbol(), SYMBOLIC_CONSTANT_CLASS, True, and Iterator< T >::valid().

Referenced by _assert_substitute_parameters(), expr_substitute_parameters(), substitute_parameters(), and substitute_parameters_data().

int substitute_parameters_pu char **  data,
int *  len
 

Description: Acts similarly to the function substitute_parameters() except that it applies to only a single expression.

This method takes an expression and returns the expanded result. Ownership of the given expression is passed to this routine.

Definition at line 3089 of file constant.cc.

References external_interface_init(), external_program_unit(), ProgramUnit::pu_tag_ref(), setup_to_return_handle(), substitute_parameters(), and switch_value().


Variable Documentation

unsigned int _pass_tag [static]
 

Definition at line 33 of file constant.cc.

Referenced by _get_workspace(), _init_ipcp_workspaces(), _init_workspaces(), _ipcp_build_jump_functions(), _ipcp_compute_constants(), _ipcp_propagate_constants(), _patch_flow_graph(), and _propagate_constants1().

int _debug_level = 0 [static]
 

... Pass tag associated with this pass

Definition at line 35 of file constant.cc.

Referenced by _annotate_stmt(), _ipcp_build_jump_functions(), _ipcp_compute_constants(), _ipcp_propagate_constants(), _iterate_to_fixed_point(), _propagate_constants1(), _put_succ_on_work_list(), and _remove_unreachable().

Boolean _substituted_var = False [static]
 

Definition at line 38 of file constant.cc.

Referenced by clear_substituted_var(), expr_expand_substituted(), and substituted_var().

Boolean _stmt_substituted_var = False [static]
 

...

True if expand_substituted substituted ... a variable.

Definition at line 41 of file constant.cc.

Referenced by expand_substituted(), expr_expand_substituted(), expr_substitute_parameters(), and substitute_parameters().

 © 1995-2005 University of Illinois, Urbana-Champaign. All rights reserved.  Fri Mar 25 23:06:18 2005