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
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064 #include "config_ipa.h"
00065
00066
00067 char *Ipa_File_Name = NULL;
00068 char *Feedback_Filename = NULL;
00069 char *Annotation_Filename = NULL;
00070 FILE *Ipa_File = NULL;
00071
00072
00073 typedef struct skiplist SKIPLIST;
00074 SKIPLIST *Build_Skiplist ( OPTION_LIST *olist );
00075
00076
00077
00078
00079
00080
00081 #ifdef KEY
00082 const float DEFAULT_MIN_PROBABILITY = 0.20;
00083 #endif
00084
00085 #define DEFAULT_BLOAT_FACTOR 100
00086 #define DEFAULT_PU_LIMIT 2500
00087 #define DEFAULT_HARD_LIMIT (2500 + (2500 >> 2))
00088 #define DEFAULT_SMALL_PU 30
00089 #define DEFAULT_SMALL_CALLEE 500
00090 #define DEFAULT_MIN_FREQ 100
00091 #define DEFAULT_MIN_HOTNESS 10
00092 #define DEFAULT_RELA_FREQ 50
00093 #define DEFAULT_INLINE_Max_Pu_Size 5000
00094 #define DEFAULT_CLONE_BLOAT_FACTOR 100
00095 #define DEFAULT_EXTGOT_FACTOR 200
00096 #define DEFAULT_NUM_FORTRAN_INTR 100
00097 #define DEFAULT_MAP_LIMIT 0x1fff0000
00098
00099
00100
00101
00102
00103 #define DEFAULT_OUTPUT_FILE_SIZE 10000
00104
00105 #define DEFAULT_MAX_DENSITY 11 // INLINING_TUNINING
00106
00107 #ifdef KEY
00108 #define DEFAULT_ICALL_MIN_FREQ 200
00109 #endif
00110
00111
00112
00113
00114
00115 BOOL IPA_Enable_DFE = TRUE;
00116 BOOL IPA_Enable_DFE_Set = FALSE;
00117 BOOL IPA_Enable_Inline = TRUE;
00118 BOOL IPA_Enable_Picopt = TRUE;
00119 BOOL IPA_Enable_AutoGnum = TRUE;
00120 BOOL IPA_Enable_Opt_Alias =FALSE;
00121 BOOL IPA_Enable_Simple_Alias = TRUE;
00122 BOOL IPA_Enable_Addressing = TRUE;
00123 BOOL IPA_Enable_BarrierFarg = FALSE;
00124 BOOL IPA_Enable_Alias_Class = TRUE;
00125 BOOL IPA_Debug_AC_Temp_Files = FALSE;
00126 BOOL IPA_Enable_Readonly_Ref = TRUE;
00127 BOOL IPA_Enable_Cprop = TRUE;
00128 BOOL IPA_Enable_Cprop2 = TRUE;
00129 BOOL IPA_Enable_Assert = FALSE;
00130
00131 BOOL IPA_Enable_daVinci = FALSE;
00132 BOOL IPA_Enable_ipacom = TRUE;
00133 BOOL IPA_Enable_final_link = TRUE;
00134 BOOL IPA_Enable_Memtrace = FALSE;
00135 BOOL IPA_Enable_DST = TRUE;
00136 BOOL IPA_Enable_DCE = TRUE;
00137 BOOL IPA_Enable_Exc = TRUE;
00138 BOOL IPA_Enable_Recycle = TRUE;
00139 BOOL IPA_Enable_DVE = TRUE;
00140 BOOL IPA_Enable_CGI = TRUE;
00141
00142 BOOL IPA_Enable_Copy_Prop = TRUE;
00143 BOOL IPA_Enable_Padding = TRUE;
00144
00145 UINT32 IPA_Common_Pad_Size = 0;
00146
00147 BOOL IPA_Enable_Cloning = TRUE;
00148
00149 BOOL IPA_Enable_Lang = FALSE;
00150 BOOL IPA_Enable_Relocatable_Opt = FALSE;
00151 BOOL IPA_Enable_Split_Common = TRUE;
00152 BOOL IPA_Enable_Array_Sections = TRUE;
00153 BOOL IPA_Enable_Array_Summary = FALSE;
00154
00155 BOOL IPA_Enable_Scalar_Euse = FALSE;
00156 BOOL IPA_Enable_Scalar_Kill = FALSE;
00157 BOOL IPA_Enable_Common_Const = TRUE;
00158 BOOL IPA_Enable_Feedback = FALSE;
00159
00160
00161 BOOL IPA_Echo_Commands = FALSE;
00162
00163
00164 UINT32 IPA_Bloat_Factor = DEFAULT_BLOAT_FACTOR;
00165 BOOL IPA_Bloat_Factor_Set = FALSE;
00166
00167 #ifdef KEY
00168 float IPA_Min_Branch_Prob = DEFAULT_MIN_PROBABILITY;
00169 #endif
00170 UINT32 IPA_PU_Limit = DEFAULT_PU_LIMIT;
00171 BOOL IPA_PU_Limit_Set = FALSE;
00172
00173
00174 UINT32 IPA_PU_Hard_Limit = DEFAULT_HARD_LIMIT;
00175 BOOL IPA_PU_Hard_Limit_Set = FALSE;
00176
00177
00178 UINT32 IPA_PU_Minimum_Size = DEFAULT_SMALL_PU;
00179
00180
00181 UINT32 IPA_Small_Callee_Limit = DEFAULT_SMALL_CALLEE;
00182
00183 UINT32 IPA_Max_Depth = UINT32_MAX;
00184 UINT32 IPA_Force_Depth = 0;
00185
00186 BOOL IPA_Force_Depth_Set = FALSE;
00187 BOOL IPA_Enable_Merge_ty = TRUE;
00188
00189 #ifdef KEY
00190 UINT32 IPA_Max_Jobs = 1;
00191 #else
00192 UINT32 IPA_Max_Jobs = 0;
00193 #endif
00194 BOOL IPA_Max_Jobs_Set = FALSE;
00195
00196
00197 UINT32 IPA_Min_Freq = DEFAULT_MIN_FREQ;
00198
00199
00200
00201 UINT32 IPA_Max_Density = DEFAULT_MAX_DENSITY;
00202
00203
00204 UINT32 IPA_Rela_Freq = DEFAULT_RELA_FREQ;
00205
00206
00207 UINT32 IPA_Min_Hotness = DEFAULT_MIN_HOTNESS;
00208
00209
00210 BOOL IPA_Use_Effective_Size = TRUE;
00211
00212
00213 UINT32 IPA_Gspace = DEFAULT_GSPACE - 72;
00214
00215
00216 UINT32 IPA_Extgot_Factor = 0;
00217
00218
00219
00220 UINT32 IPA_Num_Fortran_Intrinsics = DEFAULT_NUM_FORTRAN_INTR;
00221 BOOL IPA_Has_Fortran = FALSE;
00222
00223
00224 UINT32 IPA_user_gnum = 0;
00225
00226 OPTION_LIST *IPA_Skip = NULL;
00227 BOOL IPA_Skip_Report = FALSE;
00228
00229 BOOL IPA_Enable_Preempt = FALSE;
00230
00231
00232 BOOL IPA_Enable_Flow_Analysis = TRUE;
00233
00234
00235
00236
00237 UINT32 IPA_Map_Limit = DEFAULT_MAP_LIMIT;
00238
00239 BOOL IPA_Enable_SP_Partition = FALSE;
00240
00241
00242
00243 BOOL IPA_Enable_GP_Partition = FALSE;
00244
00245
00246
00247 BOOL IPA_Space_Access_Mode = DEFAULT_ACCESS_MODE;
00248
00249 BOOL IPA_Enable_Keeplight = TRUE;
00250
00251
00252
00253 #ifdef KEY
00254 BOOL IPA_Enable_Icall_Opt = TRUE;
00255 BOOL IPA_Enable_EH_Region_Removal = FALSE;
00256 BOOL IPA_Enable_Branch_Heuristic = FALSE;
00257 BOOL IPA_Check_Options = TRUE;
00258 BOOL IPA_Clone_List_Actions = FALSE;
00259 BOOL IPA_Enable_Pure_Call_Opt = FALSE;
00260 INT32 IPA_Pure_Call_skip_before = 0;
00261
00262 BOOL IPA_Enable_Cord = FALSE;
00263
00264 PU_REORDER_SCHEME IPA_Enable_PU_Reorder = REORDER_DISABLE;
00265 BOOL IPA_Enable_PU_Reorder_Set = FALSE;
00266 BOOL IPA_Enable_Ctype = FALSE;
00267 BOOL IPA_Consult_Inliner_For_Icall_Opt = TRUE;
00268
00269 UINT32 IPA_Icall_Min_Freq = DEFAULT_ICALL_MIN_FREQ;
00270
00271 BOOL IPA_Enable_Source_PU_Order = FALSE;
00272 #ifdef TARG_X8664
00273 UINT32 IPA_Enable_Struct_Opt = 1;
00274 #else
00275 UINT32 IPA_Enable_Struct_Opt = 0;
00276 #endif
00277 UINT32 IPA_Update_Struct = 0;
00278 #else
00279 BOOL IPA_Enable_Cord = TRUE;
00280 #endif
00281 BOOL IPA_Enable_Linearization = FALSE;
00282 BOOL IPA_Use_Intrinsic = FALSE;
00283
00284 BOOL IPA_Enable_Inline_Nested_PU = TRUE;
00285
00286 BOOL IPA_Enable_Reshape = TRUE;
00287 BOOL IPA_Enable_Inline_Struct = TRUE;
00288 BOOL IPA_Enable_Inline_Char_Array = TRUE;
00289 BOOL IPA_Enable_Inline_Optional_Arg = TRUE;
00290 BOOL IPA_Enable_Inline_Struct_Array_Actual = TRUE;
00291 BOOL IPA_Enable_Inline_Var_Dim_Array = TRUE;
00292 BOOL IPA_Enable_Reorder=FALSE;
00293
00294
00295 BOOL IPA_Enable_Preopt = FALSE;
00296 BOOL IPA_Enable_Preopt_Set = FALSE;
00297
00298
00299 UINT32 IPA_Max_Node_Clones = 0;
00300 BOOL IPA_Max_Node_Clones_Set = FALSE;
00301
00302
00303 UINT32 IPA_Max_Clone_Bloat = DEFAULT_CLONE_BLOAT_FACTOR;
00304
00305
00306 UINT32 IPA_Max_Output_File_Size = DEFAULT_OUTPUT_FILE_SIZE;
00307
00308
00309 INT32 IPA_Output_File_Size = 0;
00310
00311
00312 #if !defined(TARG_SL)
00313 BOOL IPA_Enable_Old_Type_Merge = FALSE;
00314 #else
00315 BOOL IPA_Enable_Old_Type_Merge = TRUE;
00316 #endif
00317
00318
00319 BOOL IPA_Enable_Devirtualization = FALSE;
00320
00321 static OPTION_DESC Options_IPA[] = {
00322 { OVK_BOOL, OV_VISIBLE, FALSE, "addressing", "",
00323 0, 0, 0, &IPA_Enable_Addressing, NULL,
00324 "Enable address-taken analysis" },
00325 { OVK_BOOL, OV_VISIBLE, FALSE, "readonly_parameter", "",
00326 0, 0, 0, &IPA_Enable_Readonly_Ref, NULL,
00327 "Enable identification of read-only reference parameters" },
00328 { OVK_BOOL, OV_VISIBLE, FALSE, "aggr_cprop", "",
00329 0, 0, 0, &IPA_Enable_Cprop2, NULL,
00330 "Enable aggressive constant propagation" },
00331 { OVK_BOOL, OV_VISIBLE, FALSE, "alias", "",
00332 0, 0, 0, &IPA_Enable_Simple_Alias,NULL,
00333 "Enable variable mod, use, and alias analysis" },
00334 { OVK_BOOL, OV_INTERNAL, FALSE, "array_section", "",
00335 0, 0, 0, &IPA_Enable_Array_Sections, NULL,
00336 "Enable interprocedural array section analysis " },
00337 { OVK_BOOL, OV_INTERNAL, FALSE, "array_summary", "",
00338 0, 0, 0, &IPA_Enable_Array_Summary, NULL,
00339 "Enable local array section summary" },
00340 { OVK_BOOL, OV_INTERNAL, FALSE, "scalar_kill", "",
00341 0, 0, 0, &IPA_Enable_Scalar_Kill, NULL,
00342 "Enable scalar kill analysis" },
00343 { OVK_BOOL, OV_INTERNAL, FALSE, "scalar_euse", "",
00344 0, 0, 0, &IPA_Enable_Scalar_Euse, NULL,
00345 "Enable scalar euse analysis" },
00346 { OVK_BOOL, OV_VISIBLE, FALSE, "common_cprop", "",
00347 0, 0, 0, &IPA_Enable_Common_Const, NULL,
00348 "Enable common constant propagation" },
00349 { OVK_BOOL, OV_VISIBLE, FALSE, "autognum", "",
00350 0, 0, 0, &IPA_Enable_AutoGnum, NULL,
00351 "Enable automatic gp-relative data allocation" },
00352 { OVK_BOOL, OV_INTERNAL, FALSE, "barrier_aliasfarg", "",
00353 0, 0, 0, &IPA_Enable_BarrierFarg, NULL,
00354
00355
00356
00357
00358 "Enable barrier gen. " },
00359 { OVK_BOOL, OV_VISIBLE, FALSE, "cgi", "",
00360 0, 0, 0, &IPA_Enable_CGI, NULL,
00361 "Enable constant global variable identification" },
00362 { OVK_BOOL, OV_SHY, FALSE, "compile", "",
00363 0, 0, 0, &IPA_Enable_ipacom, NULL,
00364 "Enable final back-end compilation" },
00365 { OVK_BOOL, OV_SHY, FALSE, "link", "",
00366 0, 0, 0, &IPA_Enable_final_link, NULL,
00367 "Enable final link step" },
00368 { OVK_BOOL, OV_VISIBLE, FALSE, "copy_prop", "",
00369 0, 0, 0, &IPA_Enable_Copy_Prop, NULL,
00370 "Enable interprocedural copy propagation" },
00371 { OVK_BOOL, OV_VISIBLE, FALSE, "cprop", "",
00372 0, 0, 0, &IPA_Enable_Cprop, NULL,
00373 "Enable constant propagation" },
00374 { OVK_BOOL, OV_INTERNAL, FALSE, "assert", "",
00375 0, 0, 0, &IPA_Enable_Assert, NULL,
00376 "Enable assertion for constant propagation" },
00377 { OVK_BOOL, OV_VISIBLE, FALSE, "clone", "",
00378 0, 0, 0, &IPA_Enable_Cloning, NULL,
00379 "Enable subprogram cloning" },
00380 { OVK_UINT32, OV_INTERNAL, FALSE, "multi_clone", "",
00381 0, 0, UINT32_MAX, &IPA_Max_Node_Clones, &IPA_Max_Node_Clones_Set,
00382 "Maximum clones per call graph node" },
00383 { OVK_UINT32, OV_INTERNAL, FALSE, "node_bloat", "",
00384 DEFAULT_CLONE_BLOAT_FACTOR, 0, UINT32_MAX, &IPA_Max_Clone_Bloat,NULL,
00385 "Maximum call graph bloat with cloning" },
00386 { OVK_BOOL, OV_VISIBLE, FALSE, "dce", "",
00387 0, 0, 0, &IPA_Enable_DCE, NULL,
00388 "Enable dead code elimination" },
00389 { OVK_BOOL, OV_VISIBLE, FALSE, "dve", "",
00390 0, 0, 0, &IPA_Enable_DVE, NULL,
00391 "Enable dead variable elimination" },
00392 { OVK_UINT32,OV_VISIBLE, FALSE, "depth", "",
00393 UINT32_MAX, 0, UINT32_MAX,&IPA_Max_Depth, NULL,
00394 "Limit inlining depth" },
00395 { OVK_UINT32,OV_VISIBLE, FALSE, "maxdepth", "",
00396 UINT32_MAX, 0, UINT32_MAX,&IPA_Max_Depth, NULL,
00397 "Limit inlining depth" },
00398 { OVK_UINT32,OV_VISIBLE, FALSE, "forcedepth", "",
00399 UINT32_MAX, 0, UINT32_MAX, &IPA_Force_Depth, &IPA_Force_Depth_Set,
00400 "Inline to at least this depth" },
00401 { OVK_BOOL, OV_VISIBLE, FALSE, "dfe", "",
00402 0, 0, 0, &IPA_Enable_DFE, &IPA_Enable_DFE_Set,
00403 "Enable dead function elimination" },
00404 { OVK_BOOL, OV_INTERNAL, FALSE, "dst", "",
00405 0, 0, 0, &IPA_Enable_DST, NULL},
00406 { OVK_BOOL, OV_VISIBLE, FALSE, "echo_commands", "",
00407 0, 0, 0, &IPA_Echo_Commands, NULL,
00408 "Echo back end compilation commands" },
00409 { OVK_BOOL, OV_INTERNAL, FALSE, "exc", "",
00410 0, 0, 0, &IPA_Enable_Exc, NULL},
00411 { OVK_BOOL, OV_INTERNAL, FALSE, "flow_analysis", "",
00412 0, 0, 0, &IPA_Enable_Flow_Analysis, NULL},
00413 { OVK_BOOL, OV_INTERNAL, FALSE, "gp_partition", "",
00414 0, 0, 0, &IPA_Enable_GP_Partition, NULL},
00415 { OVK_BOOL, OV_INTERNAL, FALSE, "graph", "",
00416 0, 0, 0, &IPA_Enable_daVinci, NULL,
00417 "Generate call-graph display" },
00418 { OVK_UINT32,OV_VISIBLE, FALSE, "Gspace", "",
00419 DEFAULT_GSPACE, 0, DEFAULT_GSPACE, &IPA_Gspace, NULL},
00420 { OVK_UINT32,OV_VISIBLE, FALSE, "Gnum", "",
00421 DEFAULT_GSPACE, 0, DEFAULT_GSPACE, &IPA_user_gnum, NULL,
00422 "Specific size limit for data in gp-relative space" },
00423 { OVK_UINT32,OV_INTERNAL, FALSE, "Gfactor", "",
00424 DEFAULT_EXTGOT_FACTOR, 0, UINT32_MAX, &IPA_Extgot_Factor, NULL,
00425 "Percentage used to multiply the number of External GOTs, for AutoGnum purpose" },
00426 { OVK_UINT32,OV_VISIBLE, FALSE, "hard_plimit", "",
00427 DEFAULT_HARD_LIMIT, 0, UINT32_MAX,
00428 &IPA_PU_Hard_Limit, &IPA_PU_Hard_Limit_Set },
00429 { OVK_BOOL, OV_SHY, FALSE, "ignore_lang", "",
00430 0, 0, 0, &IPA_Enable_Lang, NULL},
00431 { OVK_BOOL, OV_VISIBLE, FALSE, "inline", "",
00432 0, 0, 0, &IPA_Enable_Inline, NULL,
00433 "Enable subprogram inlining" },
00434 { OVK_NAME, OV_INTERNAL, FALSE, "ipaa_summary_file", "",
00435 0, 0, 0, &Ipa_File_Name, NULL,
00436 "File name for IP alias analysis summary" },
00437 { OVK_UINT32,OV_INTERNAL, FALSE, "intrinsics", "intr",
00438 DEFAULT_NUM_FORTRAN_INTR, 0, UINT32_MAX,
00439 &IPA_Num_Fortran_Intrinsics, NULL,
00440 "Number of FORTRAN intrinsics used" },
00441 { OVK_BOOL, OV_INTERNAL, FALSE, "keeplight", "",
00442 0, 0, 0, &IPA_Enable_Keeplight, NULL},
00443 { OVK_UINT32,OV_INTERNAL, FALSE, "map_limit", "",
00444 DEFAULT_MAP_LIMIT, 0, UINT32_MAX, &IPA_Map_Limit, NULL},
00445 { OVK_UINT32,OV_VISIBLE, FALSE, "max_jobs", "",
00446 1, 0, UINT32_MAX, &IPA_Max_Jobs, &IPA_Max_Jobs_Set,
00447 "Maximum number of concurrent back-end jobs" },
00448 { OVK_BOOL, OV_INTERNAL, FALSE, "merge_ty", "",
00449 0, 0, 0, &IPA_Enable_Merge_ty, NULL},
00450 { OVK_BOOL, OV_INTERNAL, FALSE, "use_effective_size", "",
00451 0, 0, 0, &IPA_Use_Effective_Size, NULL},
00452 { OVK_OBSOLETE,OV_INTERNAL, FALSE, "min_freq", "",
00453 DEFAULT_MIN_FREQ, 0, 10000, &IPA_Min_Freq, NULL},
00454 { OVK_UINT32,OV_SHY, FALSE, "min_hotness", "",
00455 DEFAULT_MIN_HOTNESS, 0, UINT32_MAX, &IPA_Min_Hotness, NULL},
00456 { OVK_UINT32,OV_SHY, FALSE, "max_density", "",
00457 DEFAULT_MAX_DENSITY, 0, UINT32_MAX, &IPA_Max_Density, NULL},
00458 { OVK_BOOL, OV_INTERNAL, FALSE, "reshape", "",
00459 0, 0, 0, &IPA_Enable_Reshape, NULL,
00460 "Reshape analysis for IPA" },
00461 { OVK_BOOL, OV_INTERNAL, FALSE, "opt_alias", "",
00462 0, 0, 0, &IPA_Enable_Opt_Alias, NULL,
00463 "Use IPA alias information in WOPT" },
00464 { OVK_BOOL, OV_INTERNAL, FALSE, "pad", "",
00465 0, 0, 0, &IPA_Enable_Padding, NULL,
00466 "Enable padding of common block arrays"},
00467 { OVK_UINT32, OV_INTERNAL, FALSE, "common_pad_size", "",
00468 0, 1, 1000, &IPA_Common_Pad_Size, NULL,
00469 "Amount by which to pad common block array dimensions" },
00470 { OVK_LIST, OV_SHY, FALSE, "partition_group", "",
00471 0, 0, 0, &IPA_Group_Names, NULL },
00472 { OVK_LIST, OV_VISIBLE, FALSE, "specfile", "spec",
00473 0, 0, 0, &IPA_Spec_Files, NULL,
00474 "Identify IPA specification filename" },
00475 { OVK_BOOL, OV_SHY, FALSE, "sp_partition", "",
00476 0, 0, 0, &IPA_Enable_SP_Partition, NULL},
00477 { OVK_BOOL, OV_VISIBLE, FALSE, "picopt", "",
00478 0, 0, 0, &IPA_Enable_Picopt, NULL,
00479 "Enable shared code optimizations" },
00480 { OVK_BOOL, OV_VISIBLE, FALSE, "preempt", "",
00481 0, 0, 0, &IPA_Enable_Preempt, NULL},
00482 { OVK_UINT32, OV_VISIBLE, FALSE, "plimit", "",
00483 DEFAULT_PU_LIMIT, 0, UINT32_MAX, &IPA_PU_Limit, &IPA_PU_Limit_Set},
00484 { OVK_UINT32, OV_SHY, FALSE, "callee_limit", "",
00485 DEFAULT_SMALL_CALLEE, 0, UINT32_MAX, &IPA_Small_Callee_Limit, NULL},
00486 { OVK_BOOL, OV_INTERNAL, FALSE, "recycle", "",
00487 0, 0, 0, &IPA_Enable_Recycle, NULL},
00488 { OVK_BOOL, OV_SHY, FALSE, "relopt", "",
00489 0, 0, 0, &IPA_Enable_Relocatable_Opt, NULL},
00490 { OVK_OBSOLETE, OV_VISIBLE, FALSE, "rela_freq", "",
00491 DEFAULT_RELA_FREQ, 0, 100, &IPA_Rela_Freq, NULL},
00492 { OVK_LIST, OV_VISIBLE, FALSE, "skip_after", "",
00493 0, 0, 0, &IPA_Skip, NULL},
00494 { OVK_LIST, OV_VISIBLE, FALSE, "skip_before", "",
00495 0, 0, 0, &IPA_Skip, NULL},
00496 { OVK_LIST, OV_VISIBLE, FALSE, "skip_equal", "",
00497 0, 0, 0, &IPA_Skip, NULL},
00498 { OVK_BOOL, OV_INTERNAL, FALSE, "skip_report", "",
00499 0, 0, 0, &IPA_Skip_Report, NULL,
00500 "Report PU numbers for skip control" },
00501 { OVK_UINT32, OV_VISIBLE, FALSE, "small_pu", "",
00502 DEFAULT_SMALL_PU, 1, UINT32_MAX, &IPA_PU_Minimum_Size, NULL },
00503 { OVK_UINT32, OV_VISIBLE, FALSE, "space", "",
00504 DEFAULT_BLOAT_FACTOR, 0, UINT32_MAX, &IPA_Bloat_Factor,
00505 &IPA_Bloat_Factor_Set},
00506 { OVK_BOOL, OV_INTERNAL, FALSE, "split", "",
00507 0, 0, 0, &IPA_Enable_Split_Common, NULL,
00508 "Enable IPA split common optimization" },
00509 { OVK_BOOL, OV_INTERNAL, FALSE, "cord", "",
00510 0, 0, 0, &IPA_Enable_Cord, NULL,
00511 "Enable procedure reordering" },
00512 { OVK_BOOL, OV_VISIBLE, FALSE, "linear", "",
00513 0, 0, 0, &IPA_Enable_Linearization, NULL,
00514 "Enable linearization of array subscripts" },
00515 { OVK_BOOL, OV_VISIBLE, FALSE, "use_intrinsic", "",
00516 0, 0, 0, &IPA_Use_Intrinsic, NULL,
00517 "Load Intrinsic Libraries" },
00518 { OVK_BOOL, OV_VISIBLE, FALSE, "feedback", "",
00519 0, 0, 0, &IPA_Enable_Feedback, NULL,
00520 "Create .pragma, .dfe, .dve files, " },
00521 { OVK_BOOL, OV_VISIBLE, FALSE, "class", "",
00522 0, 0, 0, &IPA_Enable_Alias_Class, NULL,
00523 "Enable interprocedural alias classification" },
00524 { OVK_BOOL, OV_VISIBLE, FALSE, "ac_temp", "",
00525 0, 0, 0, &IPA_Debug_AC_Temp_Files, NULL,
00526 "Save files from before alias classification" },
00527 { OVK_BOOL, OV_INTERNAL, FALSE, "nested", "",
00528 0, 0, 0, &IPA_Enable_Inline_Nested_PU, NULL,
00529 "Enable inlining of nested PU " },
00530 { OVK_BOOL, OV_INTERNAL, FALSE, "preopt", "",
00531 0, 0, 0, &IPA_Enable_Preopt, &IPA_Enable_Preopt_Set,
00532 "Enable calling the preopt" },
00533 { OVK_BOOL, OV_INTERNAL, FALSE, "struct", "",
00534 0, 0, 0, &IPA_Enable_Inline_Struct, NULL,
00535 "Enable inlining of PU with F90 structures " },
00536 { OVK_BOOL, OV_INTERNAL, FALSE, "char", "",
00537 0, 0, 0, &IPA_Enable_Inline_Char_Array, NULL,
00538 "Enable inlining of PU with char arrays " },
00539 { OVK_BOOL, OV_INTERNAL, FALSE, "optional", "",
00540 0, 0, 0, &IPA_Enable_Inline_Optional_Arg, NULL,
00541 "Enable inlining of PU with optional arguments " },
00542 { OVK_BOOL, OV_INTERNAL, FALSE, "array_struct", "",
00543 0, 0, 0, &IPA_Enable_Inline_Struct_Array_Actual, NULL,
00544 "Enable inlining of PU with F90 structures when actuals are of ARRAY type " },
00545 { OVK_INT32, OV_INTERNAL, FALSE, "output_file_size", "",
00546 0, -100, INT32_MAX, &IPA_Output_File_Size, NULL},
00547 { OVK_BOOL, OV_INTERNAL, FALSE, "var_dim_array", "",
00548 0, 0, 0, &IPA_Enable_Inline_Var_Dim_Array, NULL,
00549 "Enable inlining of PU with param that is variable-dim array " },
00550 { OVK_NAME, OV_INTERNAL, FALSE, "propagate_feedback_file", "",
00551 0, 0, 0, &Feedback_Filename, NULL,
00552 "Feedback file name which IPA will propagate to next phase" },
00553 { OVK_NAME, OV_INTERNAL, FALSE, "propagate_annotation_file", "",
00554 0, 0, 0, &Annotation_Filename, NULL,
00555 "Annotation file name which IPA will propagate to next phase" },
00556 { OVK_BOOL, OV_INTERNAL, FALSE, "field_reorder", "",
00557 0, 0, 0, &IPA_Enable_Reorder, NULL,
00558 "Enable field reordering"},
00559 #ifdef KEY
00560 { OVK_BOOL, OV_INTERNAL, FALSE, "icall_opt", "",
00561 0, 0, 0, &IPA_Enable_Icall_Opt, NULL,
00562 "Enable conversion of icall to call"},
00563 { OVK_BOOL, OV_INTERNAL, FALSE, "eh_opt", "",
00564 0, 0, 0, &IPA_Enable_EH_Region_Removal, NULL,
00565 "Enable removal of exception regions"},
00566 { OVK_BOOL, OV_INTERNAL, FALSE, "branch", "",
00567 0, 0, 0, &IPA_Enable_Branch_Heuristic, NULL,
00568 "Enable use of branch probabilities for inlining"},
00569 { OVK_BOOL, OV_INTERNAL, FALSE, "check_opt", "",
00570 0, 0, 0, &IPA_Check_Options, NULL,
00571 "Enable handling of any inconsistent optimization options"},
00572 { OVK_BOOL, OV_VISIBLE, FALSE, "clone_list", "",
00573 0, 0, 0, &IPA_Clone_List_Actions, NULL,
00574 "Report function cloner actions" },
00575 { OVK_BOOL, OV_VISIBLE, FALSE, "pure_call", "",
00576 0, 0, 0, &IPA_Enable_Pure_Call_Opt, NULL,
00577 "Optimize calls to functions without side-effects" },
00578 { OVK_INT32, OV_INTERNAL, FALSE, "call_op_skip_b", "",
00579 0, 0, INT32_MAX, &IPA_Pure_Call_skip_before, NULL,
00580 "For debugging" },
00581 { OVK_INT32, OV_INTERNAL, FALSE, "pu_reorder", "",
00582 REORDER_DISABLE, REORDER_DISABLE, REORDER_BY_EDGE_FREQ,
00583 &IPA_Enable_PU_Reorder, &IPA_Enable_PU_Reorder_Set,
00584 "Enable procedure reordering" },
00585 { OVK_BOOL, OV_INTERNAL, FALSE, "ctype", "",
00586 0, 0, 0, &IPA_Enable_Ctype, NULL,
00587 "Enable insertion of ctype.h array"},
00588 { OVK_BOOL, OV_INTERNAL, FALSE, "icallopt_needs_inline", "",
00589 0, 0, 0, &IPA_Consult_Inliner_For_Icall_Opt, NULL,
00590 "Check inlining heuristics during icall opt"},
00591 { OVK_UINT32, OV_INTERNAL, FALSE, "icall_min_freq", "",
00592 DEFAULT_ICALL_MIN_FREQ, 1, UINT32_MAX, &IPA_Icall_Min_Freq, NULL,
00593 "Min freq of icall for icall optimization"},
00594 { OVK_BOOL, OV_INTERNAL, FALSE, "source_pu_order", "",
00595 0, 0, 0, &IPA_Enable_Source_PU_Order, NULL,
00596 "Maintain source-code PU ordering in IPA output"},
00597 { OVK_BOOL, OV_INTERNAL, FALSE, "ipa_enable_old_type_merge", "",
00598 0, 0, 0, &IPA_Enable_Old_Type_Merge, NULL,
00599 "Use the old type merge phase in IPA"},
00600 { OVK_BOOL, OV_INTERNAL, FALSE, "devirtualization", "",
00601 0, 0, 0, &IPA_Enable_Devirtualization, NULL,
00602 "Use devirtualization phase"},
00603 #ifdef TARG_X8664
00604 { OVK_UINT32, OV_INTERNAL, FALSE, "optimize_struct", "",
00605 1, 0, UINT32_MAX, &IPA_Enable_Struct_Opt, NULL,
00606 #else
00607 { OVK_UINT32, OV_INTERNAL, FALSE, "optimize_struct", "",
00608 0, 0, UINT32_MAX, &IPA_Enable_Struct_Opt, NULL,
00609 #endif
00610 "Enable IPA struct optimizations"},
00611
00612 { OVK_UINT32, OV_INTERNAL, FALSE, "update_struct", "",
00613 0, 0, UINT32_MAX, &IPA_Update_Struct, NULL,
00614 "Struct update"},
00615 #endif // KEY
00616 { OVK_COUNT }
00617 };
00618
00619
00620
00621
00622
00623
00624
00625 BOOL INLINE_Enable = TRUE;
00626 BOOL INLINE_All = FALSE;
00627 BOOL INLINE_Optimize_Alloca = TRUE;
00628 BOOL INLINE_Enable_Copy_Prop = TRUE;
00629 BOOL INLINE_Enable_Subst_Copy_Prop = FALSE;
00630 BOOL INLINE_F90 = TRUE;
00631 BOOL INLINE_None = FALSE;
00632 BOOL INLINE_Exceptions = TRUE;
00633 BOOL INLINE_Keep_PU_Order = FALSE;
00634 BOOL INLINE_List_Actions = FALSE;
00635 UINT32 INLINE_Max_Pu_Size = DEFAULT_INLINE_Max_Pu_Size;
00636
00637 BOOL INLINE_Preemptible = FALSE;
00638 BOOL INLINE_Static = FALSE;
00639 BOOL INLINE_Static_Set = FALSE;
00640 BOOL INLINE_Aggressive = FALSE;
00641 BOOL INLINE_Enable_Split_Common = TRUE;
00642 BOOL INLINE_Enable_Auto_Inlining = TRUE;
00643 BOOL INLINE_Enable_Restrict_Pointers = FALSE;
00644
00645 #ifdef KEY
00646 BOOL INLINE_Recursive = TRUE;
00647 BOOL INLINE_Param_Mismatch = TRUE;
00648 BOOL INLINE_Type_Mismatch = FALSE;
00649
00650 CHECK_PARAM_COMPATIBILITY INLINE_Check_Compatibility = RELAXED_CHECK;
00651 BOOL INLINE_Ignore_Bloat = TRUE;
00652 UINT32 INLINE_Callee_Limit = 0;
00653
00654 #endif
00655
00656 OPTION_LIST *INLINE_List_Names = NULL;
00657 OPTION_LIST *INLINE_Spec_Files = NULL;
00658 OPTION_LIST *IPA_Group_Names = NULL;
00659 OPTION_LIST *IPA_Spec_Files = NULL;
00660 UINT32 INLINE_Skip_After = UINT32_MAX;
00661 UINT32 INLINE_Skip_Before = 0;
00662 BOOL INLINE_Array_Bounds = FALSE;
00663 BOOL INLINE_Use_Malloc_Mempool = FALSE;
00664 BOOL INLINE_Free_Malloc_Mempool = FALSE;
00665
00666 BOOL INLINE_Inlined_Pu_Call_Graph = FALSE;
00667 BOOL INLINE_Inlined_Pu_Call_Graph2 = FALSE;
00668 BOOL INLINE_Get_Time_Info = FALSE;
00669
00670 char *INLINE_Script_Name = NULL;
00671 BOOL INLINE_Enable_Script = FALSE;;
00672
00673 static OPTION_DESC Options_INLINE[] = {
00674 { OVK_BOOL, OV_VISIBLE, FALSE, "", NULL,
00675 0, 0, 0, &INLINE_Enable, NULL,
00676 "Enable subprogram inlining" },
00677 { OVK_BOOL, OV_SHY, FALSE, "aggressive", "",
00678 0, 0, 0, &INLINE_Aggressive, NULL },
00679 { OVK_BOOL, OV_VISIBLE, FALSE, "all", "a",
00680 0, 0, 0, &INLINE_All, NULL,
00681 "Attempt to inline all subprograms" },
00682 { OVK_BOOL, OV_SHY, FALSE, "alloca", "alloca",
00683 0, 0, 0, &INLINE_Optimize_Alloca, NULL,
00684 "Enable save/restore of stack when inlining calls with alloca" },
00685 {OVK_BOOL, OV_VISIBLE, FALSE, "copy_prop_inline", "copy",
00686 0, 0, 0, &INLINE_Enable_Copy_Prop, NULL,
00687 "Enable inliner copy propagation" },
00688 { OVK_BOOL, OV_VISIBLE, FALSE, "dfe", "df",
00689 0, 0, 0, &IPA_Enable_DFE, &IPA_Enable_DFE_Set,
00690 "Enable dead function elimination" },
00691 { OVK_BOOL, OV_INTERNAL, FALSE, "exceptions", "exc",
00692 0, 0, 0, &INLINE_Exceptions, NULL },
00693 { OVK_LIST, OV_VISIBLE, FALSE, "file", "f",
00694 0, 0, 0, &INLINE_List_Names, NULL,
00695 "Identify files where inliner should search for subprograms" },
00696 { OVK_BOOL, OV_VISIBLE, FALSE, "keep_pu_order", "keep_pu",
00697 0, 0, 0, &INLINE_Keep_PU_Order, NULL,
00698 "Preserve source subprogram ordering" },
00699 { OVK_LIST, OV_VISIBLE, FALSE, "library", "lib",
00700 0, 0, 0, &INLINE_List_Names, NULL,
00701 "Identify archive libraries where inliner should search for subprograms" },
00702 { OVK_BOOL, OV_VISIBLE, FALSE, "list", "l",
00703 0, 0, 0, &INLINE_List_Actions, NULL,
00704 "Report inliner actions" },
00705 { OVK_UINT32, OV_VISIBLE, FALSE, "max_pu_size_inline", "max_pu_size",
00706 DEFAULT_INLINE_Max_Pu_Size, 0, UINT32_MAX,
00707 &INLINE_Max_Pu_Size, NULL,
00708 "Limit size of inlined subprograms" },
00709 { OVK_LIST, OV_VISIBLE, FALSE, "must", "m",
00710 0, 0, 0, &INLINE_List_Names, NULL,
00711 "Identify subprograms to be inlined" },
00712 { OVK_LIST, OV_VISIBLE, FALSE, "never", "ne",
00713 0, 0, 0, &INLINE_List_Names, NULL,
00714 "Identify subprograms not to inline" },
00715 { OVK_BOOL, OV_VISIBLE, FALSE, "none", "no",
00716 0, 0, 0, &INLINE_None, NULL,
00717 "Disable default inlining" },
00718 { OVK_BOOL, OV_SHY, FALSE, "preemptible", "preempt",
00719 0, 0, 0, &INLINE_Preemptible, NULL },
00720 { OVK_BOOL, OV_INTERNAL, FALSE, "recycle_symbols", "recycle",
00721 0, 0, 0, &IPA_Enable_Recycle, NULL },
00722 { OVK_LIST, OV_VISIBLE, FALSE, "specfile", "sp",
00723 0, 0, 0, &INLINE_Spec_Files, NULL,
00724 "Identify IPA specification filename" },
00725 { OVK_BOOL, OV_INTERNAL, FALSE, "split", "",
00726 0, 0, 0, &INLINE_Enable_Split_Common, NULL,
00727 "Enable inliner split common optimization" },
00728 { OVK_BOOL, OV_SHY, FALSE, "static", "",
00729 0, 0, 0, &INLINE_Static, &INLINE_Static_Set,
00730 "Enable inlining of static functions" },
00731 { OVK_BOOL, OV_INTERNAL, FALSE, "subst_copy_prop_inline", "subst",
00732 0, 0, 0, &INLINE_Enable_Subst_Copy_Prop, NULL,
00733 "Enable inliner copy propagation" },
00734 { OVK_BOOL, OV_INTERNAL, FALSE, "f90param", "",
00735 0, 0, 0, &INLINE_F90, NULL,
00736 "Enable parameter type checking for F90" },
00737 { OVK_BOOL, OV_INTERNAL, FALSE, "auto", "",
00738 0, 0, 0, &INLINE_Enable_Auto_Inlining, NULL,
00739 "Enable inliner automatic inline analysis" },
00740 { OVK_BOOL, OV_INTERNAL, FALSE, "restrict", "",
00741 0, 0, 0, &INLINE_Enable_Restrict_Pointers, NULL,
00742 "Allow inlining of PUs with restrict pointer as formal parameters" },
00743 #ifdef KEY
00744 { OVK_BOOL, OV_INTERNAL, FALSE, "recurse", "",
00745 0, 0, 0, &INLINE_Recursive, NULL,
00746 "Allow recursive inlining of PUs" },
00747 { OVK_BOOL, OV_INTERNAL, FALSE, "num_mismatch", "",
00748 0, 0, 0, &INLINE_Param_Mismatch, NULL,
00749 "Allow inlining even if # of parameters does not match between call and callee" },
00750 { OVK_BOOL, OV_INTERNAL, FALSE, "type_mismatch", "",
00751 0, 0, 0, &INLINE_Type_Mismatch, NULL,
00752 "Allow inlining even if actuals don't exactly match formals" },
00753 { OVK_INT32, OV_INTERNAL, FALSE, "check_types", "",
00754 RELAXED_CHECK, STRICT_CHECK, AGGRESSIVE,
00755 &INLINE_Check_Compatibility, NULL, "Check parameter type compatibility during inlining"},
00756 { OVK_BOOL, OV_INTERNAL, FALSE, "ignore_bloat", "",
00757 0, 0, 0, &INLINE_Ignore_Bloat, NULL,
00758 "Ignore code bloat controlled by -IPA:space" },
00759 { OVK_UINT32, OV_INTERNAL, FALSE, "callee_size", "",
00760 0, 0, UINT32_MAX, &INLINE_Callee_Limit, NULL,
00761 "Callee size limit for functions marked inline by user"},
00762 #endif
00763 { OVK_LIST, OV_VISIBLE, FALSE, "skip", "s",
00764 0, 0, 0, &INLINE_List_Names, NULL,
00765 "Skip requested CG edges to avoid doing inlining" },
00766 { OVK_BOOL, OV_INTERNAL, FALSE, "nested", "",
00767 0, 0, 0, &IPA_Enable_Inline_Nested_PU, NULL,
00768 "Enable inlining of nested PU " },
00769 { OVK_BOOL, OV_INTERNAL, FALSE, "struct", "",
00770 0, 0, 0, &IPA_Enable_Inline_Struct, NULL,
00771 "Enable inlining of PU with F90 structures " },
00772 { OVK_BOOL, OV_INTERNAL, FALSE, "char", "",
00773 0, 0, 0, &IPA_Enable_Inline_Char_Array, NULL,
00774 "Enable inlining of PU with char arrays " },
00775 { OVK_BOOL, OV_INTERNAL, FALSE, "optional", "opt",
00776 0, 0, 0, &IPA_Enable_Inline_Optional_Arg, NULL,
00777 "Enable inlining of PU with optional arguments " },
00778 { OVK_LIST, OV_VISIBLE, FALSE, "edge", "e",
00779 0, 0, 0, &INLINE_List_Names, NULL,
00780 "Inline requested CG edges ONLY" },
00781 { OVK_BOOL, OV_INTERNAL, FALSE, "array_struct", "",
00782 0, 0, 0, &IPA_Enable_Inline_Struct_Array_Actual, NULL,
00783 "Enable inlining of PU with F90 structures when actuals are of ARRAY type" },
00784 { OVK_UINT32, OV_VISIBLE, FALSE, "skip_after", "",
00785 UINT32_MAX, 0, UINT32_MAX, &INLINE_Skip_After, NULL,
00786 "Edge number to skip if larger than the specified" },
00787 { OVK_UINT32, OV_VISIBLE, FALSE, "skip_before", "",
00788 0, 0, UINT32_MAX, &INLINE_Skip_Before, NULL,
00789 "Edge number to skip if smaller than the specified" },
00790 { OVK_BOOL, OV_INTERNAL, FALSE, "var_dim_array", "",
00791 0, 0, 0, &IPA_Enable_Inline_Var_Dim_Array, NULL,
00792 "Enable inlining of PU with param that is variable-dim array " },
00793 { OVK_LIST, OV_VISIBLE, FALSE, "in_edge", "",
00794 0, 0, 0, &INLINE_List_Names, NULL,
00795 "Inline requested CG edges " },
00796 { OVK_BOOL, OV_INTERNAL, FALSE, "array_bounds", "",
00797 0, 0, 0, &INLINE_Array_Bounds, NULL,
00798 "Is it safe to inline a PU with an array parameter whose outermost dimension size is unknown" },
00799 { OVK_BOOL, OV_INTERNAL, FALSE, "malloc", "",
00800 0, 0, 0, &INLINE_Use_Malloc_Mempool, NULL,
00801 "Use malloc mempool instead of private mempool to clone trees" },
00802 { OVK_BOOL, OV_INTERNAL, FALSE, "free", "",
00803 0, 0, 0, &INLINE_Free_Malloc_Mempool, NULL,
00804 "Free memory malloc'ed by the malloc mempool used in clone trees" },
00805 { OVK_BOOL, OV_INTERNAL, FALSE, "inlined_pu", "",
00806 0, 0, 0, &INLINE_Inlined_Pu_Call_Graph, NULL,
00807 "Lightweight inliner impl 2 -- build a call graph with only PU tagged inline" },
00808 { OVK_BOOL, OV_INTERNAL, FALSE, "pu_need_inline", "",
00809 0, 0, 0, &INLINE_Inlined_Pu_Call_Graph2, NULL,
00810 "Lightweight inliner impl 2 -- build a call graph with only PU tagged inline and callers that call these PUs" },
00811 { OVK_BOOL, OV_INTERNAL, FALSE, "time", "",
00812 0, 0, 0, &INLINE_Get_Time_Info, NULL,
00813 "Generate timing info for different phase of the inliner" },
00814 { OVK_NAME, OV_VISIBLE, TRUE, "inline_script", "",
00815 0, 0, 0, &INLINE_Script_Name, &INLINE_Enable_Script,
00816 "Enable call-site specific inlining based on inline description file" },
00817 { OVK_COUNT }
00818 };