00001 /* 00002 00003 Copyright (C) 2000, 2001 Silicon Graphics, Inc. All Rights Reserved. 00004 00005 This program is free software; you can redistribute it and/or modify it 00006 under the terms of version 2 of the GNU General Public License as 00007 published by the Free Software Foundation. 00008 00009 This program is distributed in the hope that it would be useful, but 00010 WITHOUT ANY WARRANTY; without even the implied warranty of 00011 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 00012 00013 Further, this software is distributed without any warranty that it is 00014 free of the rightful claim of any third person regarding infringement 00015 or the like. Any license provided herein, whether implied or 00016 otherwise, applies only to this software file. Patent licenses, if 00017 any, provided herein do not apply to combinations of this program with 00018 other software, or any other product whatsoever. 00019 00020 You should have received a copy of the GNU General Public License along 00021 with this program; if not, write the Free Software Foundation, Inc., 59 00022 Temple Place - Suite 330, Boston MA 02111-1307, USA. 00023 00024 Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pky, 00025 Mountain View, CA 94043, or: 00026 00027 http://www.sgi.com 00028 00029 For further information regarding this notice, see: 00030 00031 http://oss.sgi.com/projects/GenInfo/NoticeExplan 00032 00033 */ 00034 00035 00036 //-*-c++-*- 00037 //------------------------------------------------------------------------ 00038 // LNO_Build_Access(WN *func_nd,MEM_POOL *pool, BOOL Hoist_Bounds) 00039 // 00040 // Build the access array for all the array statments and 00041 // all the do loops in the function. Attach them to the 00042 // code using LNO_Info_Map. If 'Hoist_Bounds' is TRUE, 00043 // promote bounds so that access vectors which are too messy 00044 // are expessed in terms of promoted bounds. 00045 // 00046 // void LNO_Build_Access(WN *wn, DOLOOP_STACK *stack, MEM_POOL *pool, 00047 // INDX_RANGE_STACK *irs=0, BOOL Hoist_Bounds) 00048 // 00049 // Build the access arrays for all the array statements and 00050 // all the do loops descended from wn. stack must contain 00051 // all the outer do loops. The bounds of all the outer loops 00052 // must be set. irs, if it's set, is used to get bounds 00053 // on the loops using the array index expressions. 00054 // Promote_Access same as above. 00055 // 00056 // void LNO_Build_Do_Access(WN *wn, DOLOOP_STACK *stack, BOOL Hoist_Bounds) 00057 // 00058 // Build the access arrays for the bounds of the do loop headed 00059 // at wn. Map the wn. 'Hoist_Bounds' has the same meaning as 00060 // is in LNO_Build_Access. 00061 // 00062 // void LNO_Build_If_Access(WN *wn, DOLOOP_STACK *stack) 00063 // 00064 // Build the access arrays for the if statement 'wn'. 00065 // Map the wn. 00066 // 00067 // void LNO_Build_Access_Array(WN *wn, DOLOOP_STACK *stack, MEM_POOL *pool, 00068 // INDX_RANGE_STACK *irs=0) 00069 // 00070 // void LNO_Print_One_Access(FILE *fp, WN* wn) 00071 // 00072 // Print a single access vector 00073 // 00074 // LNO_Print_Access(FILE *fp,WN *func_nd) 00075 // 00076 // Print all the access vectors in the routine 00077 // 00078 // BOOL Bound_Is_Too_Messy(ACCESS_ARRAY* aa) 00079 // 00080 // Returns TRUE if the access array 'aa' has Too_Messy 00081 // set globally or on any of its dimensions. 00082 // 00083 // BOOL Hoist_Lower_Bound(WN* wn_loop, DOLOOP_STACK* stack, 00084 // MEM_POOL* pool) 00085 // 00086 // Hoist the lower bound of the loop 'wn_loop' and put it in 00087 // a statement in front of the loop. The 'stack' is a stack of 00088 // loops enclosing 'wn_loop'. The 'pool' is used to rebuild 00089 // the access vector. Returns FALSE if we could not promote the 00090 // lower bound, TRUE if we could. 00091 // 00092 // BOOL Hoist_Upper_Bound(WN* wn_loop, DOLOOP_STACK* stack, 00093 // MEM_POOL* pool) 00094 // 00095 // Hoist the upper bound of the loop 'wn_loop' and put it in 00096 // a statement in front of the loop. The 'stack' is a stack of 00097 // loops enclosing 'wn_loop'. The 'pool' is used to rebuild 00098 // the access vector. Returns FALSE if we could not promote the 00099 // upper bound, TRUE if we could. 00100 // 00101 // void Hoist_Bounds_One_Level(WN* wn_tree) 00102 // 00103 // If bounds any loop of 'wn_tree are "Too Messy", put them 00104 // into a temp and recompute the access vectors in terms of 00105 // the new temp value. 00106 // 00107 // void Hoist_Iload_Ldid_Upper_Bound_One_Level(WN* loop, 00108 // BOOL negative_stride) 00109 // 00110 // If bounds 'loop' has ILOAD-LDID from lego-tiling, put it 00111 // into a temp and recompute the access vectors in terms of 00112 // the new temp value. 00113 // 00114 // void Hoist_Varying_Lower_Bounds(WN* func_nd) 00115 // 00116 // Put any loop lower bound which is assigned in its loop into 00117 // a preg and hoist it out of the loop. 00118 // 00119 //-------------------------------------------------------------------------- 00120 00121 #ifndef access_main_INCLUDED 00122 #define access_main_INCLUDED "access_main.h" 00123 00124 #ifndef wn_INCLUDED 00125 #include "wn.h" 00126 #endif 00127 #ifndef cxx_memory_INCLUDED 00128 #include "cxx_memory.h" 00129 #endif 00130 #ifndef cxx_base_INCLUDED 00131 #include "cxx_base.h" 00132 #endif 00133 #ifndef cxx_template_INCLUDED 00134 #include "cxx_template.h" 00135 #endif 00136 #ifndef stab_INCLUDED 00137 #include "stab.h" 00138 #endif 00139 #ifndef access_vector_INCLUDED 00140 #include "access_vector.h" 00141 #endif 00142 00143 extern void LNO_Build_Access(WN *func_nd, MEM_POOL *pool, 00144 BOOL Hoist_Bounds=FALSE); 00145 extern void LNO_Build_Access(WN *wn, DOLOOP_STACK *stack, MEM_POOL *pool, 00146 INDX_RANGE_STACK *irs=0, 00147 BOOL Hoist_Bounds=FALSE); 00148 extern void LNO_Print_One_Access(FILE *fp, WN* wn); 00149 extern void LNO_Print_Access(FILE *fp,WN *func_nd); 00150 extern void LNO_Build_Do_Access(WN *wn, DOLOOP_STACK *stack, 00151 BOOL Hoist_Bounds=FALSE); 00152 extern void LNO_Build_If_Access(WN *wn, DOLOOP_STACK *stack); 00153 extern void LNO_Build_Access_Array(WN *wn,DOLOOP_STACK *stack,MEM_POOL *pool, 00154 INDX_RANGE_STACK *irs=0); 00155 00156 extern BOOL Bound_Is_Too_Messy(ACCESS_ARRAY* aa); 00157 extern BOOL Hoist_Lower_Bound(WN* wn_loop, DOLOOP_STACK* stack, 00158 MEM_POOL* pool); 00159 extern BOOL Hoist_Upper_Bound(WN* wn_loop, DOLOOP_STACK* stack, 00160 MEM_POOL* pool); 00161 00162 extern void Hoist_Bounds_One_Level(WN* wn_tree); 00163 00164 extern void Hoist_Iload_Ldid_Upper_Bound_One_Level( 00165 WN* loop, 00166 BOOL negative_stride); 00167 00168 extern void Hoist_Varying_Lower_Bounds(WN* func_nd); 00169 00170 #endif
1.5.6