00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00047 #ifndef snl_nest_INCLUDED
00048 #define snl_nest_INCLUDED "snl_nest.h"
00049
00050 #ifdef _KEEP_RCS_ID
00051 static char *snl_nest_rcs_id = snl_nest_INCLUDED "$Revision$";
00052 #endif
00053
00054 class ACCESS_VECTOR;
00055 class ACCESS_ARRAY;
00056
00057 #ifndef defs_INCLUDED
00058 #include "defs.h"
00059 #endif
00060 #ifndef mat_INCLUDED
00061 #include "mat.h"
00062 #endif
00063 #ifndef CXX_BASE_INCLUDED
00064 #include "cxx_base.h"
00065 #endif
00066 #ifndef access_vector_INCLUDED
00067 #include "access_vector.h"
00068 #endif
00069 #ifndef lnopt_main_INCLUDED
00070 #include "lnopt_main.h"
00071 #endif
00072 #ifndef lnopt_main_INCLUDED
00073 #include "snl.h"
00074 #endif
00075 #include "sxlist.h"
00076
00077
00078
00079
00080
00081 enum SNL_LOOP_PROBLEM {
00082 SNL_LOOP_PROBLEM_NONE = 747,
00083 SNL_LOOP_PROBLEM_LOOP,
00084 SNL_LOOP_PROBLEM_DISTRIBUTION,
00085 SNL_LOOP_PROBLEM_SCALAR,
00086 SNL_LOOP_PROBLEM_INNER_MIGHT_NOT_GO,
00087 SNL_LOOP_PROBLEM_INNER_DOES_NOT_GO
00088 };
00089
00090 struct SNL_LOOP_PROBLEM_INFO {
00091 SNL_LOOP_PROBLEM Problem;
00092 WN* Wn;
00093 SYMBOL Var;
00094 SNL_LOOP_PROBLEM_INFO() : Problem(SNL_LOOP_PROBLEM_NONE) {}
00095 SNL_LOOP_PROBLEM_INFO(SNL_LOOP_PROBLEM prob) : Problem(prob) {}
00096 };
00097
00098 class SNL_BOUNDS_INFO;
00099
00100 class SNL_NEST_INFO {
00101
00102 public:
00103
00104 SNL_NEST_INFO(WN* outer, INT nloops, MEM_POOL* pool, BOOL inner_only);
00105 ~SNL_NEST_INFO();
00106
00107 DOLOOP_STACK& Dostack() {return _dostack;}
00108 const DOLOOP_STACK& Dostack() const {return _dostack;}
00109 INT Nloops() const {return _nloops;}
00110 INT Nloops_General() const {return _nloops_general;}
00111 INT Nloops_Invariant() const {return _nloops_invariant;}
00112 INT& Nloops_Invariant() {return _nloops_invariant;}
00113 INT Depth_Inner() const {return _depth_inner;}
00114 INT Num_Bad() const {return _num_bad;}
00115 SNL_BOUNDS_INFO* Bi() {return _bi;}
00116 const SNL_BOUNDS_INFO*Bi() const {return _bi;}
00117 BOOL Above_Is_Distributable() const
00118 {return _above_is_distributable;}
00119 BOOL Below_Is_Distributable() const
00120 {return _below_is_distributable;}
00121 MEM_POOL* Pool() const {return _pool;}
00122 BOOL Innermost() const {return _innermost;}
00123 void Print(FILE*) const;
00124 void Exclude_Outer_Loops(INT how_many);
00125
00126 SX_INFO& Privatizability_Info()
00127 {return _privatizability_info;}
00128 const SX_INFO& Privatizability_Info() const
00129 {return _privatizability_info;}
00130
00131 SNL_LOOP_PROBLEM_INFO Problem(INT depth) const {
00132 return _problem == NULL ? SNL_LOOP_PROBLEM_INFO(SNL_LOOP_PROBLEM_NONE)
00133 : _problem[depth];
00134 }
00135
00136 private:
00137
00138 void Make_Privatizability_Info_Handle_Def(WN*, INT);
00139 void Make_Privatizability_Info_Handle_Use(WN*, INT,
00140 HASH_TABLE<WN*,BOOL>*);
00141 void Make_Privatizability_Info_Walk(WN*, INT,
00142 HASH_TABLE<WN*,BOOL>*);
00143 void Make_Privatizability_Info();
00144
00145
00146 SNL_NEST_INFO(const SNL_NEST_INFO& i);
00147
00148 INT _nloops;
00149 INT _num_bad;
00150 INT _depth_inner;
00151 MEM_POOL* _pool;
00152 DOLOOP_STACK _dostack;
00153 SX_INFO _privatizability_info;
00154
00155
00156
00157 BOOL _innermost;
00158
00159
00160 INT _nloops_invariant;
00161
00162
00163 SNL_BOUNDS_INFO* _bi;
00164 INT _nloops_general;
00165 BOOL _above_is_distributable;
00166 BOOL _below_is_distributable;
00167 SNL_LOOP_PROBLEM_INFO* _problem;
00168 };
00169
00170
00171
00172
00173
00174 class FIZ_FUSE_INFO;
00175
00176 extern FIZ_FUSE_INFO* Emulate_Fiz_Fuse(WN* body, MEM_POOL* pool);
00177
00178 #endif