Polaris: range_dict_util.h File Reference

range_dict_util.h File Reference

Go to the source code of this file.

Functions

class void sort_sym_list (RefList< Symbol > &sym_list)
 Description: Rename any variables named MIN or MAX in the given program so that they will not conflict with the symbols for the intrinsics MIN and MAX.
void remove_min_max_var_conflicts (Symtab &symtab)
 Description: If the given statement has a MAYMODS assertion, return the set of possibly modified variables.
RefSet< Symbol > * stmt_maymods (const Statement &stmt)
 Silvius: force insertion of ranges according to the Fortran 77 standard for the following case: DIMENSION A(m,n:p,*) DO i=1,k DO j=h,100 A(i,j,...)=..
void enforce_standard_within_bounds (ProgramUnit &pgm, RefList< Statement > &new_ifs)
 Silvius: force insertion of ranges according to the Fortran 77 standard for the following case: DIMENSION A(m,n:p,*) DO i=1,k DO j=h,100 A(i,j,...)=...
void clean_after_standard_enforcement (ProgramUnit &pgm, RefList< Statement > &new_ifs)
 Clean up after enforce_standard_within_bounds.


Function Documentation

class class void sort_sym_list RefList< Symbol > &  sym_list  ) 
 

Description: Rename any variables named MIN or MAX in the given program so that they will not conflict with the symbols for the intrinsics MIN and MAX.

Definition at line 21 of file range_dict_util.cc.

References Iterator< T >::current(), RefList< T >::entries(), RefList< T >::grab(), Symbol::name_ref(), and Iterator< T >::valid().

Referenced by IPCPProcData::add_maymods(), BaseStmtRanges::pretty_print(), ControlRangeDict::pretty_print(), GSAControlRangeDict::pretty_print(), GSAFullRangeDict::pretty_print(), SSAControlRangeDict::pretty_print(), SSAFullRangeDict::pretty_print(), and StmtRanges::simplify_min_max().

void remove_min_max_var_conflicts Symtab symtab  ) 
 

Description: If the given statement has a MAYMODS assertion, return the set of possibly modified variables.

Otherwise, return NULL.

Definition at line 66 of file range_dict_util.cc.

References _fix_intr_var_conflicts().

RefSet<Symbol>* stmt_maymods const Statement stmt  ) 
 

Silvius: force insertion of ranges according to the Fortran 77 standard for the following case: DIMENSION A(m,n:p,*) DO i=1,k DO j=h,100 A(i,j,...)=..

Otherwise, return NULL.

Definition at line 85 of file range_dict_util.cc.

References Assertion::arg_list_guarded(), Assertion::arg_list_valid(), AS_MAYMOD, Expression::base_variable_ref(), Iterator< T >::current(), RefSet< T >::ins(), Assertion::type(), and Iterator< T >::valid().

Referenced by _make_nonlocals_modified_at_calls().

void enforce_standard_within_bounds ProgramUnit pgm,
RefList< Statement > &  new_ifs
 

Silvius: force insertion of ranges according to the Fortran 77 standard for the following case: DIMENSION A(m,n:p,*) DO i=1,k DO j=h,100 A(i,j,...)=...

In this case, since the access on A must be within bounds we will add to the dictionary the following ranges: k=[1,m] and h=[n:p]. Silvius: since I do not want to get to the guts of the AIRangeDict, we will force the insertionof the ranges by inserting some guards in the code, such as: IF (1.LE.k.AND.k.LE.m) THEN DO i=1,k Silvius: for now we do not catch all possible ranges, just look at some particular cases.

silvius: not sure this is right

First find DO loops and select "inits" and "limits"

... Go through all the statements in the loop.

cerr<<"\nAt loop "<<loopit.current();

... Check whether the init or limit are ID_OP.

cerr<<"\nNo suitable init/limit found.";

cerr<<"\nAt statement: "<<*stit;

... Go through all the array references in the statement.

cerr<<"\n\tFor array ref "<<ar;

... If it gets here, it is the loop index.

... Report it for now.

... Insert if not already found.

cerr<<"\n\t\tInsert relation: " <<*lower<<"<="<<bit.current()<<"<="<<*upper;

... At this point we have all the solutions for this loop. ... Let us insert the solutions as pgm guards.

Definition at line 167 of file range_dict_util.cc.

References and(), Expression::arg_list(), Expression::array(), Expression::clone(), constant(), Iterator< T >::current(), Symbol::dim(), DO_STMT, List< T >::entries(), RefList< T >::entries(), Statement::follow_ref(), get_array_refs(), ID_OP, Statement::index(), Statement::init(), RefList< T >::ins_last(), VariableSymbol::is_gsa_symbol(), Statement::iterate_expressions(), le(), Statement::limit(), ArrayBounds::lower_exists(), ArrayBounds::lower_guarded(), Listable::next_ref(), Statement::next_ref(), Expression::op(), Listable::prev_ref(), simplify(), Expression::subscript(), Expression::symbol(), ArrayBounds::upper_exists(), ArrayBounds::upper_guarded(), and Iterator< T >::valid().

void clean_after_standard_enforcement ProgramUnit pgm,
RefList< Statement > &  new_ifs
 

Clean up after enforce_standard_within_bounds.

Definition at line 273 of file range_dict_util.cc.

References Iterator< T >::current(), Statement::matching_endif_ref(), Statement::next_ref(), Statement::prev_ref(), and Iterator< T >::valid().

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