Polaris: SSAControlRangeDict Class Reference

SSAControlRangeDict Class Reference

file SSAControlRangeDict.h Collection of ranges extracted from SSA program's control flow More...

#include <SSAControlRangeDict.h>

Inheritance diagram for SSAControlRangeDict:

Inheritance graph
[legend]
List of all members.

Public Member Functions

 SSAControlRangeDict (SSAProgramUnit &pgm, int debug=0)
virtual ~SSAControlRangeDict ()
 Destructor.
void touch ()
 Force this object to compute the ranges for each statement in the program unit.
void icdom_touch ()
 Force each SSAControlRangeData object within myself to compute its immediate control dominator.
const Statementrepresentative_stmt (const Statement &stmt) const
 Return a statement that has the same control ranges as the given statement.
RefSet< Symbol > * range_vars (const Statement &stmt) const
 Return the set of variables that have constraints for the given statement.
void stats (float &avg_num_icdoms, int &max_num_icdoms, int &tot_num_icdoms, float &avg_num_ranges, int &max_num_ranges, int &tot_num_ranges)
 Compute statistics on the number of icdoms and the number of computed ranges for each statement.
int num_computed_ranges () const
 Return the number of ranges that this object has computed so far.
void clear ()
 Delete all saved information within myself for each of program's statements.
void clear_ranges ()
 Delete all saved ranges within myself.
virtual void print (ostream &o) const
 Print out the range dictionary.
virtual void pretty_print (ostream &o, const Statement &stmt) const
 Print out the range dictionary in a more user-readable manner.
virtual Listablelistable_clone (void) const
 listable_clone
virtual int structures_OK () const
 Methods required by Listable.

Protected Member Functions

virtual void _set_range (const Symbol &var, const Statement &stmt, Expression *range)
 Not implemented. Will p_assert if called.
virtual void _del_range (const Symbol &var, const Statement &stmt)
 Not implemented. Will p_assert if called.
virtual const Expression_get_range_ref (const Symbol &var, const Statement &stmt)
 Return the range associated with the given variable.

Detailed Description

file SSAControlRangeDict.h Collection of ranges extracted from SSA program's control flow

Polaris Range

See also:
SSAControlRangeDict.h

SSAControlRangeDict.h

SSAControlRangeDict.cc

Overview

An SSAControlRangeDict object is a repository for variable ranges for a program unit in SSA form. Only those ranges that originate from FORTRAN control flow statements are collected.

Description

An SSAControlRangeDict object is a repository of the variable ranges for all points of a program unit in SSA form. These ranges are extracted from the control flow statements of the program; that is, they are taken from IF conditional tests, DO statements, and CSRD$ ASSERT statements.

SSAControlRangeDict objects are demand-driven. That is, they compute the ranges for a particular statement only when they are asked for. If instead, the user wishes to have all the program unit's ranges to be computed at once, the user can call the touch() method.

The algorithm for computing the ranges of a program on demand using SSA form can be found in Blume and Eigenmann, "Demand- Driven Symbolic Range Propagation".

Definition at line 51 of file SSAControlRangeDict.h.


Constructor & Destructor Documentation

SSAControlRangeDict::SSAControlRangeDict SSAProgramUnit pgm,
int  debug = 0
 

SSAControlRangeDict::~SSAControlRangeDict  )  [virtual]
 

Destructor.

Definition at line 116 of file SSAControlRangeDict.cc.


Member Function Documentation

void SSAControlRangeDict::touch  ) 
 

Force this object to compute the ranges for each statement in the program unit.

... RefSet<Symbol> *vars = data.range_vars(); ... Iterator<Symbol> var_iter = *vars; ... ... for ( ; var_iter.valid(); ++var_iter) ... data.get_range_ref(var_iter.current());

... delete vars;

Definition at line 136 of file SSAControlRangeDict.cc.

References KeyIterator< S, T >::current_data(), KeyIterator< S, T >::current_key(), Type::data_type(), SSAControlRangeData::get_range_ref(), INTEGER_TYPE, Symbol::is_array(), representative_stmt(), Symbol::type(), and KeyIterator< S, T >::valid().

Referenced by SSAFullRangeDict::control_touch(), and stats().

void SSAControlRangeDict::icdom_touch  ) 
 

Force each SSAControlRangeData object within myself to compute its immediate control dominator.

Not meant for external use.

Definition at line 124 of file SSAControlRangeDict.cc.

References KeyIterator< S, T >::current_data(), SSAControlRangeData::icdom_ref(), and KeyIterator< S, T >::valid().

const Statement & SSAControlRangeDict::representative_stmt const Statement stmt  )  const
 

Return a statement that has the same control ranges as the given statement.

Definition at line 267 of file SSAControlRangeDict.cc.

References ProtoMap< S, T >::find_ref(), List< T >::first_ref(), SSAControlRangeData::icdom_succ_ref(), and ProgramUnit::stmts().

Referenced by SSAFullRangeDict::_get_range_ref(), stats(), SSAFullRangeDict::touch(), and touch().

