Polaris: AccessDimension.h Source File

AccessDimension.h

Go to the documentation of this file.
00001 #ifndef _ACCESSDIMENSION_H
00002 #define _ACCESSDIMENSION_H
00003 ///
00004 #ifdef POLARIS_GNU_PRAGMAS
00005 #pragma interface
00006 #endif
00007 ///
00008 class ProgramUnit;
00009 class InlineObject;
00010 
00011 #include "ClassNames.h"
00012 #include "Collection/RefList.h"
00013 #include "Expression/Expression.h"
00014 #include "Boolean.h"
00015 #include "TranslateObject.h"
00016 #include "translateobject.h"
00017 #include "Monotonicity.h"
00018 #include "SmallIntSet.h"
00019 #include "Symbol/Symbol.h"
00020 
00021 enum ACCURACY { ACCU_UNKNOWN = 0,
00022         ACCU_EXACT,
00023         ACCU_SUPERSET,
00024         ACCU_SUBSET };
00025 
00026 class AccessDimension : public Listable {
00027 
00028 friend class AbstractAccess;
00029 
00030  protected:
00031 ///<    RefList<Symbol> _index_list;
00032     Symbol * _index;
00033     Expression * _stride;
00034     Expression * _span;
00035 
00036     bool _check_overlap;    ///< Whether to check for overlap with this dimension at runtime
00037 
00038     bool _singleton;        ///< Whether all original indices producing this dimension
00039                             ///< were "singleton" indices.  That is, whether they appeared
00040                             ///< by themselves (without other loop indices) in the subscript
00041                             ///< expression of a dimension position.  e.g. I in A(I,K+J), 
00042                             ///< I in A(I,2*I).
00043 
00044     ACCURACY _accuracy;
00045 
00046     Monotonicity _mono;
00047 
00048  public:
00049     AccessDimension( );
00050     AccessDimension( Expression * stride, Expression * span );
00051     AccessDimension( Expression * stride, Expression * span, ACCURACY acc );
00052     AccessDimension( Expression * stride, Expression * span,
00053             ACCURACY acc, Monotonicity *mono );
00054     AccessDimension( const AccessDimension & other );
00055 
00056     ~AccessDimension( );
00057 
00058     AccessDimension * remap_interface_vars (InlineObject * inline_object,
00059                         REF_TYPE ref ) const;
00060 
00061     void translate_GSA_symbols ( TranslateObject * tobj );
00062 
00063     virtual Listable *listable_clone() const;
00064 
00065     virtual AccessDimension *clone() const;
00066 
00067     void relink_eptrs( ProgramUnit & p );
00068 
00069     void singleton(bool );
00070     bool singleton( ) const;
00071 
00072     Boolean stride_exists( ) const;
00073     Boolean span_exists  ( ) const;
00074 
00075     void accuracy ( ACCURACY acc );
00076     ACCURACY accuracy ( ) const;
00077 
00078     void monotonicity ( Monotonicity mon );
00079     Monotonicity monotonicity ( ) const;
00080 
00081     void check_overlap (bool);              ///< Set the check_overlap field
00082     bool check_overlap( ) const;            ///< Get the check_overlap field
00083 
00084 ///<    RefList<Symbol> & index_list();
00085     Symbol * index();      ///< Get the index associated with this dimension
00086     void index(Symbol *);  ///< Supply the index associated with this dimension
00087 
00088     Expression & stride_guarded ( ) const;
00089     Expression & span_guarded ( ) const;
00090 
00091     void stride( Expression * stride );
00092     void span( Expression * span );
00093 
00094     ///< This one is to satisfy Listable
00095     virtual void    print(ostream & o) const;
00096 
00097     friend ostream & operator << (ostream & o, const AccessDimension & ad);
00098 };
00099 
00100 inline void
00101 AccessDimension::check_overlap (bool val) {
00102     _check_overlap = val;
00103 }
00104 
00105 inline bool
00106 AccessDimension::check_overlap ( ) const
00107 {
00108     return _check_overlap;
00109 }
00110 
00111 inline void
00112 AccessDimension::singleton (bool val) {
00113     _singleton = val;
00114 }
00115 
00116 inline bool
00117 AccessDimension::singleton ( ) const
00118 {
00119     return _singleton;
00120 }
00121 
00122 #endif
 © 1995-2005 University of Illinois, Urbana-Champaign. All rights reserved.  Fri Mar 25 23:05:36 2005