Polaris: GSAControlRangeDict Class Reference

GSAControlRangeDict Class Reference

file GSAControlRangeDict.h Collection of ranges extracted from GSA program's control flow More...

#include <GSAControlRangeDict.h>

Inheritance diagram for GSAControlRangeDict:

Inheritance graph
[legend]
List of all members.

Public Member Functions

 GSAControlRangeDict (ProgramUnit &pgm, int debug=0)
virtual ~GSAControlRangeDict ()
 Destructor.
void touch ()
 Force this object to compute the ranges for each statement in the program unit.
void icdom_touch ()
 Force each GSAControlRangeData 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 GSAControlRangeDict.h Collection of ranges extracted from GSA program's control flow

Polaris Range

See also:
GSAControlRangeDict.h

GSAControlRangeDict.h

GSAControlRangeDict.cc

Overview

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

Description

An GSAControlRangeDict object is a repository of the variable ranges for all points of a program unit in GSA 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.

GSAControlRangeDict 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 GSA form can be found in Blume and Eigenmann, "Demand- Driven Symbolic Range Propagation".

Definition at line 54 of file GSAControlRangeDict.h.


Constructor & Destructor Documentation

GSAControlRangeDict::GSAControlRangeDict ProgramUnit pgm,
int  debug = 0
 

GSAControlRangeDict::~GSAControlRangeDict  )  [virtual]
 

Destructor.

Definition at line 126 of file GSAControlRangeDict.cc.


Member Function Documentation

void GSAControlRangeDict::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 146 of file GSAControlRangeDict.cc.

References KeyIterator< S, T >::current_data(), KeyIterator< S, T >::current_key(), Type::data_type(), GSAControlRangeData::get_range_ref(), ProgramUnit::gsa_deflocs_guarded(), INTEGER_TYPE, Symbol::is_array(), DefLocMap::iterator(), representative_stmt(), DefLoc::stmt_valid(), Symbol::type(), and KeyIterator< S, T >::valid().

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

void GSAControlRangeDict::icdom_touch  ) 
 

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

Not meant for external use.

Definition at line 134 of file GSAControlRangeDict.cc.

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

const Statement & GSAControlRangeDict::representative_stmt const Statement stmt  )  const
 

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

Definition at line 283 of file GSAControlRangeDict.cc.

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

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

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

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

Definition at line 305 of file GSAControlRangeDict.cc.

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

Referenced by GSAFullRangeDict::touch().

void GSAControlRangeDict::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 182 of file GSAControlRangeDict.cc.

References ExprSet::clear(), GSAControlRangeData::clear_ranges(), clear_ranges(), KeyIterator< S, T >::current_data(), KeyIterator< S, T >::current_key(), Type::data_type(), GSAControlRangeData::get_range_ref(), ProgramUnit::gsa_deflocs_guarded(), GSAControlRangeData::icdom_ref(), INTEGER_TYPE, Symbol::is_array(), DefLocMap::iterator(), GSAControlRangeData::num_computed_ranges(), num_computed_ranges(), representative_stmt(), DefLoc::stmt_valid(), touch(), Symbol::type(), and KeyIterator< S, T >::valid().

int GSAControlRangeDict::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 268 of file GSAControlRangeDict.cc.

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

Referenced by stats().

void GSAControlRangeDict::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 355 of file GSAControlRangeDict.cc.

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

Referenced by GSAFullRangeDict::clear().

void GSAControlRangeDict::clear_ranges  ) 
 

Delete all saved ranges within myself.

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

Definition at line 369 of file GSAControlRangeDict.cc.

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

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

void GSAControlRangeDict::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 383 of file GSAControlRangeDict.cc.

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

void GSAControlRangeDict::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 399 of file GSAControlRangeDict.cc.

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

Referenced by GSAFullRangeDict::pretty_print().

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

listable_clone

Implements Listable.

Definition at line 439 of file GSAControlRangeDict.cc.

int GSAControlRangeDict::structures_OK  )  const [virtual]
 

Methods required by Listable.

Definition at line 450 of file GSAControlRangeDict.cc.

References BaseMapRoot::structures_OK().

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

Not implemented. Will p_assert if called.

Implements RangeDict.

Definition at line 319 of file GSAControlRangeDict.cc.

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

Not implemented. Will p_assert if called.

Implements RangeDict.

Definition at line 330 of file GSAControlRangeDict.cc.

const Expression * GSAControlRangeDict::_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 341 of file GSAControlRangeDict.cc.

References ProtoMap< S, T >::find_ref(), and GSAControlRangeData::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:07:27 2005