RefSet< Symbol > * SSAControlRangeDict::range_vars const Statement stmt  )  const
 

Return the set of variables that have constraints for the given statement.

Definition at line 289 of file SSAControlRangeDict.cc.

References ProtoMap< S, T >::find_ref(), and SSAControlRangeData::range_vars().

Referenced by SSAFullRangeDict::touch().

void SSAControlRangeDict::stats float &  avg_num_icdoms,
int &  max_num_icdoms,
int &  tot_num_icdoms,
float &  avg_num_ranges,
int &  max_num_ranges,
int &  tot_num_ranges
 

Compute statistics on the number of icdoms and the number of computed ranges for each statement.

... Clear out all the ranges in my data object, ... but keep the icdoms intact.

Definition at line 170 of file SSAControlRangeDict.cc.

References ExprSet::clear(), SSAControlRangeData::clear_ranges(), clear_ranges(), KeyIterator< S, T >::current_data(), KeyIterator< S, T >::current_key(), Type::data_type(), SSAControlRangeData::get_range_ref(), SSAControlRangeData::icdom_ref(), INTEGER_TYPE, Symbol::is_array(), SSAControlRangeData::num_computed_ranges(), num_computed_ranges(), representative_stmt(), touch(), Symbol::type(), and KeyIterator< S, T >::valid().

int SSAControlRangeDict::num_computed_ranges  )  const
 

Return the number of ranges that this object has computed so far.

This number is the sum of the number of ranges in each range dictionary attached to an exiting control-flow edge.

Definition at line 252 of file SSAControlRangeDict.cc.

References KeyIterator< S, T >::current_data(), SSAControlRangeData::num_computed_ranges(), and KeyIterator< S, T >::valid().

Referenced by stats().

void SSAControlRangeDict::clear  ) 
 

Delete all saved information within myself for each of program's statements.

This would force myself to recompute any ranges asked for in the future.

Definition at line 338 of file SSAControlRangeDict.cc.

References ExprSet::clear(), SSAControlRangeData::clear(), KeyIterator< S, T >::current_data(), and KeyIterator< S, T >::valid().

Referenced by SSAFullRangeDict::clear().

void SSAControlRangeDict::clear_ranges  ) 
 

Delete all saved ranges within myself.

This would force myself to recompute any ranges asked for in the future.

Definition at line 352 of file SSAControlRangeDict.cc.

References ExprSet::clear(), SSAControlRangeData::clear_ranges(), KeyIterator< S, T >::current_data(), and KeyIterator< S, T >::valid().

Referenced by SSAFullRangeDict::clear_ranges(), and stats().

void SSAControlRangeDict::print ostream &  o  )  const [virtual]
 

Print out the range dictionary.

This operation is essentially just a dump of the data structures of the range dictionary.

Implements Listable.

Definition at line 366 of file SSAControlRangeDict.cc.

References KeyIterator< S, T >::current_data(), KeyIterator< S, T >::current_key(), Statement::print_debug(), Statement::tag(), and KeyIterator< S, T >::valid().

void SSAControlRangeDict::pretty_print ostream &  o,
const Statement stmt
const [virtual]
 

Print out the range dictionary in a more user-readable manner.

Implements RangeDict.

Definition at line 382 of file SSAControlRangeDict.cc.

References Iterator< T >::current(), ProtoMap< S, T >::find_ref(), SSAControlRangeData::get_range_ref(), RefList< T >::ins_last(), pretty_print_range(), SSAControlRangeData::range_vars(), sort_sym_list(), and Iterator< T >::valid().

Referenced by SSAFullRangeDict::pretty_print().

Listable * SSAControlRangeDict::listable_clone void   )  const [virtual]
 

listable_clone

Implements Listable.

Definition at line 422 of file SSAControlRangeDict.cc.

int SSAControlRangeDict::structures_OK  )  const [virtual]
 

Methods required by Listable.

Definition at line 433 of file SSAControlRangeDict.cc.

References BaseMapRoot::structures_OK().

void SSAControlRangeDict::_set_range const Symbol var,
const Statement stmt,
Expression range
[protected, virtual]
 

Not implemented. Will p_assert if called.

Implements RangeDict.

Definition at line 303 of file SSAControlRangeDict.cc.

void SSAControlRangeDict::_del_range const Symbol var,
const Statement stmt
[protected, virtual]
 

Not implemented. Will p_assert if called.

Implements RangeDict.

Definition at line 314 of file SSAControlRangeDict.cc.

const Expression * SSAControlRangeDict::_get_range_ref const Symbol var,
const Statement stmt
[protected, virtual]
 

Return the range associated with the given variable.

If the variable doesn't have an associated range, return 0;

Implements RangeDict.

Definition at line 324 of file SSAControlRangeDict.cc.

References ProtoMap< S, T >::find_ref(), and SSAControlRangeData::get_range_ref().


The documentation for this class was generated from the following files:
 © 1995-2005 University of Illinois, Urbana-Champaign. All rights reserved.  Fri Mar 25 23:08:14 2005