Polaris: JumpFunction.cc File Reference

JumpFunction.cc File Reference

Go to the source code of this file.

Functions

static void _simplify_var_mods (Map< Symbol, Expression > &var_mods)
 simplify_var_mods Simplify the given mapping of variable modifications.
static Boolean _are_vars_in_expr (const Expression &e, const RefSet< Symbol > &vars)
 _are_vars_in_expr Return true if the given expression uses any of the variables in the given set.
static Expression_subst_vars_in_expr1 (Expression *expr, RefSet< Symbol > &subst_vars, const Map< Symbol, Expression > &subst_map)
 subst_vars_in_expr Substitute all variables in the given expression and in the substitution mapping with their mapped values.
Expressionsubst_vars_in_expr (Expression *expr, const Map< Symbol, Expression > &subst_map)
 Description: Substitute the given variables in the expressions of the given map.
void subst_vars_in_map (Map< Symbol, Expression > &var_mods, const Map< Symbol, Expression > &subst_map)
 subst_vars_in_map Substitute the given variables in the expressions of the given map.
RefSet< Symbol > * modified_vars (const Map< Symbol, Expression > &var_mods)
 Description: Substitute all variables in the given expression and in the substitution mapping with their mapped values.
static void _filter_out_mod_params (Map< Symbol, Expression > &param_map, const Map< Symbol, Expression > &var_mods)
 filter_out_mod_params Replace all modified parameters with omega, with the exception to parameters whose actual is a scalar or array reference.
static void _delete_non_consts (Map< Symbol, Expression > &var_mods)
 delete_non_consts Delete all non-constant variables from the given mapping.
void _print (ostream &o, const Map< Symbol, Expression > &var_mods)
 print
static void _add_map_to_map (Map< Symbol, Expression > &dest_map, Map< Symbol, Expression > *source_map)
 add_map_to_map Add all the values in the second map to the first map
static void _update_old_consts (Map< Symbol, Expression > &consts, Map< Symbol, Expression > *var_mods)
 update_old_consts Update the given set of constants to take the side-effects of the routine into account.


Detailed Description

Definition in file JumpFunction.cc.


Function Documentation

static void _simplify_var_mods Map< Symbol, Expression > &  var_mods  )  [static]
 

simplify_var_mods Simplify the given mapping of variable modifications.

Definition at line 24 of file JumpFunction.cc.

References Expression::base_variable_ref(), Iterator< T >::current(), ID_OP, modified_vars(), Expression::op(), paren(), simplify(), Expression::symbol(), and Iterator< T >::valid().

Referenced by ReturnJumpFunction::const_mods(), JumpFunction::constants(), ReturnJumpFunction::new_consts(), and ReturnJumpFunction::ReturnJumpFunction().

static Boolean _are_vars_in_expr const Expression e,
const RefSet< Symbol > &  vars
[static]
 

_are_vars_in_expr Return true if the given expression uses any of the variables in the given set.

Definition at line 89 of file JumpFunction.cc.

References Expression::arg_list(), Iterator< T >::current(), e, False, ID_OP, Expression::op(), DistributeExpr::symbol(), True, and Iterator< T >::valid().

Referenced by _are_vars_in_expr(), _delete_dead_code(), and PropCtrlRangeWS::update_out_ranges().

static Expression* _subst_vars_in_expr1 Expression expr,
RefSet< Symbol > &  subst_vars,
const Map< Symbol, Expression > &  subst_map
[static]
 

subst_vars_in_expr Substitute all variables in the given expression and in the substitution mapping with their mapped values.

Definition at line 110 of file JumpFunction.cc.

References Expression::arg_list(), Mutator< T >::assign(), Expression::clone(), Iterator< T >::current(), Mutator< T >::grab(), ID_OP, omega(), OMEGA_OP, Expression::op(), Mutator< T >::pull(), Expression::symbol(), and Iterator< T >::valid().

Referenced by subst_vars_in_expr().

Expression* subst_vars_in_expr Expression expr,
const Map< Symbol, Expression > &  subst_map
 

Description: Substitute the given variables in the expressions of the given map.

Definition at line 152 of file JumpFunction.cc.

References _subst_vars_in_expr1().

Referenced by subst_vars_in_map().

void subst_vars_in_map Map< Symbol, Expression > &  var_mods,
const Map< Symbol, Expression > &  subst_map
 

subst_vars_in_map Substitute the given variables in the expressions of the given map.

Definition at line 164 of file JumpFunction.cc.

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

Referenced by _update_old_consts(), ReturnJumpFunction::const_mods(), IPCPConstants::IPCPConstants(), and ReturnJumpFunction::new_consts().

RefSet<Symbol>* modified_vars const Map< Symbol, Expression > &  var_mods  ) 
 

Description: Substitute all variables in the given expression and in the substitution mapping with their mapped values.

Definition at line 210 of file JumpFunction.cc.

References KeyIterator< S, T >::current_key(), RefSet< T >::ins(), modified_vars(), and KeyIterator< S, T >::valid().

Referenced by _add_map_to_map(), _build_modified_vars(), _delete_non_consts(), _filter_out_entering_consts(), _filter_out_mod_params(), _ipcp_build_jump_functions(), _simplify_var_mods(), IPCPProcData::create_jump_function(), IPCPConstants::filter_out_vars_not_in_set(), modified_vars(), and subst_vars_in_map().

static void _filter_out_mod_params Map< Symbol, Expression > &  param_map,
const Map< Symbol, Expression > &  var_mods
[static]
 

filter_out_mod_params Replace all modified parameters with omega, with the exception to parameters whose actual is a scalar or array reference.

This exception is allowed because aliasing of formal to actual would guarantee that the substitution of actual for formal would still be correct.

Definition at line 363 of file JumpFunction.cc.

References Iterator< T >::current(), Map< S, T >::ins(), modified_vars(), omega(), and Iterator< T >::valid().

Referenced by ReturnJumpFunction::new_consts().

static void _delete_non_consts Map< Symbol, Expression > &  var_mods  )  [static]
 

delete_non_consts Delete all non-constant variables from the given mapping.

Definition at line 384 of file JumpFunction.cc.

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

Referenced by _update_old_consts(), and ReturnJumpFunction::new_consts().

void _print ostream &  o,
const Map< Symbol, Expression > &  var_mods
 

print

Definition at line 442 of file JumpFunction.cc.

References KeyIterator< S, T >::current_data(), KeyIterator< S, T >::current_key(), Symbol::name_ref(), and KeyIterator< S, T >::valid().

static void _add_map_to_map Map< Symbol, Expression > &  dest_map,
Map< Symbol, Expression > *  source_map
[static]
 

add_map_to_map Add all the values in the second map to the first map

Definition at line 549 of file JumpFunction.cc.

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

Referenced by _update_old_consts(), and JumpFunction::constants().

static void _update_old_consts Map< Symbol, Expression > &  consts,
Map< Symbol, Expression > *  var_mods
[static]
 

update_old_consts Update the given set of constants to take the side-effects of the routine into account.

... Build a set of all modified constants.

... Add the updated consts to the constant set.

... Eliminate all modified variables from the set of constants.

... Filter out the OMs from the constant set.

Definition at line 570 of file JumpFunction.cc.

References _add_map_to_map(), _delete_non_consts(), Expression::clone(), KeyIterator< S, T >::current_key(), Map< S, T >::ins(), omega(), subst_vars_in_map(), and KeyIterator< S, T >::valid().

Referenced by JumpFunction::constants().

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