Open64 (mfef90, whirl2f, and IR tools)  TAG: version-openad; SVN changeset: 916
config_lno.cxx
Go to the documentation of this file.
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  *  11-Nov-96 - Original Version.
00042  *
00043  * Description:
00044  *
00045  * Configure the -LNO option group (included in config.c).
00046  *
00047  * ====================================================================
00048  *
00049  * TODO:  at a convenient point:
00050  *
00051  * ====================================================================
00052  * ====================================================================
00053  */
00054 
00055 #ifdef _KEEP_RCS_ID
00056 /*REFERENCED*/
00057 #endif /* _KEEP_RCS_ID */
00058 
00059 /* This file is included in config.c, so it doesn't need its own set of
00060  * standard includes -- only the following:
00061  */
00062 #include "config_lno.h"
00063 #include "config_cache.h"
00064 
00065 /* ====================================================================
00066  *
00067  * -LNO: option group
00068  *
00069  * Define the defaults for -LNO option group flags.
00070  *
00071  * NOTE:  There are two copies of this defined -- one to copy when
00072  * initializing a new struct to the defaults, and one to serve as the
00073  * initial bottom of the Current_LNO stack.  Fix both of them when
00074  * adding/changing things.
00075  *
00076  * WARNING:  The current memory model can handle four levels.  In order
00077  * to change it, it is necessary to change the parameter in the file
00078  * ... as well as the initial value lists of the structs below, and the
00079  * _DUP option descriptor macros below.
00080  *
00081  * ====================================================================
00082  */
00083 
00084 #define DEFAULT_UNROLL_PROD_MAX 16
00085 #define DEFAULT_UNROLL_MAX 10
00086 
00087 BOOL Run_autopar = FALSE;
00088 
00089 static LNO_FLAGS Default_LNO = {
00090   NULL,         /* next */
00091   NULL,         /* _mhd */
00092 
00093   TRUE,         /* Aequiv */
00094   FALSE,        /* Automatic Data Distribution */
00095   1,            /* Run_AP */
00096   FALSE,        /* Ill_xform_directives */
00097   TRUE,         /* Backward_substitution */
00098   FALSE,        /* Blind_loop_reversal */
00099   TRUE,         /* Blocking */
00100   0,            /* Blocking_Size */
00101   TRUE,         /* Cache_model_edge_effects */
00102   TRUE,         /* Coupled_opts */
00103   TRUE,         /* Cse */
00104   FALSE,        /* Fancy_tile */
00105   FALSE,        /* Run_fiz_fuse */
00106   1,            /* Fission */
00107   0,            /* Fission_inner_register_limit */
00108   TRUE,         /* Forward_substitution */
00109   1,            /* Fusion */
00110   5,            /* Fusion_peeling_limit */
00111   1,            /* Gather_Scatter */
00112   0xfffe,       /* Graph_capacity */
00113   TRUE,         /* Hoist_messy_bounds */
00114   FALSE,        /* Ignore_pragmas */
00115   TRUE,         /* Interchange */
00116   FALSE, FALSE, /* Run_lego */
00117   TRUE,         /* Run_lego_localizer */
00118   TRUE,         /* Loop_finalization */
00119   8,            /* Max_do_loop_depth_strict */
00120   FALSE,        /* Mem_sim */
00121   TRUE,         /* Minvar */
00122   1,            /* Opt */
00123   2,            /* Cache_model */
00124   TRUE,         /* Run_outer */
00125   0,            /* Outer_unroll */
00126   TRUE,         /* Outer_unroll_deep */
00127   6,            /* Outer_unroll_min_for_further_unroll */
00128   0,            /* Outer_unroll_max */
00129   FALSE,        /* Outer_unroll_model_only */
00130   0,            /* Outer_unroll_prod_max */
00131   TRUE,         /* Outer_unroll_unity */
00132   2,            /* ou_aggre */
00133   0,            /* Run_p3 */
00134   TRUE,         /* Pseudo_lower */
00135   0, FALSE,     /* Run_prefetch */
00136   2,            /* Prefetch_ahead */
00137   2,            /* Prefetch_iters_ahead */
00138   2,            /* Prefetch_cache_factor */
00139   FALSE,        /* Prefetch_indirect */
00140   FALSE, FALSE, /* Run_prefetch_manual */
00141   TRUE,         /* Power_of_two_hack */
00142   TRUE,         /* Sclrze */
00143   0,            /* SE_tile_size */
00144   1,            /* Split_tiles */
00145   64,           /* Split_tiles_size */
00146   FALSE,        /* Run_test */
00147   FALSE,        /* Test_dump */
00148   TRUE,         /* Trapezoidal_outer_unroll */
00149   FALSE,        /* Use_malloc */
00150   TRUE,         /* Use_parm */
00151   FALSE,        /* Verbose */
00152   TRUE,         /* Version_mp_loops */
00153   TRUE,         /* Run_vintr */
00154   TRUE,         /* Run_oinvar */
00155   1,            /* Run_doacross */
00156   0,            /* Preferred_doacross_tile_size */
00157   2600,         /* Parallel_overhead */ 
00158   FALSE,        /* Prompl */ 
00159   TRUE,         /* IfMinMax */ 
00160   FALSE,        /* Run_call_info */
00161   TRUE,         /* Shackle */ 
00162   FALSE,        /* Cross_loop */ 
00163   FALSE,        /* IPA_Enabled */
00164   100,          /* Num_Iters */
00165   1,            /* Pure_Level */ 
00166   5,            /* Small_trip_count */
00167   (UINT32)-1,   /* Local_pad_size */
00168   0,            /* Full_unrolling */
00169   { 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0 }        /* buffer[16] */
00170 };
00171 
00172 LNO_FLAGS Initial_LNO = {
00173   NULL,         /* next */
00174   &Mhd_Options, /* _mhd */
00175 
00176   TRUE,         /* Aequiv */
00177   FALSE,        /* Automatic data distribution */
00178   1,            /* Run_AP */
00179   FALSE,        /* Ill_xform_directives */
00180   TRUE,         /* Backward_substitution */
00181   FALSE,        /* Blind_loop_reversal */
00182   TRUE,         /* Blocking */
00183   0,            /* Blocking_Size */
00184   TRUE,         /* Cache_model_edge_effects */
00185   TRUE,         /* Coupled_opts */
00186   TRUE,         /* Cse */
00187   FALSE,        /* Fancy_tile */
00188   FALSE,        /* Run_fiz_fuse */
00189   1,            /* Fission */
00190   0,            /* Fission_inner_register_limit */
00191   TRUE,         /* Forward_substitution */
00192   1,            /* Fusion */
00193   5,            /* Fusion_peeling_limit */
00194   1,            /* Gather_Scatter */
00195   0xfffe,       /* Graph_capacity */
00196   TRUE,         /* Hoist_messy_bounds */
00197   FALSE,        /* Ignore_pragmas */
00198   TRUE,         /* Interchange */
00199   FALSE, FALSE, /* Run_lego */
00200   TRUE,         /* Run_lego_localizer */
00201   TRUE,         /* Loop_finalization */
00202   8,            /* Max_do_loop_depth_strict */
00203   FALSE,        /* Mem_sim */
00204   TRUE,         /* Minvar */
00205   1,            /* Opt */
00206   2,            /* Cache_model */
00207   TRUE,         /* Run_outer */
00208   0,            /* Outer_unroll */
00209   TRUE,         /* Outer_unroll_deep */
00210   6,            /* Outer_unroll_min_for_further_unroll */
00211   0,            /* Outer_unroll_max */
00212   FALSE,        /* Outer_unroll_model_only */
00213   0,            /* Outer_unroll_prod_max */
00214   TRUE,         /* Outer_unroll_unity */
00215   2,            /* ou_aggre */
00216   0,            /* Run_p3 */
00217   TRUE,         /* Pseudo_lower */
00218   0, FALSE,     /* Run_prefetch */
00219   2,            /* Prefetch_ahead */
00220   2,            /* Prefetch_iters_ahead */
00221   2,            /* Prefetch_cache_factor */
00222   FALSE,        /* Prefetch_indirect */
00223   FALSE, FALSE, /* Run_prefetch_manual */
00224   TRUE,         /* Power_of_two_hack */
00225   TRUE,         /* Sclrze */
00226   0,            /* SE_tile_size */
00227   1,            /* Split_tiles */
00228   64,           /* Split_tiles_size */
00229   FALSE,        /* Run_test */
00230   FALSE,        /* Test_dump */
00231   TRUE,         /* Trapezoidal_outer_unroll */
00232   FALSE,        /* Use_malloc */
00233   TRUE,         /* Use_parm */
00234   FALSE,        /* Verbose */
00235   TRUE,         /* Version_mp_loops */
00236   TRUE,         /* Run_vintr */
00237   TRUE,         /* Run_oinvar */
00238   1,            /* Run_doacross */
00239   0,            /* Preferred_doacross_tile_size */
00240   2600,         /* Parallel_overhead */ 
00241   FALSE,        /* Prompl */ 
00242   TRUE,         /* IfMinMax */ 
00243   FALSE,        /* Run_call_info */ 
00244   TRUE,         /* Shackle */ 
00245   FALSE,        /* Cross_loop */ 
00246   FALSE,        /* IPA array section information available */
00247   100,          /* Num_Iters */
00248   1,            /* Pure_Level */ 
00249   5,            /* Small_trip_count */
00250   (UINT32)-1,   /* Local_pad_size */
00251   0,            /* Full_unrolling */
00252   { 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0 }        /* buffer[16] */
00253 };
00254 
00255 LNO_FLAGS *Current_LNO = &Initial_LNO;
00256 MHD *Current_MHD = &Mhd_Options;
00257 
00258 /* ====================================================================
00259  * Descriptor for the -LNO option group.
00260  * ====================================================================
00261  */
00262 
00263 /* Macros for defining primary -LNO group options: */
00264 #define IL      Initial_LNO
00265 #define LNOPT_U32(name,abbr,def,lb,ub,var)      \
00266     { OVK_UINT32, OV_VISIBLE, TRUE, name, abbr, def, lb, ub, &IL.var, NULL }
00267 #define LNOPT_U32_SET(name,abbr,def,lb,ub,var,var_set)  \
00268     { OVK_UINT32, OV_VISIBLE, TRUE, name, abbr, def, lb, ub, &IL.var, &IL.var_set }
00269 #define LNOPT_BOOL(name,abbr,var)       \
00270     { OVK_BOOL, OV_VISIBLE, TRUE, name, abbr, 1, 0, 1, &IL.var, NULL }
00271 #define LNOPT_BOOL_SET(name,abbr,var,var_set)   \
00272     { OVK_BOOL, OV_VISIBLE, TRUE, name, abbr, 1, 0, 1, &IL.var, &IL.var_set }
00273 
00274 /* Macros for defining memory hierarchy -LNO group options: */
00275 #define MHO     Mhd_Options
00276 #define MHOPT_I32(name,abbr,def,lb,ub,var)      \
00277     { OVK_INT32, OV_VISIBLE, TRUE, name, abbr, def, lb, ub, &MHO.var, NULL }
00278 #define MHOPT_I32_SET(name,abbr,def,lb,ub,var,var_set)  \
00279     { OVK_INT32, OV_VISIBLE, TRUE, name, abbr, def, lb, ub, &MHO.var, &MHO.var_set }
00280 #define MHOPT_I32_DUP(name,def,lb,ub,var)       \
00281     MHOPT_I32 ( name "1", NULL, def, lb, ub, L[0].var ),        \
00282     MHOPT_I32 ( name "2", NULL, def, lb, ub, L[1].var ),        \
00283     MHOPT_I32 ( name "3", NULL, def, lb, ub, L[2].var ),        \
00284     MHOPT_I32 ( name "4", NULL, def, lb, ub, L[3].var )
00285 #define MHOPT_I32_SET_DUP(name,def,lb,ub,var,vset)      \
00286     MHOPT_I32_SET ( name "1", NULL, def, lb, ub, L[0].var, L[0].vset ), \
00287     MHOPT_I32_SET ( name "2", NULL, def, lb, ub, L[1].var, L[1].vset ), \
00288     MHOPT_I32_SET ( name "3", NULL, def, lb, ub, L[2].var, L[2].vset ), \
00289     MHOPT_I32_SET ( name "4", NULL, def, lb, ub, L[3].var, L[3].vset )
00290 #define MHOPT_NAME(name,abbr,var)       \
00291     { OVK_NAME, OV_VISIBLE, TRUE, name, abbr, 0, 0, 0, &MHO.var, NULL }
00292 #define MHOPT_NAME_DUP(name,var)        \
00293     MHOPT_NAME ( name "1", NULL, L[0].var ),    \
00294     MHOPT_NAME ( name "2", NULL, L[1].var ),    \
00295     MHOPT_NAME ( name "3", NULL, L[2].var ),    \
00296     MHOPT_NAME ( name "4", NULL, L[3].var )
00297 #define MHOPT_BOOL(name,abbr,var)       \
00298     { OVK_BOOL, OV_VISIBLE, TRUE, name, abbr, 0, 0, 1, &MHO.var, NULL }
00299 #define MHOPT_BOOL_SET(name,abbr,var,var_set)   \
00300     { OVK_BOOL, OV_VISIBLE, TRUE, name, abbr, 0, 0, 1, &MHO.var, &MHO.var_set }
00301 #define MHOPT_BOOL_DUP(name,var)        \
00302     MHOPT_BOOL ( name "1", NULL, L[0].var ),    \
00303     MHOPT_BOOL ( name "2", NULL, L[1].var ),    \
00304     MHOPT_BOOL ( name "3", NULL, L[2].var ),    \
00305     MHOPT_BOOL ( name "4", NULL, L[3].var )
00306 #define MHOPT_BOOL_SET_DUP(name,var,vset)       \
00307     MHOPT_BOOL_SET ( name "1", NULL, L[0].var, L[0].vset ),     \
00308     MHOPT_BOOL_SET ( name "2", NULL, L[1].var, L[1].vset ),     \
00309     MHOPT_BOOL_SET ( name "3", NULL, L[2].var, L[2].vset ),     \
00310     MHOPT_BOOL_SET ( name "4", NULL, L[3].var, L[3].vset )
00311 
00312 static OPTION_DESC Options_LNO[] = {
00313 
00314   LNOPT_BOOL ( "aequiv",                NULL,   Aequiv ),
00315   LNOPT_U32  ( "ap",                    NULL,   1,0,2,  Run_AP ),
00316   LNOPT_BOOL ( "apply_illegal_xform_directives", "", Ill_xform_directives ),
00317   MHOPT_I32_DUP ( "associativity",      0,0,8192,       Associativity ),
00318   MHOPT_I32_DUP (   "assoc",            0,0,8192,       Associativity ),
00319   LNOPT_BOOL ( "auto_dist",             NULL,   Autodist ),
00320   LNOPT_BOOL ( "ad",                    NULL,   Autodist ),
00321   LNOPT_BOOL ( "backward_substitution", NULL,   Backward_substitution ),
00322   LNOPT_BOOL ( "blind_loop_reversal",   NULL,   Blind_loop_reversal ),
00323   LNOPT_BOOL ( "blocking",              NULL,   Blocking ),
00324   LNOPT_U32  ( "blocking_size",         NULL,   0,0,99999, Blocking_Size ),
00325   LNOPT_BOOL ( "cache_edge_effects",    NULL,   Cache_model_edge_effects ),
00326   MHOPT_NAME_DUP ( "cache_size",        CS_string ),
00327   MHOPT_NAME_DUP (   "cs",              CS_string ),
00328   MHOPT_I32_SET_DUP ( "clean_miss_penalty",     0,0,1000000000,
00329                                         Clean_Miss_Penalty, CMP_Set ),
00330   MHOPT_I32_SET_DUP (   "cmp",          0,0,1000000000,
00331                                         Clean_Miss_Penalty, CMP_Set ),
00332   LNOPT_BOOL ( "cse",                   NULL,   Cse ),
00333   MHOPT_I32_SET_DUP ( "dirty_miss_penalty",     0,0,1000000000,
00334                                         Dirty_Miss_Penalty, DMP_Set ),
00335   MHOPT_I32_SET_DUP (   "dmp",          0,0,1000000000,
00336                                         Dirty_Miss_Penalty, DMP_Set ),
00337   LNOPT_BOOL ( "fancy_tile",            NULL,   Fancy_tile ),
00338   LNOPT_BOOL ( "ff",                    NULL,   Run_fiz_fuse ),
00339   LNOPT_U32  ( "fission",               "fis",  1,0,2,  Fission ),
00340   LNOPT_U32  ( "fission_inner_register_limit",  NULL,   32,0,99999,
00341                                         Fission_inner_register_limit ),
00342   LNOPT_BOOL ( "forward_substitution",  NULL,   Forward_substitution ),
00343   LNOPT_U32  ( "fusion",                "fus",  1,0,2,  Fusion ),
00344   LNOPT_U32  ( "fusion_peeling_limit",  NULL,   5,0,99999,
00345                                         Fusion_peeling_limit ),
00346   LNOPT_U32  ( "gather_scatter",        "gath", 1,0,100, Gather_Scatter ),
00347   LNOPT_U32  ( "gc",                    NULL,   0xfffe, 0, 0xfffe,
00348                                         Graph_capacity ),
00349   LNOPT_BOOL ( "hmb",                   NULL,   Hoist_messy_bounds ),
00350   LNOPT_BOOL ( "ignore_pragmas",        NULL,   Ignore_pragmas ),
00351   LNOPT_BOOL ( "interchange",           NULL,   Interchange ),
00352   MHOPT_BOOL_SET_DUP ( "is_memory_level",
00353                                         Is_Mem_Level, Is_Mem_Level_Set ),
00354   MHOPT_BOOL_SET_DUP (   "is_mem",      Is_Mem_Level, Is_Mem_Level_Set ),
00355   LNOPT_BOOL_SET ( "lego",              NULL,   Run_lego, Run_lego_set ),
00356   LNOPT_BOOL ( "lego_local",            NULL,   Run_lego_localizer ),
00357   MHOPT_I32_DUP ( "line_size",          0,0,8192,       Line_Size ),
00358   MHOPT_I32_DUP (   "ls",               0,0,8192,       Line_Size ),
00359   MHOPT_I32  ( "loop_overhead_base",    NULL,   1,0,1000, Loop_Overhead_Base ),
00360   MHOPT_I32  (   "lob",                 NULL,   1,0,1000, Loop_Overhead_Base ),
00361   MHOPT_I32  ( "loop_overhead_memref",  NULL,   1,0,1000,
00362                                                 Loop_Overhead_Memref ),
00363   MHOPT_I32  (   "lom",                 NULL,   1,0,1000,
00364                                                 Loop_Overhead_Memref ),
00365   LNOPT_U32  ( "max_depth",             NULL,   10,0,16,
00366                                         Max_do_loop_depth_strict ),
00367   LNOPT_BOOL ( "mem_sim",               NULL,   Mem_sim ),
00368   LNOPT_BOOL ( "minvariant",            "",     Minvar ),
00369   MHOPT_I32_SET_DUP ( "miss_penalty",   0,0,1000000000,
00370                                         Miss_Penalty, Miss_Penalty_Set ),
00371   MHOPT_I32_SET_DUP (   "mp",           0,0,1000000000,
00372                                         Miss_Penalty, Miss_Penalty_Set ),
00373   MHOPT_BOOL ( "non_blocking_loads",    NULL,   Non_Blocking_Loads ),
00374   MHOPT_BOOL (   "nbl",                 NULL,   Non_Blocking_Loads ),
00375   LNOPT_U32  ( "opt",                   NULL,   1,0,1,  Opt ),
00376   LNOPT_U32  ( "optimize_cache",        NULL,   2,0,2,  Cache_model ),
00377   LNOPT_U32  (   "optc",                NULL,   2,0,2,  Cache_model ),
00378   LNOPT_BOOL ( "outer",                 NULL,   Run_outer ),
00379   LNOPT_U32  ( "outer_unroll",          NULL,   0,1,32, Outer_unroll ),
00380   LNOPT_U32  (   "ou",                  NULL,   0,1,32, Outer_unroll ),
00381   LNOPT_BOOL ( "outer_unroll_deep",     NULL,   Outer_unroll_deep ),
00382   LNOPT_BOOL (   "ou_deep",             NULL,   Outer_unroll_deep ),
00383   LNOPT_U32  ( "outer_unroll_further",  NULL,   6,0,99999,
00384                                         Outer_unroll_min_for_further_unroll ),
00385   LNOPT_U32  (   "ou_further",          NULL,   6,0,99999,
00386                                         Outer_unroll_min_for_further_unroll ),
00387   LNOPT_U32  ( "outer_unroll_max",      NULL,   0,1,32, Outer_unroll_max ),
00388   LNOPT_U32  (   "ou_max",              NULL,   0,1,32, Outer_unroll_max ),
00389   LNOPT_BOOL ( "outer_unroll_model_only", NULL, Outer_unroll_model_only ),
00390   LNOPT_BOOL (   "ou_model_only",       NULL,   Outer_unroll_model_only ),
00391   LNOPT_U32  ( "outer_unroll_prod_max", NULL,   0,1,64, Outer_unroll_prod_max ),
00392   LNOPT_U32  (   "ou_prod_max",         NULL,   0,1,64, Outer_unroll_prod_max ),
00393   LNOPT_BOOL ( "outer_unroll_unity",    NULL,   Outer_unroll_unity ),
00394   LNOPT_BOOL (   "ou_unity",            NULL,   Outer_unroll_unity ),
00395   LNOPT_U32 (   "ou_aggre",             NULL,   2,0,3,  Outer_unroll_aggre ),
00396   LNOPT_U32  ( "p3",                    NULL,   0,0,2,  Run_p3 ),
00397   MHOPT_I32_DUP ( "page_size",          0,0,8192,       Page_Size ),
00398   MHOPT_I32_DUP (   "ps",               0,0,8192,       Page_Size ),
00399   MHOPT_I32_DUP ( "pct_xwrites_nonhidable", 0,0,100,
00400                                         Pct_Excess_Writes_Nonhidable ),
00401   MHOPT_I32_DUP (   "xwn",              0,0,100,
00402                                         Pct_Excess_Writes_Nonhidable ),
00403   LNOPT_BOOL (   "plower",              NULL,   Pseudo_lower ),
00404   LNOPT_BOOL (   "plower_mp",           NULL,   Pseudo_lower ),
00405   LNOPT_U32_SET  ( "prefetch",          "pref", 0,0,2,  Run_prefetch,
00406                                         Run_prefetch_set ),
00407   LNOPT_U32  ( "prefetch_ahead",        NULL,   2,0,50, Prefetch_ahead ),
00408   LNOPT_U32  (   "pf_ahead",            NULL,   2,0,50, Prefetch_ahead ),
00409   LNOPT_U32  ( "prefetch_iters_ahead",  NULL,   2,0,50, Prefetch_iters_ahead ),
00410   LNOPT_U32  (   "pf_it_ahead",         NULL,   2,0,50, Prefetch_iters_ahead ),
00411   LNOPT_U32  ( "prefetch_cache_factor", NULL,   1,1,50, Prefetch_cache_factor),
00412   LNOPT_U32  (   "pf_cf",               NULL,   1,1,50, Prefetch_cache_factor),
00413   LNOPT_BOOL ( "prefetch_indirect",     "",     Prefetch_indirect ),
00414   MHOPT_BOOL_DUP ( "prefetch_level",    Prefetch_Level ),
00415   MHOPT_BOOL_DUP ( "pf",                Prefetch_Level ),
00416   LNOPT_BOOL_SET ( "prefetch_manual",   "",     Run_prefetch_manual,
00417                                         Run_prefetch_manual_set ),
00418   LNOPT_BOOL_SET (   "pf_manual",       NULL,   Run_prefetch_manual,
00419                                         Run_prefetch_manual_set ),
00420   LNOPT_BOOL ( "pwr2",                  NULL,   Power_of_two_hack ),
00421   LNOPT_BOOL ( "sclrze",                NULL,   Sclrze ),
00422   LNOPT_U32  ( "se_tile_size",          NULL,   0,0,99999, SE_tile_size ),
00423   LNOPT_U32  ( "split_tile",            NULL,   1,0,2,  Split_tiles ),
00424   LNOPT_U32  ( "split_tile_size",       NULL,   0,0,99999, Split_tiles_size ),
00425   LNOPT_BOOL ( "test",                  NULL,   Run_test ),
00426   LNOPT_BOOL ( "testdump",              NULL,   Test_dump ),
00427   MHOPT_I32_SET_DUP ( "tlb_clean_miss_penalty", 0,0,1000000000,
00428                                         TLB_Clean_Miss_Penalty, TLB_CMP_Set ),
00429   MHOPT_I32_SET_DUP (   "tlbcmp",       0,0,1000000000,
00430                                         TLB_Clean_Miss_Penalty, TLB_CMP_Set ),
00431   MHOPT_I32_SET_DUP ( "tlb_dirty_miss_penalty", 0,0,1000000000,
00432                                         TLB_Dirty_Miss_Penalty, TLB_DMP_Set ),
00433   MHOPT_I32_SET_DUP (   "tlbdmp",       0,0,1000000000,
00434                                         TLB_Dirty_Miss_Penalty, TLB_DMP_Set ),
00435   MHOPT_I32_DUP ( "tlb_entries",        0,0,8192,       TLB_Entries ),
00436   MHOPT_I32_DUP (   "tlb",              0,0,8192,       TLB_Entries ),
00437   MHOPT_I32_SET_DUP ( "tlb_miss_penalty",       0,0,1000000000,
00438                                         TLB_Miss_Penalty, TLB_MP_Set ),
00439   MHOPT_I32_SET_DUP (   "tlbmp",        0,0,1000000000,
00440                                         TLB_Miss_Penalty, TLB_MP_Set ),
00441   MHOPT_BOOL ( "tlb_noblocking_model",  NULL,   TLB_NoBlocking_Model ),
00442   MHOPT_I32  ( "tlb_trustworthiness",   NULL,   1,0,1000,
00443                                         TLB_Trustworthiness ),
00444   LNOPT_BOOL ( "trapezoidal_outer_unroll", NULL,
00445                                         Trapezoidal_outer_unroll ),
00446   LNOPT_BOOL ( "use_malloc",            NULL,   Use_malloc ),
00447   LNOPT_BOOL ( "use_parm",              NULL,   Use_parm ),
00448   LNOPT_BOOL ( "version_mp_loops",      NULL,   Version_mp_loops ),
00449   LNOPT_BOOL ( "vintr",                 NULL,   Run_vintr ),
00450   LNOPT_BOOL ( "oinvar",                NULL,   Run_oinvar ),
00451   LNOPT_U32  ( "doacross",              NULL,   1,0,4,Run_doacross),
00452   LNOPT_U32  ( "preferred_doacross_tile_size",
00453                                         NULL,   0,0,999999,
00454                                         Preferred_doacross_tile_size ),
00455   LNOPT_U32  ( "parallel_overhead",     NULL,   2600,0,0x7fffffff, 
00456                                         Parallel_overhead), 
00457   LNOPT_BOOL ( "prompl",                NULL,   Prompl ), 
00458   LNOPT_BOOL ( "ifminmax",              NULL,   IfMinMax ), 
00459   LNOPT_BOOL ( "call_info",             NULL,   Run_call_info ), 
00460   LNOPT_BOOL ( "loop_finalize",         NULL,   Loop_finalization),
00461   LNOPT_BOOL ( "shackle",               NULL,   Shackle),
00462   LNOPT_BOOL ( "cross_loop",            NULL,   Cross_loop),
00463   LNOPT_BOOL ( "ipa",                   NULL,   IPA_Enabled),
00464   LNOPT_U32  ( "num_iters",             NULL,   100,0,UINT32_MAX,Num_Iters),
00465   LNOPT_U32  ( "pure",                  NULL,   1,0,2,Pure_Level),
00466   LNOPT_U32  ( "small_trip_count",      NULL,   5,0,10,Small_trip_count),
00467   LNOPT_U32  ( "local_pad_size",        NULL,   0,0,1000,Local_pad_size),
00468   LNOPT_U32  ( "full_unroll",           "fu",   0,0,100,Full_unrolling),
00469 
00470   { OVK_COUNT }             /* List terminator -- must be last */
00471 };
00472 
00473 #undef IL
00474 
00475 /* ====================================================================
00476  *
00477  * LNO_Init_Config
00478  *
00479  * Initialize the current top of stack to defaults, by copying the
00480  * Default_LNO struct to it.  Be careful not to lose the next
00481  * pointer.
00482  *
00483  * WARNING:  We are always picking up the default Mhd_Options struct
00484  * here.
00485  *
00486  * ====================================================================
00487  */
00488 
00489 void
00490 LNO_Init_Config ( void )
00491 {
00492   LNO_FLAGS *next = LNO_FLAGS_next(Current_LNO);
00493 
00494   *Current_LNO = Default_LNO;
00495   LNO_FLAGS_next(Current_LNO) = next;
00496   LNO_FLAGS_mhd (Current_LNO) = &Mhd_Options;
00497 }
00498 
00499 /* ====================================================================
00500  *
00501  * LNO_Push_Config
00502  *
00503  * Push a new struct on top of stack, either a copy of the current
00504  * TOS, or the defaults.
00505  *
00506  * TODO:  To make the option group printing functionality work once the
00507  * configuration structs start changing, this function must also update
00508  * the addresses in the group descriptor to point to the current
00509  * top-of-stack structure.
00510  *
00511  * ====================================================================
00512  */
00513 
00514 void
00515 LNO_Push_Config ( BOOL use_default )
00516 {
00517   LNO_FLAGS *new_flags =
00518         (LNO_FLAGS *) malloc ( sizeof(LNO_FLAGS) );
00519 
00520   if ( new_flags == NULL ) {
00521     ErrMsg ( EC_No_Mem, "LNO_Push" );
00522   }
00523 
00524   *new_flags = use_default ? Default_LNO : *Current_LNO;
00525   LNO_FLAGS_next(new_flags) = Current_LNO;
00526   LNO_FLAGS_mhd (new_flags) = &Mhd_Options;
00527   Current_LNO = new_flags;
00528 }
00529 
00530 
00531 
00532 /* ====================================================================
00533  *
00534  * LNO_Pop_Config
00535  *
00536  * Pop a struct from top of stack and return TRUE if the old TOS was
00537  * not the original TOS, or do nothing and return FALSE.
00538  *
00539  * TODO:  To make the option group printing functionality work once the
00540  * configuration structs start changing, this function must also update
00541  * the addresses in the group descriptor to point to the current
00542  * top-of-stack structure.
00543  *
00544  * ====================================================================
00545  */
00546 
00547 BOOL
00548 LNO_Pop_Config ( void )
00549 {
00550   if ( Current_LNO->next == NULL ) {
00551     /* This is the bottom of the stack: */
00552     return FALSE;
00553   } else {
00554     /* Deallocate the top element and pop it: */
00555     LNO_FLAGS *new_flags = LNO_FLAGS_next(Current_LNO);
00556     free ( Current_LNO );
00557     Current_LNO = new_flags;
00558     return TRUE;
00559   }
00560 }
00561 
00562 /* ====================================================================
00563  *
00564  * LNO_Configure
00565  *
00566  * Configure the current top of stack struct.
00567  *
00568  * ====================================================================
00569  */
00570 
00571 void
00572 LNO_Configure ( void )
00573 {
00574   INT i;
00575 
00576 #ifdef COMPILER_LICENSING
00577   /* check licensing for automatic parallelization */
00578   if (Run_autopar) {
00579      get_license("auto_pp", FALSE, TRUE);  /* soft licensing == FALSE; tier licensing == TRUE */
00580   }
00581 #endif
00582 
00583   /* This option is actually a trace flag: */
00584   LNO_Verbose = Get_Trace ( TP_LNOPT, 0x0004 );
00585 
00586   /* Unrolling: of LNO_Outer_Unroll, LNO_Outer_Unroll_Max, and
00587    * LNO_Outer_Unroll_Prod_Max, only the first OR either or both of the
00588    * last two may be non-zero (i.e. meaningful).
00589    */
00590   if ( LNO_Outer_Unroll != 0 && LNO_Outer_Unroll_Max != 0 ) {
00591     ErrMsg ( EC_Opt_Conflict, "-LNO:outer_unroll",
00592              "-LNO:outer_unroll_max", "-LNO:outer_unroll" );
00593     LNO_Outer_Unroll_Max = 0;
00594   }
00595   if ( LNO_Outer_Unroll != 0 && LNO_Outer_Unroll_Prod_Max != 0 ) {
00596     ErrMsg ( EC_Opt_Conflict, "-LNO:outer_unroll",
00597              "-LNO:outer_unroll_prod_max", "-LNO:outer_unroll" );
00598     LNO_Outer_Unroll_Prod_Max = 0;
00599   }
00600   if ( LNO_Outer_Unroll == 0
00601     && LNO_Outer_Unroll_Max == 0
00602     && LNO_Outer_Unroll_Prod_Max == 0 )
00603   {
00604     LNO_Outer_Unroll_Prod_Max = DEFAULT_UNROLL_PROD_MAX;
00605   }
00606   if ( LNO_Outer_Unroll == 0 && LNO_Outer_Unroll_Max == 0 ) {
00607     LNO_Outer_Unroll_Max = DEFAULT_UNROLL_MAX;
00608   }
00609 
00610   /* Cache parameters */
00611 
00612   for ( i = 0; i < 4; i++ ) {
00613     if ( Mhd_Options.L[i].CS_string != NULL
00614       && ! Atoi_KMG ( Mhd_Options.L[i].CS_string,
00615                       &Mhd_Options.L[i].Size, TRUE ) )
00616     {
00617       char buffer[256];
00618 
00619       sprintf ( buffer, "-LNO:cache_size%d=%s",
00620                 i, Mhd_Options.L[i].CS_string );
00621       ErrMsg ( EC_Inv_Opt_Val, buffer );
00622       Mhd_Options.L[i].Size = 0;
00623     }
00624 
00625     if ( Mhd_Options.L[i].Is_Mem_Level == 1)
00626       Mhd_Options.L[i].Type = MHD_TYPE_MEM;
00627     else if ( Mhd_Options.L[i].Is_Mem_Level == 0 )
00628       Mhd_Options.L[i].Type = MHD_TYPE_CACHE;
00629 
00630     if ( Mhd_Options.L[i].Miss_Penalty_Set ) {
00631       if ( Mhd_Options.L[i].CMP_Set ) {
00632         ErrMsg ( EC_Opt_Conflict, "-LNO:miss_penalty",
00633                  "-LNO:clean_miss_penalty", "-LNO:miss_penalty" );
00634       }
00635       if ( Mhd_Options.L[i].DMP_Set ) {
00636         ErrMsg ( EC_Opt_Conflict, "-LNO:miss_penalty",
00637                  "-LNO:dirty_miss_penalty", "-LNO:miss_penalty" );
00638       }
00639       Mhd_Options.L[i].Clean_Miss_Penalty = Mhd_Options.L[i].Miss_Penalty;
00640       Mhd_Options.L[i].Dirty_Miss_Penalty = Mhd_Options.L[i].Miss_Penalty;
00641     }
00642     if (Mhd_Options.L[i].TLB_Miss_Penalty != -1) {
00643       if ( Mhd_Options.L[i].TLB_CMP_Set ) {
00644         ErrMsg ( EC_Opt_Conflict, "-LNO:tlb_miss_penalty",
00645                  "-LNO:tlb_clean_miss_penalty", "-LNO:tlb_miss_penalty" );
00646       }
00647       if ( Mhd_Options.L[i].TLB_DMP_Set ) {
00648         ErrMsg ( EC_Opt_Conflict, "-LNO:tlb_miss_penalty",
00649                  "-LNO:tlb_dirty_miss_penalty", "-LNO:tlb_miss_penalty" );
00650       }
00651       Mhd_Options.L[i].TLB_Clean_Miss_Penalty =
00652                         Mhd_Options.L[i].TLB_Miss_Penalty;
00653       Mhd_Options.L[i].TLB_Dirty_Miss_Penalty =
00654                         Mhd_Options.L[i].TLB_Miss_Penalty;
00655     }
00656   }
00657 }
00658 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines