Open64 (mfef90, whirl2f, and IR tools)
TAG: version-openad; SVN changeset: 916
|
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 /* ==================================================================== 00037 * ==================================================================== 00038 * 00039 * 00040 * Revision history: 00041 * 02-Nov-96 - Original Version 00042 * 00043 * Description: 00044 * 00045 * Define the external interface to the internal flags representing the 00046 * -LNO group options. It is a single struct, so that addition of 00047 * flags for new options does not require additions to the be Exported 00048 * file, and so that push/pop operations are simplified. 00049 * 00050 * NOTE: Only the standard group option reader, and routines in the 00051 * associated file config_lno.c, should modify the structs declared 00052 * here. By following this discipline, leaving a few undefined flags 00053 * at the end of the struct, and adding new flags there, we can avoid 00054 * serious version incompatibilities between be.so and its clients. 00055 * 00056 * ==================================================================== 00057 * 00058 * To add a new option: 00059 * 00060 * (On conversion from the old LNO implementation, I tried to use 00061 * naming which was mostly like what had been used before, but 00062 * consistent. The instructions below reflect the results.) 00063 * 00064 * 1) In the LNO_FLAGS options struct defined below, add a field to 00065 * receive the new option value. If you need a flag indicating 00066 * whether the option was set explicitly on the command line, add 00067 * a BOOL for that as well, with an appended "_set" in its name. 00068 * (You might also need another field if the option will be used 00069 * in a different form after configuration, i.e. the option value 00070 * is a string that is converted to a number. If so, add another 00071 * field.) 00072 * 00073 * The fields are starting out in alphabetical order by option 00074 * name. When adding new ones, keep in mind that adding them in 00075 * the middle will create a required correspondence between the 00076 * new be.so and lno.so (for purposes of using the later options). 00077 * That may be alright, but if you want to avoid it, add the new 00078 * fields just before the buffer at the end (and you can move 00079 * them into place later when it doesn't matter, if you care). 00080 * 00081 * 2) Below the LNO_FLAGS definition are #defines for the 00082 * "LNO_Option_Name" pseudo-variables that everyone will use to 00083 * reference them. Add #defines for your new ones. Note that 00084 * they all have LNO_ prefixes and are capitalized like global 00085 * variables (which they were before this implementation). 00086 * 00087 * 3) There are two static instances of LNO_FLAGS in config_lno.c. 00088 * Default_LNO contains default values to be used when 00089 * initializing new structs (when we implement pushing/popping 00090 * for regions), and Initial_LNO contains the initial defaults. 00091 * Add the correct default values for your options there. 00092 * 00093 * 4) The option group descriptor is also in config_lno.c. Add your 00094 * new option there. Note that the option descriptors are 00095 * specified using a small set of macros defined above the 00096 * descriptor. 00097 * 00098 * 5) If any configuration is required after reading them in, add the 00099 * required code to LNO_Configure in config_lno.c. 00100 * 00101 * For memory hierarchy options, treatment is similar based on the MHD 00102 * class defined in config_cache.h. Note that in that case, there is 00103 * a main MHD class for single-instance parameters, and a MHD_LEVEL 00104 * class for parameters with a value for each memory hierarchy level. 00105 * The above instructions are modified as follows: 00106 * 00107 * 1) Modify MHD/MHD_LEVEL instead of LNO_FLAGS. 00108 * 00109 * 2) No corresponding access #defines have been done for these. 00110 * Perhaps they should be. 00111 * 00112 * 3) Instead of changing static instances, change the constructors 00113 * in config_cache.cxx. 00114 * 00115 * 4) Same, with different option specification macros. 00116 * 00117 * 5) Same. 00118 * 00119 * NOTE: It is NOT necessary to add anything to the be Exported list. 00120 * 00121 * ==================================================================== 00122 * ==================================================================== 00123 */ 00124 00125 #ifndef config_lno_INCLUDED 00126 #define config_lno_INCLUDED 00127 00128 #ifdef _KEEP_RCS_ID 00129 /*REFERENCED*/ 00130 #endif /* _KEEP_RCS_ID */ 00131 00132 #ifdef __cplusplus 00133 extern "C" { 00134 #endif /* __cplusplus */ 00135 00136 /* ==================================================================== 00137 * 00138 * -LNO: option group 00139 * 00140 * Define the global structure containing -LNO option group flags. 00141 * 00142 * WARNING: Most of the fields in this struct must be addressable by 00143 * an option group descriptor -- hence BOOL instead of mBOOL. 00144 * 00145 * ==================================================================== 00146 */ 00147 00148 extern BOOL Run_autopar; 00149 00150 /* We reference a memory hierarchy descriptor from config_cache.* */ 00151 struct MHD; 00152 00153 typedef struct lno_flags { 00154 /* Support a stack of structs, e.g. for region support. 00155 * Each stack element points to its predecessor; the bottom to NIL. 00156 */ 00157 struct lno_flags *next; /* Next copy on stack */ 00158 struct MHD *_mhd; /* Memory hierarchy descriptor */ 00159 00160 BOOL Aequiv; 00161 BOOL Autodist; 00162 UINT32 Run_AP; 00163 BOOL Ill_xform_directives; 00164 BOOL Backward_substitution; 00165 BOOL Blind_loop_reversal; 00166 BOOL Blocking; 00167 UINT32 Blocking_Size; 00168 BOOL Cache_model_edge_effects; 00169 BOOL Coupled_opts; 00170 BOOL Cse; 00171 BOOL Fancy_tile; 00172 BOOL Run_fiz_fuse; 00173 UINT32 Fission; 00174 UINT32 Fission_inner_register_limit; 00175 BOOL Forward_substitution; 00176 UINT32 Fusion; 00177 UINT32 Fusion_peeling_limit; 00178 UINT32 Gather_Scatter; 00179 UINT32 Graph_capacity; 00180 BOOL Hoist_messy_bounds; 00181 BOOL Ignore_pragmas; 00182 BOOL Interchange; 00183 BOOL Run_lego; 00184 BOOL Run_lego_set; 00185 BOOL Run_lego_localizer; 00186 BOOL Loop_finalization; 00187 UINT32 Max_do_loop_depth_strict; 00188 BOOL Mem_sim; 00189 BOOL Minvar; 00190 UINT32 Opt; 00191 UINT32 Cache_model; 00192 BOOL Run_outer; 00193 UINT32 Outer_unroll; 00194 BOOL Outer_unroll_deep; 00195 UINT32 Outer_unroll_min_for_further_unroll; 00196 UINT32 Outer_unroll_max; 00197 BOOL Outer_unroll_model_only; 00198 UINT32 Outer_unroll_prod_max; 00199 BOOL Outer_unroll_unity; 00200 UINT32 Outer_unroll_aggre; 00201 UINT32 Run_p3; 00202 BOOL Pseudo_lower; 00203 UINT32 Run_prefetch; 00204 BOOL Run_prefetch_set; 00205 UINT32 Prefetch_ahead; 00206 UINT32 Prefetch_iters_ahead; 00207 UINT32 Prefetch_cache_factor; 00208 BOOL Prefetch_indirect; 00209 BOOL Run_prefetch_manual; 00210 BOOL Run_prefetch_manual_set; 00211 BOOL Power_of_two_hack; 00212 BOOL Sclrze; 00213 UINT32 SE_tile_size; 00214 UINT32 Split_tiles; 00215 UINT32 Split_tiles_size; 00216 BOOL Run_test; 00217 BOOL Test_dump; 00218 BOOL Trapezoidal_outer_unroll; 00219 BOOL Use_malloc; 00220 BOOL Use_parm; 00221 BOOL Verbose; 00222 BOOL Version_mp_loops; 00223 BOOL Run_vintr; 00224 BOOL Run_oinvar; 00225 UINT32 Run_doacross; 00226 UINT32 Preferred_doacross_tile_size; 00227 UINT32 Parallel_overhead; 00228 BOOL Prompl; 00229 BOOL IfMinMax; 00230 BOOL Run_call_info; 00231 BOOL Shackle; 00232 BOOL Cross_loop; 00233 BOOL IPA_Enabled; 00234 UINT32 Num_Iters; 00235 UINT32 Pure_Level; 00236 UINT32 Small_trip_count; 00237 UINT32 Local_pad_size; 00238 UINT32 Full_unrolling; 00239 /* This buffer area allows references to new fields to be added in 00240 * later revisions, from other DSOs, without requiring a new be.so 00241 * or running the risk of referencing illegal data. Assuming that 00242 * the buffer is initialized to zeroes, any such references will 00243 * simply pick up FALSE values (for the Booleans): 00244 */ 00245 INT32 buffer[16]; /* Buffer space -- initialize to FALSE */ 00246 } LNO_FLAGS; 00247 00248 #define LNO_FLAGS_next(f) (f->next) 00249 #define LNO_FLAGS_mhd(f) (f->_mhd) 00250 00251 /* ==================================================================== 00252 * 00253 * -LNO: option group 00254 * 00255 * Global data "objects" and manipulation functions. 00256 * 00257 * ==================================================================== 00258 */ 00259 00260 /* This is always the current top of stack: */ 00261 extern LNO_FLAGS *Current_LNO; 00262 extern struct MHD *Current_MHD; 00263 00264 /* And this is always the invariant bottom of stack: */ 00265 extern LNO_FLAGS Initial_LNO; 00266 00267 /* Define pseudo-global-variables for general usage: */ 00268 #define LNO_Aequiv Current_LNO->Aequiv 00269 #define LNO_Autodist Current_LNO->Autodist 00270 #define LNO_Run_AP Current_LNO->Run_AP 00271 #define LNO_Apply_Illegal_Transformation_Directives \ 00272 Current_LNO->Ill_xform_directives 00273 #define LNO_Backward_Substitution Current_LNO->Backward_substitution 00274 #define LNO_Blind_Loop_Reversal Current_LNO->Blind_loop_reversal 00275 #define LNO_Blocking Current_LNO->Blocking 00276 #define LNO_Blocking_Size Current_LNO->Blocking_Size 00277 #define LNO_Cache_Model_Edge_Effects Current_LNO->Cache_model_edge_effects 00278 #define LNO_Coupled_Opts Current_LNO->Coupled_opts 00279 #define LNO_Cse Current_LNO->Cse 00280 #define LNO_Fancy_Tile Current_LNO->Fancy_tile 00281 #define LNO_Run_Fiz_Fuse Current_LNO->Run_fiz_fuse 00282 #define LNO_Fission Current_LNO->Fission 00283 #define LNO_Fission_Inner_Register_Limit \ 00284 Current_LNO->Fission_inner_register_limit 00285 #define LNO_Forward_Substitution Current_LNO->Forward_substitution 00286 #define LNO_Fusion Current_LNO->Fusion 00287 #define LNO_Fusion_Peeling_Limit Current_LNO->Fusion_peeling_limit 00288 #define LNO_Gather_Scatter Current_LNO->Gather_Scatter 00289 #define LNO_Graph_Capacity Current_LNO->Graph_capacity 00290 #define LNO_Hoist_Messy_Bounds Current_LNO->Hoist_messy_bounds 00291 #define LNO_Ignore_Pragmas Current_LNO->Ignore_pragmas 00292 #define LNO_Interchange Current_LNO->Interchange 00293 #define LNO_Run_Lego Current_LNO->Run_lego 00294 #define LNO_Run_Lego_Set Current_LNO->Run_lego_set 00295 #define LNO_Run_Lego_Localizer Current_LNO->Run_lego_localizer 00296 #define LNO_Loop_Finalization Current_LNO->Loop_finalization 00297 #define LNO_Max_Do_Loop_Depth_Strict Current_LNO->Max_do_loop_depth_strict 00298 #define LNO_Mem_Sim Current_LNO->Mem_sim 00299 #define LNO_Minvar Current_LNO->Minvar 00300 #define LNO_Opt Current_LNO->Opt 00301 #define LNO_Cache_Model Current_LNO->Cache_model 00302 #define LNO_Run_Outer Current_LNO->Run_outer 00303 #define LNO_Outer_Unroll Current_LNO->Outer_unroll 00304 #define LNO_Outer_Unroll_Deep Current_LNO->Outer_unroll_deep 00305 #define LNO_Outer_Unroll_Min_For_Further_Unroll \ 00306 Current_LNO->Outer_unroll_min_for_further_unroll 00307 #define LNO_Outer_Unroll_Max Current_LNO->Outer_unroll_max 00308 #define LNO_Outer_Unroll_Model_Only Current_LNO->Outer_unroll_model_only 00309 #define LNO_Outer_Unroll_Prod_Max Current_LNO->Outer_unroll_prod_max 00310 #define LNO_Outer_Unroll_Unity Current_LNO->Outer_unroll_unity 00311 #define LNO_Outer_Unroll_Aggre Current_LNO->Outer_unroll_aggre 00312 #define LNO_Run_P3 Current_LNO->Run_p3 00313 #define LNO_Pseudo_Lower Current_LNO->Pseudo_lower 00314 #define LNO_Run_Prefetch Current_LNO->Run_prefetch 00315 #define LNO_Run_Prefetch_Set Current_LNO->Run_prefetch_set 00316 #define LNO_Prefetch_Ahead Current_LNO->Prefetch_ahead 00317 #define LNO_Prefetch_Iters_Ahead Current_LNO->Prefetch_iters_ahead 00318 #define LNO_Prefetch_Cache_Factor Current_LNO->Prefetch_cache_factor 00319 #define LNO_Prefetch_Indirect Current_LNO->Prefetch_indirect 00320 #define LNO_Run_Prefetch_Manual Current_LNO->Run_prefetch_manual 00321 #define LNO_Run_Prefetch_Manual_Set Current_LNO->Run_prefetch_manual_set 00322 #define LNO_Power_Of_Two_Hack Current_LNO->Power_of_two_hack 00323 #define LNO_Sclrze Current_LNO->Sclrze 00324 #define LNO_SE_Tile_Size Current_LNO->SE_tile_size 00325 #define LNO_Split_Tiles Current_LNO->Split_tiles 00326 #define LNO_Split_Tiles_Size Current_LNO->Split_tiles_size 00327 #define LNO_Run_Test Current_LNO->Run_test 00328 #define LNO_Test_Dump Current_LNO->Test_dump 00329 #define LNO_Trapezoidal_Outer_Unroll Current_LNO->Trapezoidal_outer_unroll 00330 #define LNO_Use_Malloc Current_LNO->Use_malloc 00331 #define LNO_Use_Parm Current_LNO->Use_parm 00332 #define LNO_Verbose Current_LNO->Verbose 00333 #define LNO_Version_Mp_Loops Current_LNO->Version_mp_loops 00334 #define LNO_Run_Vintr Current_LNO->Run_vintr 00335 #define LNO_Run_Oinvar Current_LNO->Run_oinvar 00336 #define LNO_Run_Doacross Current_LNO->Run_doacross 00337 #define LNO_Preferred_doacross_tile_size \ 00338 Current_LNO->Preferred_doacross_tile_size 00339 #define LNO_Parallel_Overhead Current_LNO->Parallel_overhead 00340 #define LNO_Prompl Current_LNO->Prompl 00341 #define LNO_IfMinMax Current_LNO->IfMinMax 00342 #define LNO_Run_call_info Current_LNO->Run_call_info 00343 #define LNO_Shackle Current_LNO->Shackle 00344 #define LNO_Cross_Loop Current_LNO->Cross_loop 00345 /* Access to the current TOS struct is via pseudo-global variables: */ 00346 /* bounds_check same as subscript_check */ 00347 #define LNO_Const_Mod_Warning (Current_LNO->cmod_warn) 00348 00349 // ipa information available for LNO 00350 #define LNO_IPA_Enabled Current_LNO->IPA_Enabled 00351 00352 // estimated number of iters to use for num-symb-iters in LNO 00353 #define LNO_Num_Iters Current_LNO->Num_Iters 00354 00355 // 0 => don't create CALL_INFOs for pure functions 00356 // 1 => (default) create CALL_INFOs for pure functions 00357 // 2 => 1 + treat "no side effects" functions as pure, too 00358 #define LNO_Pure_Level Current_LNO->Pure_Level 00359 00360 // Largest inner loop trip count for which we'll try full unrolling 00361 #define LNO_Small_Trip_Count Current_LNO->Small_trip_count 00362 00363 // The amount by which to pad local array dimensions 00364 #define LNO_Local_Pad_Size Current_LNO->Local_pad_size 00365 00366 // The amount by which to pad local array dimensions 00367 #define LNO_Full_Unrolling_Limit Current_LNO->Full_unrolling 00368 00369 /* Initialize the current top of stack to defaults: */ 00370 extern void LNO_Init_Config ( void ); 00371 00372 /* Push a new struct on top of stack, either a copy of the current 00373 * TOS, or the defaults: 00374 */ 00375 extern void LNO_Push_Config ( BOOL use_default ); 00376 00377 /* Pop a struct from top of stack and return TRUE if the old TOS was 00378 * not the original TOS, or do nothing and return FALSE: 00379 */ 00380 extern BOOL LNO_Pop_Config ( void ); 00381 00382 /* Configure the current top of stack struct: */ 00383 extern void LNO_Configure ( void ); 00384 00385 00386 #ifdef __cplusplus 00387 } 00388 #endif /* __cplusplus */ 00389 00390 #endif /* config_lno_INCLUDED */