|
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(). |