1 /*
  2  * Copyright (c) 2000, 2026, Oracle and/or its affiliates. All rights reserved.
  3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  4  *
  5  * This code is free software; you can redistribute it and/or modify it
  6  * under the terms of the GNU General Public License version 2 only, as
  7  * published by the Free Software Foundation.
  8  *
  9  * This code is distributed in the hope that it will be useful, but WITHOUT
 10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 12  * version 2 for more details (a copy is included in the LICENSE file that
 13  * accompanied this code).
 14  *
 15  * You should have received a copy of the GNU General Public License version
 16  * 2 along with this work; if not, write to the Free Software Foundation,
 17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
 18  *
 19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
 20  * or visit www.oracle.com if you need additional information or have any
 21  * questions.
 22  *
 23  */
 24 
 25 #ifndef SHARE_OPTO_C2_GLOBALS_HPP
 26 #define SHARE_OPTO_C2_GLOBALS_HPP
 27 
 28 #include "runtime/globals_shared.hpp"
 29 #include "utilities/macros.hpp"
 30 #include CPU_HEADER(c2_globals)
 31 
 32 //
 33 // Defines all globals flags used by the server compiler.
 34 //
 35 
 36 #define C2_FLAGS(develop,                                                   \
 37                  develop_pd,                                                \
 38                  product,                                                   \
 39                  product_pd,                                                \
 40                  range,                                                     \
 41                  constraint)                                                \
 42                                                                             \
 43   product(bool, StressLCM, false, DIAGNOSTIC,                               \
 44           "Randomize instruction scheduling in LCM")                        \
 45                                                                             \
 46   product(bool, StressGCM, false, DIAGNOSTIC,                               \
 47           "Randomize instruction scheduling in GCM")                        \
 48                                                                             \
 49   product(bool, StressIGVN, false, DIAGNOSTIC,                              \
 50           "Randomize worklist traversal in IGVN")                           \
 51                                                                             \
 52   product(bool, StressCCP, false, DIAGNOSTIC,                               \
 53           "Randomize worklist traversal in CCP")                            \
 54                                                                             \
 55   product(bool, StressIncrementalInlining, false, DIAGNOSTIC,               \
 56           "Randomize the incremental inlining decision")                    \
 57                                                                             \
 58   product(bool, StressMacroExpansion, false, DIAGNOSTIC,                    \
 59           "Randomize macro node expansion order")                           \
 60                                                                             \
 61   product(bool, StressMacroElimination, false, DIAGNOSTIC,                  \
 62           "Randomize macro node elimination order")                         \
 63                                                                             \
 64   product(bool, StressUnstableIfTraps, false, DIAGNOSTIC,                   \
 65           "Randomly take unstable if traps")                                \
 66                                                                             \
 67   product(uint, StressSeed, 0, DIAGNOSTIC,                                  \
 68           "Seed for randomized stress testing (if unset, a random one is "  \
 69           "generated). The seed is recorded in the compilation log, if "    \
 70           "available.")                                                     \
 71           range(0, max_juint)                                               \
 72                                                                             \
 73   develop(bool, StressMethodHandleLinkerInlining, false,                    \
 74           "Stress inlining through method handle linkers")                  \
 75                                                                             \
 76   develop(bool, StressBailout, false,                                       \
 77           "Perform bailouts randomly at C2 failing() checks")               \
 78                                                                             \
 79   develop(uint, StressBailoutMean, 100000,                                  \
 80           "The expected number of failing() checks made until "             \
 81           "a random bailout.")                                              \
 82           range(1, max_juint)                                               \
 83                                                                             \
 84   develop(intx, OptoPrologueNops, 0,                                        \
 85           "Insert this many extra nop instructions "                        \
 86           "in the prologue of every nmethod")                               \
 87           range(0, 128)                                                     \
 88                                                                             \
 89   product_pd(intx, InteriorEntryAlignment,                                  \
 90           "Code alignment for interior entry points "                       \
 91           "in generated code (in bytes)")                                   \
 92           constraint(InteriorEntryAlignmentConstraintFunc, AfterErgo)       \
 93                                                                             \
 94   product(intx, MaxLoopPad, (OptoLoopAlignment-1),                          \
 95           "Align a loop if padding size in bytes is less or equal to this " \
 96           "value")                                                          \
 97           range(0, max_jint)                                                \
 98                                                                             \
 99   product(intx, MaxVectorSize, 64,                                          \
100           "Max vector size in bytes, "                                      \
101           "actual size could be less depending on elements type")           \
102           range(0, max_jint)                                                \
103                                                                             \
104   product(intx, ArrayOperationPartialInlineSize, 0, DIAGNOSTIC,             \
105           "Partial inline size used for small array operations"             \
106           "(e.g. copy,cmp) acceleration.")                                  \
107           range(0, 256)                                                     \
108                                                                             \
109   product(bool, AlignVector, true,                                          \
110           "Perform vector store/load alignment in loop")                    \
111                                                                             \
112   develop(bool, VerifyAlignVector, false,                                   \
113           "Check that vector stores/loads are aligned if AlignVector"       \
114           "is enabled.")                                                    \
115                                                                             \
116   product(intx, NumberOfLoopInstrToAlign, 4,                                \
117           "Number of first instructions in a loop to align")                \
118           range(0, max_jint)                                                \
119                                                                             \
120   develop(intx, IndexSetWatch, 0,                                           \
121           "Trace all operations on this IndexSet (-1 means all, 0 none)")   \
122           range(-1, max_intx)                                               \
123                                                                             \
124   develop(intx, OptoNodeListSize, 4,                                        \
125           "Starting allocation size of Node_List data structures")          \
126           range(1, max_jint)                                                \
127                                                                             \
128   develop(intx, OptoBlockListSize, 8,                                       \
129           "Starting allocation size of Block_List data structures")         \
130           range(1, max_jint)                                                \
131                                                                             \
132   develop(intx, OptoPeepholeAt, -1,                                         \
133           "Apply peephole optimizations to this peephole rule")             \
134                                                                             \
135   develop(bool, PrintIdeal, false,                                          \
136           "Print ideal graph before code generation")                       \
137                                                                             \
138   develop(bool, PrintOpto, false,                                           \
139           "Print compiler2 attempts")                                       \
140                                                                             \
141   develop(bool, PrintOptoInlining, false,                                   \
142           "Print compiler2 inlining decisions")                             \
143                                                                             \
144   develop(bool, VerifyIdealNodeCount, false,                                \
145           "Verify that tracked dead ideal node count is accurate")          \
146                                                                             \
147   develop(bool, PrintIdealNodeCount, false,                                 \
148           "Print liveness counts of ideal nodes")                           \
149                                                                             \
150   product_pd(bool, IdealizeClearArrayNode, DIAGNOSTIC,                      \
151           "Replace ClearArrayNode by subgraph of basic operations.")        \
152                                                                             \
153   develop(bool, OptoBreakpoint, false,                                      \
154           "insert breakpoint at method entry")                              \
155                                                                             \
156   develop(bool, OptoBreakpointOSR, false,                                   \
157           "insert breakpoint at osr method entry")                          \
158                                                                             \
159   develop(uint64_t, BreakAtNode, 0,                                         \
160           "Break at construction of this Node (either _idx or _debug_idx)") \
161                                                                             \
162   develop(bool, OptoBreakpointC2R, false,                                   \
163           "insert breakpoint at runtime stub entry")                        \
164                                                                             \
165   develop(bool, OptoNoExecute, false,                                       \
166           "Attempt to parse and compile but do not execute generated code") \
167                                                                             \
168   develop(bool, PrintOptoStatistics, false,                                 \
169           "Print New compiler statistics")                                  \
170                                                                             \
171   product(bool, PrintOptoAssembly, false, DIAGNOSTIC,                       \
172           "Print New compiler assembly output")                             \
173                                                                             \
174   develop_pd(bool, OptoPeephole,                                            \
175           "Apply peephole optimizations after register allocation")         \
176                                                                             \
177   develop(bool, PrintFrameConverterAssembly, false,                         \
178           "Print New compiler assembly output for frame converters")        \
179                                                                             \
180   develop(bool, PrintParseStatistics, false,                                \
181           "Print nodes, transforms and new values made per bytecode parsed")\
182                                                                             \
183   develop(bool, PrintOptoPeephole, false,                                   \
184           "Print New compiler peephole replacements")                       \
185                                                                             \
186   develop(bool, PrintCFGBlockFreq, false,                                   \
187           "Print CFG block frequencies")                                    \
188                                                                             \
189   develop(bool, TraceOptoParse, false,                                      \
190           "Trace bytecode parse and control-flow merge")                    \
191                                                                             \
192   product_pd(intx,  LoopUnrollLimit,                                        \
193           "Unroll loop bodies with node count less than this")              \
194           range(0, max_jint / 4)                                            \
195                                                                             \
196   product_pd(intx, LoopPercentProfileLimit,                                 \
197              "Unroll loop bodies with % node count of profile limit")       \
198              range(10, 100)                                                 \
199                                                                             \
200   product(intx,  LoopMaxUnroll, 16,                                         \
201           "Maximum number of unrolls for main loop")                        \
202           range(0, max_jint)                                                \
203                                                                             \
204   product_pd(bool,  SuperWordLoopUnrollAnalysis,                            \
205            "Map number of unrolls for main loop via "                       \
206            "Superword Level Parallelism analysis")                          \
207                                                                             \
208   develop(bool, TraceSuperWordLoopUnrollAnalysis, false,                    \
209           "Trace what Superword Level Parallelism analysis applies")        \
210                                                                             \
211   product(bool, UseVectorMacroLogic, true, DIAGNOSTIC,                      \
212           "Use ternary macro logic instructions")                           \
213                                                                             \
214   product(intx,  LoopUnrollMin, 4,                                          \
215           "Minimum number of unroll loop bodies before checking progress"   \
216           "of rounds of unroll,optimize,..")                                \
217           range(0, max_jint)                                                \
218                                                                             \
219   product(bool, UseSubwordForMaxVector, true,                               \
220           "Use Subword Analysis to set maximum vector size")                \
221                                                                             \
222   product(bool, UseVectorCmov, false,                                       \
223           "Use Vectorized Cmov")                                            \
224                                                                             \
225   develop(intx, UnrollLimitForProfileCheck, 1,                              \
226           "Don't use profile_trip_cnt() to restrict unrolling until "       \
227           "unrolling would push the number of unrolled iterations above "   \
228           "UnrollLimitForProfileCheck. A higher value allows more "         \
229           "unrolling. Zero acts as a very large value." )                   \
230           range(0, max_intx)                                                \
231                                                                             \
232   product(intx, MultiArrayExpandLimit, 6,                                   \
233           "Maximum number of individual allocations in an inline-expanded " \
234           "multianewarray instruction")                                     \
235           range(0, max_jint)                                                \
236                                                                             \
237   develop(bool, TraceProfileTripCount, false,                               \
238           "Trace profile loop trip count information")                      \
239                                                                             \
240   product(bool, UseCountedLoopSafepoints, false,                            \
241           "Force counted loops to keep a safepoint")                        \
242                                                                             \
243   product(bool, UseLoopPredicate, true,                                     \
244           "Move checks with uncommon trap out of loops.")                   \
245                                                                             \
246   develop(bool, TraceLoopPredicate, false,                                  \
247           "Trace generation of loop predicates")                            \
248                                                                             \
249   develop(bool, TraceLoopOpts, false,                                       \
250           "Trace executed loop optimizations")                              \
251                                                                             \
252   develop(bool, TraceSplitIf, false,                                        \
253           "Trace Split-If optimization")                                    \
254                                                                             \
255   develop(bool, TraceLoopLimitCheck, false,                                 \
256           "Trace generation of loop limits checks")                         \
257                                                                             \
258   develop(bool, TraceRangeLimitCheck, false,                                \
259           "Trace additional overflow checks in RCE")                        \
260                                                                             \
261   /* OptimizeFill not yet supported on PowerPC. */                          \
262   product(bool, OptimizeFill, true PPC64_ONLY(&& false),                    \
263           "convert fill/copy loops into intrinsic")                         \
264                                                                             \
265   develop(bool, TraceOptimizeFill, false,                                   \
266           "print detailed information about fill conversion")               \
267                                                                             \
268   develop(bool, OptoCoalesce, true,                                         \
269           "Use Conservative Copy Coalescing in the Register Allocator")     \
270                                                                             \
271   product(uint, IFGEdgesLimit, 10000000, DIAGNOSTIC,                        \
272           "Maximum allowed edges in the interference graphs")               \
273           range(0, max_juint)                                               \
274                                                                             \
275   develop(bool, UseUniqueSubclasses, true,                                  \
276           "Narrow an abstract reference to the unique concrete subclass")   \
277                                                                             \
278   product(intx, TrackedInitializationLimit, 50,                             \
279           "When initializing fields, track up to this many words")          \
280           range(0, 65535)                                                   \
281                                                                             \
282   product(bool, ReduceFieldZeroing, true,                                   \
283           "When initializing fields, try to avoid needless zeroing")        \
284                                                                             \
285   product(bool, ReduceInitialCardMarks, true,                               \
286           "When initializing fields, try to avoid needless card marks")     \
287                                                                             \
288   product(bool, ReduceBulkZeroing, true,                                    \
289           "When bulk-initializing, try to avoid needless zeroing")          \
290                                                                             \
291   product(bool, UseFPUForSpilling, false,                                   \
292           "Spill integer registers to FPU instead of stack when possible")  \
293                                                                             \
294   develop_pd(intx, RegisterCostAreaRatio,                                   \
295           "Spill selection in reg allocator: scale area by (X/64K) before " \
296           "adding cost")                                                    \
297                                                                             \
298   develop_pd(bool, UseCISCSpill,                                            \
299           "Use ADLC supplied cisc instructions during allocation")          \
300                                                                             \
301   develop(bool, VerifyGraphEdges , false,                                   \
302           "Verify Bi-directional Edges")                                    \
303                                                                             \
304   develop(bool, VerifyDUIterators, true,                                    \
305           "Verify the safety of all iterations of Bi-directional Edges")    \
306                                                                             \
307   develop(bool, VerifyHashTableKeys, true,                                  \
308           "Verify the immutability of keys in the VN hash tables")          \
309                                                                             \
310   develop(bool, VerifyRegisterAllocator , false,                            \
311           "Verify Register Allocator")                                      \
312                                                                             \
313   develop(intx, FLOATPRESSURE, -1,                                          \
314           "Number of float LRG's that constitute high register pressure."   \
315           "-1: means the threshold is determined by number of available "   \
316           "float register for allocation")                                  \
317           range(-1, max_jint)                                               \
318                                                                             \
319   develop(intx, INTPRESSURE, -1,                                            \
320           "Number of integer LRG's that constitute high register pressure." \
321           "-1: means the threshold is determined by number of available "   \
322           "integer register for allocation")                                \
323           range(-1, max_jint)                                               \
324                                                                             \
325   develop(bool, TraceOptoPipelining, false,                                 \
326           "Trace pipelining information")                                   \
327                                                                             \
328   develop(bool, TraceOptoOutput, false,                                     \
329           "Trace pipelining information")                                   \
330                                                                             \
331   product_pd(bool, OptoScheduling,                                          \
332           "Instruction Scheduling after register allocation")               \
333                                                                             \
334   product_pd(bool, OptoRegScheduling,                                       \
335           "Instruction Scheduling before register allocation for pressure") \
336                                                                             \
337   product(bool, PartialPeelLoop, true,                                      \
338           "Partial peel (rotate) loops")                                    \
339                                                                             \
340   product(uint, LoopPeeling, 1, DIAGNOSTIC,                                 \
341           "Control loop peeling optimization: "                             \
342           "0 = always disable loop peeling, "                               \
343           "1 = enable loop peeling (default), "                             \
344           "2 = disable loop peeling as a standalone optimization but "      \
345           "allow it as a helper to other loop optimizations like removing " \
346           "empty loops")                                                    \
347           range(0, 2)                                                       \
348                                                                             \
349   product(intx, PartialPeelNewPhiDelta, 0,                                  \
350           "Additional phis that can be created by partial peeling")         \
351           range(0, max_jint)                                                \
352                                                                             \
353   develop(bool, TracePartialPeeling, false,                                 \
354           "Trace partial peeling (loop rotation) information")              \
355                                                                             \
356   product(bool, PartialPeelAtUnsignedTests, true,                           \
357           "Partial peel at unsigned tests if no signed test exists")        \
358                                                                             \
359   product(bool, ReassociateInvariants, true,                                \
360           "Enable reassociation of expressions with loop invariants.")      \
361                                                                             \
362   product(bool, LoopUnswitching, true,                                      \
363           "Enable loop unswitching (a form of invariant test hoisting)")    \
364                                                                             \
365   develop(bool, TraceLoopUnswitching, false,                                \
366           "Trace loop unswitching")                                         \
367                                                                             \
368   product(bool, LoopMultiversioning, true, DIAGNOSTIC,                      \
369           "Enable loop multiversioning (for speculative compilation)")      \
370                                                                             \
371   develop(bool, TraceLoopMultiversioning, false,                            \
372           "Trace loop multiversioning")                                     \
373                                                                             \
374   product(bool, UseAutoVectorizationPredicate, true, DIAGNOSTIC,            \
375           "Use AutoVectorization predicate (for speculative compilation)")  \
376                                                                             \
377   product(bool, UseAutoVectorizationSpeculativeAliasingChecks, true, DIAGNOSTIC, \
378           "Allow the use Multiversioning or Predicate to add aliasing"      \
379           "runtime checks. Runtime checks will only be inserted if either"  \
380           "LoopMultiversioning or UseAutoVectorizationPredicate are"        \
381           "enabled.")                                                       \
382                                                                             \
383   product(bool, AllowVectorizeOnDemand, true,                               \
384           "Globally suppress vectorization set in VectorizeMethod")         \
385                                                                             \
386   product(bool, UseSuperWord, true,                                         \
387           "Transform scalar operations into superword operations")          \
388                                                                             \
389   product(bool, SuperWordReductions, true,                                  \
390           "Enable reductions support in superword.")                        \
391                                                                             \
392   product_pd(uint, SuperWordStoreToLoadForwardingFailureDetection, DIAGNOSTIC, \
393           "if >0, auto-vectorization detects possible store-to-load "       \
394           "forwarding failures. The number specifies over how many "        \
395           "loop iterations this detection spans.")                          \
396           range(0, 4096)                                                    \
397                                                                             \
398   product(uint, SuperWordAutomaticAlignment, 1, DIAGNOSTIC,                 \
399           "0 = Disabled (unless AlignVector is enabled)"                    \
400           "Else: align with a load or store of the largest vector width,"   \
401           "      and if there are loads and stores of the largest width:"   \
402           "1 = Prefer alignment with vector store (default)"                \
403           "2 = Prefer alignment with vector load.")                         \
404           range(0, 2)                                                       \
405                                                                             \
406   product(uint, AutoVectorizationOverrideProfitability, 1, DIAGNOSTIC,      \
407           "Override the auto vectorization profitability heuristics."       \
408           "0 = Run auto vectorizer, but abort just before applying"         \
409           "    vectorization, as though it was not profitable."             \
410           "1 = Run auto vectorizer with the default profitability"          \
411           "    heuristics. This is the default, and hopefully"              \
412           "    delivers the best performance."                              \
413           "2 = Run auto vectorizer, and vectorize even if the"              \
414           "    profitability heuristics predict that vectorization"         \
415           "    is not profitable.")                                         \
416           range(0, 2)                                                       \
417                                                                             \
418   product(bool, UseCMoveUnconditionally, false,                             \
419           "Use CMove (scalar and vector) ignoring profitability test.")     \
420                                                                             \
421   develop(bool, TraceSuperWord, false,                                      \
422           "Trace superword transforms")                                     \
423                                                                             \
424   develop(bool, TraceNewVectors, false,                                     \
425           "Trace creation of Vector nodes")                                 \
426                                                                             \
427   product(bool, MergeStores, true, DIAGNOSTIC,                              \
428           "Optimize stores by combining values into larger store")          \
429                                                                             \
430   product_pd(bool, OptoBundling,                                            \
431           "Generate nops to fill i-cache lines")                            \
432                                                                             \
433   product_pd(intx, ConditionalMoveLimit,                                    \
434           "Limit of ops to make speculative when using CMOVE")              \
435           range(0, max_jint)                                                \
436                                                                             \
437   develop(intx, PrintPhaseLevel, 0,                                         \
438           "Level of detail of the phase trace print. "                      \
439           "System-wide value, -1=printing is disabled, "                    \
440           "0=print nothing except PhasePrintLevel directives, "             \
441           "6=all details printed. "                                         \
442           "Level of detail of printouts can be set on a per-method level "  \
443           "as well by using CompileCommand=PhasePrintLevel.")               \
444           range(-1, 6)                                                      \
445                                                                             \
446   develop(bool, PrintIdealGraph, false,                                     \
447           "Print ideal graph to XML file / network interface. "             \
448           "By default attempts to connect to the visualizer on a socket.")  \
449                                                                             \
450   develop(intx, PrintIdealGraphLevel, 0,                                    \
451           "Level of detail of the ideal graph printout. "                   \
452           "System-wide value, -1=printing is disabled, "                    \
453           "0=print nothing except IGVPrintLevel directives, "               \
454           "6=all details printed. "                                         \
455           "Level of detail of printouts can be set on a per-method level "  \
456           "as well by using CompileCommand=option.")                        \
457           range(-1, 6)                                                      \
458                                                                             \
459   develop(intx, PrintIdealGraphPort, 4444,                                  \
460           "Ideal graph printer to network port")                            \
461           range(0, SHRT_MAX)                                                \
462                                                                             \
463   develop(ccstr, PrintIdealGraphAddress, "127.0.0.1",                       \
464           "IP address to connect to visualizer")                            \
465                                                                             \
466   develop(ccstr, PrintIdealGraphFile, nullptr,                              \
467           "File to dump ideal graph to.  If set overrides the "             \
468           "use of the network")                                             \
469                                                                             \
470   product(bool, UseBimorphicInlining, true,                                 \
471           "Profiling based inlining for two receivers")                     \
472                                                                             \
473   product(bool, UseOnlyInlinedBimorphic, true,                              \
474           "Don't use BimorphicInlining if can't inline a second method")    \
475                                                                             \
476   develop(bool, SubsumeLoads, true,                                         \
477           "Attempt to compile while subsuming loads into machine "          \
478           "instructions.")                                                  \
479                                                                             \
480   develop(bool, StressRecompilation, false,                                 \
481           "Recompile each compiled method without subsuming loads "         \
482           "or escape analysis.")                                            \
483                                                                             \
484   develop(intx, ImplicitNullCheckThreshold, 3,                              \
485           "Don't do implicit null checks if NPE's in a method exceeds "     \
486           "limit")                                                          \
487           range(0, max_jint)                                                \
488                                                                             \
489   product(intx, LoopOptsCount, 43,                                          \
490           "Set level of loop optimization for tier 1 compiles")             \
491           range(5, max_jint)                                                \
492                                                                             \
493   product(bool, OptimizeUnstableIf, true, DIAGNOSTIC,                       \
494           "Optimize UnstableIf traps")                                      \
495                                                                             \
496   /* controls for heat-based inlining */                                    \
497                                                                             \
498   develop(intx, NodeCountInliningCutoff, 18000,                             \
499           "If parser node generation exceeds limit stop inlining")          \
500           range(0, max_jint)                                                \
501                                                                             \
502   product(intx, MaxNodeLimit, 80000,                                        \
503           "Maximum number of nodes")                                        \
504           range(1000, max_jint / 3)                                         \
505                                                                             \
506   product(intx, NodeLimitFudgeFactor, 2000,                                 \
507           "Fudge Factor for certain optimizations")                         \
508           constraint(NodeLimitFudgeFactorConstraintFunc, AfterErgo)         \
509                                                                             \
510   product(bool, UseJumpTables, true,                                        \
511           "Use JumpTables instead of a binary search tree for switches")    \
512                                                                             \
513   product(bool, UseDivMod, true,                                            \
514           "Use combined DivMod instruction if available")                   \
515                                                                             \
516   product_pd(intx, MinJumpTableSize,                                        \
517           "Minimum number of targets in a generated jump table")            \
518           range(0, max_intx)                                                \
519                                                                             \
520   product(intx, MaxJumpTableSize, 65000,                                    \
521           "Maximum number of targets in a generated jump table")            \
522           range(0, max_intx)                                                \
523                                                                             \
524   product(intx, MaxJumpTableSparseness, 5,                                  \
525           "Maximum sparseness for jumptables")                              \
526           range(0, max_intx / 4)                                            \
527                                                                             \
528   product(bool, EliminateLocks, true,                                       \
529           "Coarsen locks when possible")                                    \
530                                                                             \
531   product(bool, EliminateNestedLocks, true,                                 \
532           "Eliminate nested locks of the same object when possible")        \
533                                                                             \
534   develop(bool, PrintLockStatistics, false,                                 \
535           "Print precise statistics on the dynamic lock usage")             \
536                                                                             \
537   develop(bool, PrintEliminateLocks, false,                                 \
538           "Print out when locks are eliminated")                            \
539                                                                             \
540   product(bool, EliminateAutoBox, true,                                     \
541           "Control optimizations for autobox elimination")                  \
542                                                                             \
543   product(intx, AutoBoxCacheMax, 128,                                       \
544           "Sets max value cached by the java.lang.Integer autobox cache")   \
545           range(0, max_jint)                                                \
546                                                                             \
547   product(bool, AggressiveUnboxing, true, DIAGNOSTIC,                       \
548           "Control optimizations for aggressive boxing elimination")        \
549                                                                             \
550   develop(bool, TracePostallocExpand, false, "Trace expanding nodes after"  \
551           " register allocation.")                                          \
552                                                                             \
553   product(bool, ReduceAllocationMerges, true, DIAGNOSTIC,                   \
554           "Try to simplify allocation merges before Scalar Replacement")    \
555                                                                             \
556   develop(bool, TraceReduceAllocationMerges, false,                         \
557              "Trace decision for simplifying allocation merges.")           \
558                                                                             \
559   develop(bool, VerifyReduceAllocationMerges, true,                         \
560           "Verify reduce allocation merges in escape analysis")             \
561                                                                             \
562   product(bool, DoEscapeAnalysis, true,                                     \
563           "Perform escape analysis")                                        \
564                                                                             \
565   product(double, EscapeAnalysisTimeout, 20. DEBUG_ONLY(+40.),              \
566           "Abort EA when it reaches time limit (in sec)")                   \
567           range(0, DBL_MAX)                                                 \
568                                                                             \
569   develop(bool, ExitEscapeAnalysisOnTimeout, true,                          \
570           "Exit or throw assert in EA when it reaches time limit")          \
571                                                                             \
572   develop(bool, PrintEscapeAnalysis, false,                                 \
573           "Print the results of escape analysis")                           \
574                                                                             \
575   product(bool, EliminateAllocations, true,                                 \
576           "Use escape analysis to eliminate allocations")                   \
577                                                                             \
578   develop(bool, PrintEliminateAllocations, false,                           \
579           "Print out when allocations are eliminated")                      \
580                                                                             \
581   product(intx, EliminateAllocationArraySizeLimit, 64,                      \
582           "Array size (number of elements) limit for scalar replacement")   \
583           range(0, max_jint)                                                \
584                                                                             \
585   product(intx, EliminateAllocationFieldsLimit, 512, DIAGNOSTIC,            \
586           "Number of fields in instance limit for scalar replacement")      \
587           range(0, max_jint)                                                \
588                                                                             \
589   product(bool, OptimizePtrCompare, true,                                   \
590           "Use escape analysis to optimize pointers compare")               \
591                                                                             \
592   develop(bool, PrintOptimizePtrCompare, false,                             \
593           "Print information about optimized pointers compare")             \
594                                                                             \
595   develop(bool, VerifyConnectionGraph , true,                               \
596           "Verify Connection Graph construction in Escape Analysis")        \
597                                                                             \
598   product(bool, OptimizeStringConcat, true,                                 \
599           "Optimize the construction of Strings by StringBuilder")          \
600                                                                             \
601   develop(bool, PrintOptimizeStringConcat, false,                           \
602           "Print information about transformations performed on Strings")   \
603                                                                             \
604   product(intx, ValueSearchLimit, 1000,                                     \
605           "Recursion limit in PhaseMacroExpand::value_from_mem_phi")        \
606           range(0, max_jint)                                                \
607                                                                             \
608   product(intx, MaxLabelRootDepth, 1100,                                    \
609           "Maximum times call Label_Root to prevent stack overflow")        \
610           range(100, max_jint)                                              \
611                                                                             \
612   product(intx, DominatorSearchLimit, 1000, DIAGNOSTIC,                     \
613           "Iterations limit in Node::dominates")                            \
614           range(0, max_jint)                                                \
615                                                                             \
616   product(bool, BlockLayoutByFrequency, true,                               \
617           "Use edge frequencies to drive block ordering")                   \
618                                                                             \
619   product(intx, BlockLayoutMinDiamondPercentage, 20,                        \
620           "Minimum %% of a successor (predecessor) for which block "        \
621           "layout a will allow a fork (join) in a single chain")            \
622           range(0, 100)                                                     \
623                                                                             \
624   product(bool, BlockLayoutRotateLoops, true,                               \
625           "Allow back branches to be fall throughs in the block layout")    \
626                                                                             \
627   product(bool, InlineReflectionGetCallerClass, true, DIAGNOSTIC,           \
628           "inline sun.reflect.Reflection.getCallerClass(), known to be "    \
629           "part of base library DLL")                                       \
630                                                                             \
631   product(bool, InlineObjectCopy, true, DIAGNOSTIC,                         \
632           "inline Object.clone and Arrays.copyOf[Range] intrinsics")        \
633                                                                             \
634   product(bool, SpecialStringCompareTo, true, DIAGNOSTIC,                   \
635           "special version of string compareTo")                            \
636                                                                             \
637   product(bool, SpecialStringIndexOf, true, DIAGNOSTIC,                     \
638           "special version of string indexOf")                              \
639                                                                             \
640   product(bool, SpecialStringEquals, true, DIAGNOSTIC,                      \
641           "special version of string equals")                               \
642                                                                             \
643   product(bool, SpecialArraysEquals, true, DIAGNOSTIC,                      \
644           "special version of Arrays.equals(char[],char[])")                \
645                                                                             \
646   product(bool, SpecialEncodeISOArray, true, DIAGNOSTIC,                    \
647           "special version of ISO_8859_1$Encoder.encodeISOArray")           \
648                                                                             \
649   develop(bool, BailoutToInterpreterForThrows, false,                       \
650           "Compiled methods which throws/catches exceptions will be "       \
651           "deopt and intp.")                                                \
652                                                                             \
653   develop(bool, ConvertCmpD2CmpF, true,                                     \
654           "Convert cmpD to cmpF when one input is constant in float range") \
655                                                                             \
656   develop(bool, ConvertFloat2IntClipping, true,                             \
657           "Convert float2int clipping idiom to integer clipping")           \
658                                                                             \
659   develop(bool, MonomorphicArrayCheck, true,                                \
660           "Uncommon-trap array store checks that require full type check")  \
661                                                                             \
662   develop(bool, TracePhaseCCP, false,                                       \
663           "Print progress during Conditional Constant Propagation")         \
664                                                                             \
665   develop(bool, PrintDominators, false,                                     \
666           "Print out dominator trees for GVN")                              \
667                                                                             \
668   product(bool, TraceSpilling, false, DIAGNOSTIC,                           \
669           "Trace spilling")                                                 \
670                                                                             \
671   product(bool, TraceTypeProfile, false, DIAGNOSTIC,                        \
672           "Trace type profile")                                             \
673                                                                             \
674   develop(bool, PoisonOSREntry, true,                                       \
675            "Detect abnormal calls to OSR code")                             \
676                                                                             \
677   develop(bool, SoftMatchFailure, trueInProduct,                            \
678           "If the DFA fails to match a node, print a message and bail out") \
679                                                                             \
680   develop(bool, InlineAccessors, true,                                      \
681           "inline accessor methods (get/set)")                              \
682                                                                             \
683   product(intx, TypeProfileMajorReceiverPercent, 90,                        \
684           "% of major receiver type to all profiled receivers")             \
685           range(0, 100)                                                     \
686                                                                             \
687   product(bool, PrintIntrinsics, false, DIAGNOSTIC,                         \
688           "prints attempted and successful inlining of intrinsics")         \
689                                                                             \
690   develop(bool, StressReflectiveCode, false,                                \
691           "Use inexact types at allocations, etc., to test reflection")     \
692                                                                             \
693   product(bool, DebugInlinedCalls, true, DIAGNOSTIC,                        \
694          "If false, restricts profiled locations to the root method only")  \
695                                                                             \
696   develop(bool, VerifyLoopOptimizations, false,                             \
697           "verify major loop optimizations")                                \
698                                                                             \
699   develop(bool, VerifyNoNewIrreducibleLoops, false,                         \
700           "Verify that no new irreducible loops are created after parsing") \
701                                                                             \
702   product(bool, ProfileDynamicTypes, true, DIAGNOSTIC,                      \
703           "do extra type profiling and use it more aggressively")           \
704                                                                             \
705   develop(bool, TraceIterativeGVN, false,                                   \
706           "Print progress during Iterative Global Value Numbering")         \
707                                                                             \
708   develop(bool, UseDeepIGVNRevisit, true,                                   \
709           "Re-process nodes that could benefit from a deep revisit after "  \
710           "the IGVN worklist drains")                                       \
711                                                                             \
712   develop(uint, VerifyIterativeGVN, 0,                                      \
713           "Verify Iterative Global Value Numbering =FEDCBA, with:"          \
714           "  F: verify Node::Ideal does not return nullptr if the node"     \
715                 "hash has changed"                                          \
716           "  E: verify node specific invariants"                            \
717           "  D: verify Node::Identity did not miss opportunities"           \
718           "  C: verify Node::Ideal did not miss opportunities"              \
719           "  B: verify that type(n) == n->Value() after IGVN"               \
720           "  A: verify Def-Use modifications during IGVN"                   \
721           "Each can be 0=off or 1=on")                                      \
722           constraint(VerifyIterativeGVNConstraintFunc, AtParse)             \
723                                                                             \
724   develop(bool, TraceCISCSpill, false,                                      \
725           "Trace allocators use of cisc spillable instructions")            \
726                                                                             \
727   product(bool, SplitIfBlocks, true,                                        \
728           "Clone compares and control flow through merge points to fold "   \
729           "some branches")                                                  \
730                                                                             \
731   develop(intx, FreqCountInvocations,  1,                                   \
732           "Scaling factor for branch frequencies (deprecated)")             \
733           range(1, max_intx)                                                \
734                                                                             \
735   develop(bool, VerifyAliases, false,                                       \
736           "perform extra checks on the results of alias analysis")          \
737                                                                             \
738   product(uint, VerifyConstraintCasts, 0, DIAGNOSTIC,                       \
739           "Perform runtime checks to verify the value of a "                \
740           "ConstraintCast lies inside its type"                             \
741           "0 = does not perform any verification, "                         \
742           "1 = perform verification on ConstraintCastNodes that are "       \
743               "present during code emission, "                              \
744           "2 = Do not do widening of ConstraintCastNodes so that we can "   \
745               "have more verification coverage")                            \
746           range(0, 2)                                                       \
747                                                                             \
748   product(intx, MaxInlineLevel, 15,                                         \
749           "maximum number of nested calls that are inlined by high tier "   \
750           "compiler")                                                       \
751           range(0, max_jint)                                                \
752                                                                             \
753   product(intx, MaxRecursiveInlineLevel, 1,                                 \
754           "maximum number of nested recursive calls that are inlined by "   \
755           "high tier compiler")                                             \
756           range(0, max_jint)                                                \
757                                                                             \
758   product_pd(intx, InlineSmallCode,                                         \
759           "Only inline already compiled methods if their code size is "     \
760           "less than this")                                                 \
761           range(0, max_jint)                                                \
762                                                                             \
763   product(intx, MaxInlineSize, 35,                                          \
764           "The maximum bytecode size of a method to be inlined by high "    \
765           "tier compiler")                                                  \
766           range(0, max_jint)                                                \
767                                                                             \
768   product_pd(intx, FreqInlineSize,                                          \
769           "The maximum bytecode size of a frequent method to be inlined")   \
770           range(0, max_jint)                                                \
771                                                                             \
772   product(intx, MaxTrivialSize, 6,                                          \
773           "The maximum bytecode size of a trivial method to be inlined by " \
774           "high tier compiler")                                             \
775           range(0, max_jint)                                                \
776                                                                             \
777   product(bool, IncrementalInline, true,                                    \
778           "do post parse inlining")                                         \
779                                                                             \
780   product(bool, IncrementalInlineMH, true, DIAGNOSTIC,                      \
781           "do post parse inlining of method handle calls")                  \
782                                                                             \
783   product(bool, IncrementalInlineVirtual, true, DIAGNOSTIC,                 \
784           "do post parse inlining of virtual calls")                        \
785                                                                             \
786   develop(bool, AlwaysIncrementalInline, false,                             \
787           "do all inlining incrementally")                                  \
788                                                                             \
789   product(bool, IncrementalInlineForceCleanup, false, DIAGNOSTIC,           \
790           "do cleanup after every iteration of incremental inlining")       \
791                                                                             \
792   product(intx, LiveNodeCountInliningCutoff, 40000,                         \
793           "max number of live nodes in a method")                           \
794           range(0, max_juint / 8)                                           \
795                                                                             \
796   product(bool, OptimizeExpensiveOps, true, DIAGNOSTIC,                     \
797           "Find best control for expensive operations")                     \
798                                                                             \
799   product(bool, UseMathExactIntrinsics, true, DIAGNOSTIC,                   \
800           "Enables intrinsification of various java.lang.Math functions")   \
801                                                                             \
802   product(bool, UseCharacterCompareIntrinsics, false, DIAGNOSTIC,           \
803           "Enables intrinsification of java.lang.Character functions")      \
804                                                                             \
805   product(bool, UseMultiplyToLenIntrinsic, false, DIAGNOSTIC,               \
806           "Enables intrinsification of BigInteger.multiplyToLen()")         \
807                                                                             \
808   product(bool, UseSquareToLenIntrinsic, false, DIAGNOSTIC,                 \
809           "Enables intrinsification of BigInteger.squareToLen()")           \
810                                                                             \
811   product(bool, UseMulAddIntrinsic, false, DIAGNOSTIC,                      \
812           "Enables intrinsification of BigInteger.mulAdd()")                \
813                                                                             \
814   product(bool, UseMontgomeryMultiplyIntrinsic, false, DIAGNOSTIC,          \
815           "Enables intrinsification of BigInteger.montgomeryMultiply()")    \
816                                                                             \
817   product(bool, UseMontgomerySquareIntrinsic, false, DIAGNOSTIC,            \
818           "Enables intrinsification of BigInteger.montgomerySquare()")      \
819                                                                             \
820   product(bool, EnableVectorSupport, false, EXPERIMENTAL,                   \
821           "Enables VectorSupport intrinsics")                               \
822                                                                             \
823   product(bool, EnableVectorReboxing, false, EXPERIMENTAL,                  \
824           "Enables reboxing of vectors")                                    \
825                                                                             \
826   product(bool, EnableVectorAggressiveReboxing, false, EXPERIMENTAL,        \
827           "Enables aggressive reboxing of vectors")                         \
828                                                                             \
829   product(bool, UseTypeSpeculation, true,                                   \
830           "Speculatively propagate types from profiles")                    \
831                                                                             \
832   product(bool, UseInlineDepthForSpeculativeTypes, true, DIAGNOSTIC,        \
833           "Carry inline depth of profile point with speculative type "      \
834           "and give priority to profiling from lower inline depth")         \
835                                                                             \
836   product_pd(bool, TrapBasedRangeChecks,                                    \
837           "Generate code for range checks that uses a cmp and trap "        \
838           "instruction raising SIGTRAP. Used on PPC64.")                    \
839                                                                             \
840   product(intx, ArrayCopyLoadStoreMaxElem, 8,                               \
841           "Maximum number of arraycopy elements inlined as a sequence of"   \
842           "loads/stores")                                                   \
843           range(0, max_intx)                                                \
844                                                                             \
845   develop(bool, StressArrayCopyMacroNode, false,                            \
846           "Perform ArrayCopy load/store replacement during IGVN only")      \
847                                                                             \
848   develop(bool, RenumberLiveNodes, true,                                    \
849           "Renumber live nodes")                                            \
850                                                                             \
851   product(uintx, LoopStripMiningIter, 0,                                    \
852           "Number of iterations in strip mined loop")                       \
853           range(0, max_juint)                                               \
854           constraint(LoopStripMiningIterConstraintFunc, AfterErgo)          \
855                                                                             \
856   product(uintx, LoopStripMiningIterShortLoop, 0,                           \
857           "Loop with fewer iterations are not strip mined")                 \
858           range(0, max_juint)                                               \
859                                                                             \
860   product(bool, UseProfiledLoopPredicate, true,                             \
861           "Move checks with an uncommon trap out of loops based on "        \
862           "profiling data. "                                                \
863           "Requires UseLoopPredicate to be turned on (default).")           \
864                                                                             \
865   product(bool, UseArrayLoadStoreProfile, true, DIAGNOSTIC,                 \
866           "Take advantage of profiling at array load/store")                \
867                                                                             \
868   product(bool, UseACmpProfile, true, DIAGNOSTIC,                           \
869           "Take advantage of profiling at if_acmp<cond>")                   \
870                                                                             \
871   develop(uintx, StressLongCountedLoop, 0,                                  \
872           "if > 0, convert int counted loops to long counted loops"         \
873           "to stress handling of long counted loops: run inner loop"        \
874           "for at most jint_max / StressLongCountedLoop")                   \
875           range(0, max_juint)                                               \
876                                                                             \
877   product(bool, DuplicateBackedge, true, DIAGNOSTIC,                        \
878           "Transform loop with a merge point into 2 loops if inner loop is" \
879           "expected to optimize better")                                    \
880                                                                             \
881   develop(bool, StressDuplicateBackedge, false,                             \
882           "Run DuplicateBackedge whenever possible ignoring benefit"        \
883           "analysis")                                                       \
884                                                                             \
885   product(bool, VerifyReceiverTypes, trueInDebug, DIAGNOSTIC,               \
886           "Verify receiver types at runtime")                               \
887                                                                             \
888   product(intx, TypeProfileSubTypeCheckCommonThreshold, 50,                 \
889           "Use profile data at type check if profiled types account for"    \
890           "more than this threshold")                                       \
891           range(0, 100)                                                     \
892                                                                             \
893   develop(bool, StressPrunedExceptionHandlers, false,                       \
894           "Always prune exception handlers")                                \
895                                                                             \
896   product(bool, InlineSecondarySupersTest, true, DIAGNOSTIC,                \
897           "Inline the secondary supers hash lookup.")                       \
898                                                                             \
899   product(bool, UseStoreStoreForCtor, true, DIAGNOSTIC,                     \
900           "Use StoreStore barrier instead of Release barrier at the end "   \
901           "of constructors")                                                \
902                                                                             \
903   develop(bool, KillPathsReachableByDeadTypeNode, true,                     \
904           "When a Type node becomes top, make paths where the node is "     \
905           "used dead by replacing them with a Halt node. Turning this off " \
906           "could corrupt the graph in rare cases and should be used with "  \
907           "care.")                                                          \
908                                                                             \
909   product(bool, ShortRunningLongLoop, true, DIAGNOSTIC,                     \
910           "long counted loop/long range checks: don't create loop nest if " \
911           "loop runs for small enough number of iterations. Long loop is "  \
912           "converted to a single int loop.")                                \
913                                                                             \
914   develop(bool, StressShortRunningLongLoop, false,                          \
915           "Speculate all long counted loops are short running when bounds " \
916           "are unknown even if profile data doesn't say so.")               \
917                                                                             \
918   develop(bool, StressLoopPeeling, false,                                   \
919           "Randomize loop peeling decision")                                \
920                                                                             \
921   develop(bool, StressCountedLoop, false,                                   \
922           "Randomly delay conversion to counted loops")                     \
923 
924 // end of C2_FLAGS
925 
926 DECLARE_FLAGS(C2_FLAGS)
927 
928 #endif // SHARE_OPTO_C2_GLOBALS_HPP