1 /*
  2  * Copyright (c) 2000, 2025, 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, TraceLoopLimitCheck, false,                                 \
253           "Trace generation of loop limits checks")                         \
254                                                                             \
255   develop(bool, TraceRangeLimitCheck, false,                                \
256           "Trace additional overflow checks in RCE")                        \
257                                                                             \
258   /* OptimizeFill not yet supported on PowerPC. */                          \
259   product(bool, OptimizeFill, true PPC64_ONLY(&& false),                    \
260           "convert fill/copy loops into intrinsic")                         \
261                                                                             \
262   develop(bool, TraceOptimizeFill, false,                                   \
263           "print detailed information about fill conversion")               \
264                                                                             \
265   develop(bool, OptoCoalesce, true,                                         \
266           "Use Conservative Copy Coalescing in the Register Allocator")     \
267                                                                             \
268   develop(bool, UseUniqueSubclasses, true,                                  \
269           "Narrow an abstract reference to the unique concrete subclass")   \
270                                                                             \
271   product(intx, TrackedInitializationLimit, 50,                             \
272           "When initializing fields, track up to this many words")          \
273           range(0, 65535)                                                   \
274                                                                             \
275   product(bool, ReduceFieldZeroing, true,                                   \
276           "When initializing fields, try to avoid needless zeroing")        \
277                                                                             \
278   product(bool, ReduceInitialCardMarks, true,                               \
279           "When initializing fields, try to avoid needless card marks")     \
280                                                                             \
281   product(bool, ReduceBulkZeroing, true,                                    \
282           "When bulk-initializing, try to avoid needless zeroing")          \
283                                                                             \
284   product(bool, UseFPUForSpilling, false,                                   \
285           "Spill integer registers to FPU instead of stack when possible")  \
286                                                                             \
287   develop_pd(intx, RegisterCostAreaRatio,                                   \
288           "Spill selection in reg allocator: scale area by (X/64K) before " \
289           "adding cost")                                                    \
290                                                                             \
291   develop_pd(bool, UseCISCSpill,                                            \
292           "Use ADLC supplied cisc instructions during allocation")          \
293                                                                             \
294   develop(bool, VerifyGraphEdges , false,                                   \
295           "Verify Bi-directional Edges")                                    \
296                                                                             \
297   develop(bool, VerifyDUIterators, true,                                    \
298           "Verify the safety of all iterations of Bi-directional Edges")    \
299                                                                             \
300   develop(bool, VerifyHashTableKeys, true,                                  \
301           "Verify the immutability of keys in the VN hash tables")          \
302                                                                             \
303   develop(bool, VerifyRegisterAllocator , false,                            \
304           "Verify Register Allocator")                                      \
305                                                                             \
306   develop(intx, FLOATPRESSURE, -1,                                          \
307           "Number of float LRG's that constitute high register pressure."   \
308           "-1: means the threshold is determined by number of available "   \
309           "float register for allocation")                                  \
310           range(-1, max_jint)                                               \
311                                                                             \
312   develop(intx, INTPRESSURE, -1,                                            \
313           "Number of integer LRG's that constitute high register pressure." \
314           "-1: means the threshold is determined by number of available "   \
315           "integer register for allocation")                                \
316           range(-1, max_jint)                                               \
317                                                                             \
318   develop(bool, TraceOptoPipelining, false,                                 \
319           "Trace pipelining information")                                   \
320                                                                             \
321   develop(bool, TraceOptoOutput, false,                                     \
322           "Trace pipelining information")                                   \
323                                                                             \
324   product_pd(bool, OptoScheduling,                                          \
325           "Instruction Scheduling after register allocation")               \
326                                                                             \
327   product_pd(bool, OptoRegScheduling,                                       \
328           "Instruction Scheduling before register allocation for pressure") \
329                                                                             \
330   product(bool, PartialPeelLoop, true,                                      \
331           "Partial peel (rotate) loops")                                    \
332                                                                             \
333   product(intx, PartialPeelNewPhiDelta, 0,                                  \
334           "Additional phis that can be created by partial peeling")         \
335           range(0, max_jint)                                                \
336                                                                             \
337   develop(bool, TracePartialPeeling, false,                                 \
338           "Trace partial peeling (loop rotation) information")              \
339                                                                             \
340   product(bool, PartialPeelAtUnsignedTests, true,                           \
341           "Partial peel at unsigned tests if no signed test exists")        \
342                                                                             \
343   product(bool, ReassociateInvariants, true,                                \
344           "Enable reassociation of expressions with loop invariants.")      \
345                                                                             \
346   product(bool, LoopUnswitching, true,                                      \
347           "Enable loop unswitching (a form of invariant test hoisting)")    \
348                                                                             \
349   develop(bool, TraceLoopUnswitching, false,                                \
350           "Trace loop unswitching")                                         \
351                                                                             \
352   product(bool, LoopMultiversioning, true, DIAGNOSTIC,                      \
353           "Enable loop multiversioning (for speculative compilation)")      \
354                                                                             \
355   develop(bool, TraceLoopMultiversioning, false,                            \
356           "Trace loop multiversioning")                                     \
357                                                                             \
358   product(bool, AllowVectorizeOnDemand, true,                               \
359           "Globally suppress vectorization set in VectorizeMethod")         \
360                                                                             \
361   product(bool, UseSuperWord, true,                                         \
362           "Transform scalar operations into superword operations")          \
363                                                                             \
364   product(bool, SuperWordReductions, true,                                  \
365           "Enable reductions support in superword.")                        \
366                                                                             \
367   product_pd(uint, SuperWordStoreToLoadForwardingFailureDetection, DIAGNOSTIC, \
368           "if >0, auto-vectorization detects possible store-to-load "       \
369           "forwarding failures. The number specifies over how many "        \
370           "loop iterations this detection spans.")                          \
371           range(0, 4096)                                                    \
372                                                                             \
373   product(uint, SuperWordAutomaticAlignment, 1, DIAGNOSTIC,                 \
374           "0 = Disabled (unless AlignVector is enabled)"                    \
375           "Else: align with a load or store of the largest vector width,"   \
376           "      and if there are loads and stores of the largest width:"   \
377           "1 = Prefer alignment with vector store (default)"                \
378           "2 = Prefer alignment with vector load.")                         \
379           range(0, 2)                                                       \
380                                                                             \
381   product(uint, AutoVectorizationOverrideProfitability, 1, DIAGNOSTIC,      \
382           "Override the auto vectorization profitability heuristics."       \
383           "0 = Run auto vectorizer, but abort just before applying"         \
384           "    vectorization, as though it was not profitable."             \
385           "1 = Run auto vectorizer with the default profitability"          \
386           "    heuristics. This is the default, and hopefully"              \
387           "    delivers the best performance."                              \
388           "2 = Run auto vectorizer, and vectorize even if the"              \
389           "    profitability heuristics predict that vectorization"         \
390           "    is not profitable.")                                         \
391           range(0, 2)                                                       \
392                                                                             \
393   product(bool, UseCMoveUnconditionally, false,                             \
394           "Use CMove (scalar and vector) ignoring profitability test.")     \
395                                                                             \
396   develop(bool, TraceSuperWord, false,                                      \
397           "Trace superword transforms")                                     \
398                                                                             \
399   develop(bool, TraceNewVectors, false,                                     \
400           "Trace creation of Vector nodes")                                 \
401                                                                             \
402   product(bool, MergeStores, true, DIAGNOSTIC,                              \
403           "Optimize stores by combining values into larger store")          \
404                                                                             \
405   product_pd(bool, OptoBundling,                                            \
406           "Generate nops to fill i-cache lines")                            \
407                                                                             \
408   product_pd(intx, ConditionalMoveLimit,                                    \
409           "Limit of ops to make speculative when using CMOVE")              \
410           range(0, max_jint)                                                \
411                                                                             \
412   develop(intx, PrintPhaseLevel, 0,                                         \
413           "Level of detail of the phase trace print. "                      \
414           "System-wide value, -1=printing is disabled, "                    \
415           "0=print nothing except PhasePrintLevel directives, "             \
416           "6=all details printed. "                                         \
417           "Level of detail of printouts can be set on a per-method level "  \
418           "as well by using CompileCommand=PrintPhaseLevel.")                        \
419           range(-1, 6)                                                      \
420                                                                             \
421   develop(bool, PrintIdealGraph, false,                                     \
422           "Print ideal graph to XML file / network interface. "             \
423           "By default attempts to connect to the visualizer on a socket.")  \
424                                                                             \
425   develop(intx, PrintIdealGraphLevel, 0,                                    \
426           "Level of detail of the ideal graph printout. "                   \
427           "System-wide value, -1=printing is disabled, "                    \
428           "0=print nothing except IGVPrintLevel directives, "               \
429           "6=all details printed. "                                         \
430           "Level of detail of printouts can be set on a per-method level "  \
431           "as well by using CompileCommand=option.")                        \
432           range(-1, 6)                                                      \
433                                                                             \
434   develop(intx, PrintIdealGraphPort, 4444,                                  \
435           "Ideal graph printer to network port")                            \
436           range(0, SHRT_MAX)                                                \
437                                                                             \
438   develop(ccstr, PrintIdealGraphAddress, "127.0.0.1",                       \
439           "IP address to connect to visualizer")                            \
440                                                                             \
441   develop(ccstr, PrintIdealGraphFile, nullptr,                              \
442           "File to dump ideal graph to.  If set overrides the "             \
443           "use of the network")                                             \
444                                                                             \
445   product(bool, UseBimorphicInlining, true,                                 \
446           "Profiling based inlining for two receivers")                     \
447                                                                             \
448   product(bool, UseOnlyInlinedBimorphic, true,                              \
449           "Don't use BimorphicInlining if can't inline a second method")    \
450                                                                             \
451   develop(bool, SubsumeLoads, true,                                         \
452           "Attempt to compile while subsuming loads into machine "          \
453           "instructions.")                                                  \
454                                                                             \
455   develop(bool, StressRecompilation, false,                                 \
456           "Recompile each compiled method without subsuming loads "         \
457           "or escape analysis.")                                            \
458                                                                             \
459   develop(intx, ImplicitNullCheckThreshold, 3,                              \
460           "Don't do implicit null checks if NPE's in a method exceeds "     \
461           "limit")                                                          \
462           range(0, max_jint)                                                \
463                                                                             \
464   product(intx, LoopOptsCount, 43,                                          \
465           "Set level of loop optimization for tier 1 compiles")             \
466           range(5, max_jint)                                                \
467                                                                             \
468   product(bool, OptimizeUnstableIf, true, DIAGNOSTIC,                       \
469           "Optimize UnstableIf traps")                                      \
470                                                                             \
471   /* controls for heat-based inlining */                                    \
472                                                                             \
473   develop(intx, NodeCountInliningCutoff, 18000,                             \
474           "If parser node generation exceeds limit stop inlining")          \
475           range(0, max_jint)                                                \
476                                                                             \
477   product(intx, MaxNodeLimit, 80000,                                        \
478           "Maximum number of nodes")                                        \
479           range(1000, max_jint / 3)                                         \
480                                                                             \
481   product(intx, NodeLimitFudgeFactor, 2000,                                 \
482           "Fudge Factor for certain optimizations")                         \
483           constraint(NodeLimitFudgeFactorConstraintFunc, AfterErgo)         \
484                                                                             \
485   product(bool, UseJumpTables, true,                                        \
486           "Use JumpTables instead of a binary search tree for switches")    \
487                                                                             \
488   product(bool, UseDivMod, true,                                            \
489           "Use combined DivMod instruction if available")                   \
490                                                                             \
491   product_pd(intx, MinJumpTableSize,                                        \
492           "Minimum number of targets in a generated jump table")            \
493           range(0, max_intx)                                                \
494                                                                             \
495   product(intx, MaxJumpTableSize, 65000,                                    \
496           "Maximum number of targets in a generated jump table")            \
497           range(0, max_intx)                                                \
498                                                                             \
499   product(intx, MaxJumpTableSparseness, 5,                                  \
500           "Maximum sparseness for jumptables")                              \
501           range(0, max_intx / 4)                                            \
502                                                                             \
503   product(bool, EliminateLocks, true,                                       \
504           "Coarsen locks when possible")                                    \
505                                                                             \
506   product(bool, EliminateNestedLocks, true,                                 \
507           "Eliminate nested locks of the same object when possible")        \
508                                                                             \
509   develop(bool, PrintLockStatistics, false,                                 \
510           "Print precise statistics on the dynamic lock usage")             \
511                                                                             \
512   develop(bool, PrintEliminateLocks, false,                                 \
513           "Print out when locks are eliminated")                            \
514                                                                             \
515   product(bool, EliminateAutoBox, true,                                     \
516           "Control optimizations for autobox elimination")                  \
517                                                                             \
518   product(intx, AutoBoxCacheMax, 128,                                       \
519           "Sets max value cached by the java.lang.Integer autobox cache")   \
520           range(0, max_jint)                                                \
521                                                                             \
522   product(bool, AggressiveUnboxing, true, DIAGNOSTIC,                       \
523           "Control optimizations for aggressive boxing elimination")        \
524                                                                             \
525   develop(bool, TracePostallocExpand, false, "Trace expanding nodes after"  \
526           " register allocation.")                                          \
527                                                                             \
528   product(bool, ReduceAllocationMerges, true, DIAGNOSTIC,                   \
529           "Try to simplify allocation merges before Scalar Replacement")    \
530                                                                             \
531   develop(bool, TraceReduceAllocationMerges, false,                         \
532              "Trace decision for simplifying allocation merges.")           \
533                                                                             \
534   develop(bool, VerifyReduceAllocationMerges, true,                         \
535           "Verify reduce allocation merges in escape analysis")             \
536                                                                             \
537   product(bool, DoEscapeAnalysis, true,                                     \
538           "Perform escape analysis")                                        \
539                                                                             \
540   product(double, EscapeAnalysisTimeout, 20. DEBUG_ONLY(+40.),              \
541           "Abort EA when it reaches time limit (in sec)")                   \
542           range(0, DBL_MAX)                                                 \
543                                                                             \
544   develop(bool, ExitEscapeAnalysisOnTimeout, true,                          \
545           "Exit or throw assert in EA when it reaches time limit")          \
546                                                                             \
547   develop(bool, PrintEscapeAnalysis, false,                                 \
548           "Print the results of escape analysis")                           \
549                                                                             \
550   product(bool, EliminateAllocations, true,                                 \
551           "Use escape analysis to eliminate allocations")                   \
552                                                                             \
553   develop(bool, PrintEliminateAllocations, false,                           \
554           "Print out when allocations are eliminated")                      \
555                                                                             \
556   product(intx, EliminateAllocationArraySizeLimit, 64,                      \
557           "Array size (number of elements) limit for scalar replacement")   \
558           range(0, max_jint)                                                \
559                                                                             \
560   product(intx, EliminateAllocationFieldsLimit, 512, DIAGNOSTIC,            \
561           "Number of fields in instance limit for scalar replacement")      \
562           range(0, max_jint)                                                \
563                                                                             \
564   product(bool, OptimizePtrCompare, true,                                   \
565           "Use escape analysis to optimize pointers compare")               \
566                                                                             \
567   develop(bool, PrintOptimizePtrCompare, false,                             \
568           "Print information about optimized pointers compare")             \
569                                                                             \
570   develop(bool, VerifyConnectionGraph , true,                               \
571           "Verify Connection Graph construction in Escape Analysis")        \
572                                                                             \
573   product(bool, OptimizeStringConcat, true,                                 \
574           "Optimize the construction of Strings by StringBuilder")          \
575                                                                             \
576   develop(bool, PrintOptimizeStringConcat, false,                           \
577           "Print information about transformations performed on Strings")   \
578                                                                             \
579   product(intx, ValueSearchLimit, 1000,                                     \
580           "Recursion limit in PhaseMacroExpand::value_from_mem_phi")        \
581           range(0, max_jint)                                                \
582                                                                             \
583   product(intx, MaxLabelRootDepth, 1100,                                    \
584           "Maximum times call Label_Root to prevent stack overflow")        \
585           range(100, max_jint)                                              \
586                                                                             \
587   product(intx, DominatorSearchLimit, 1000, DIAGNOSTIC,                     \
588           "Iterations limit in Node::dominates")                            \
589           range(0, max_jint)                                                \
590                                                                             \
591   product(bool, BlockLayoutByFrequency, true,                               \
592           "Use edge frequencies to drive block ordering")                   \
593                                                                             \
594   product(intx, BlockLayoutMinDiamondPercentage, 20,                        \
595           "Minimum %% of a successor (predecessor) for which block "        \
596           "layout a will allow a fork (join) in a single chain")            \
597           range(0, 100)                                                     \
598                                                                             \
599   product(bool, BlockLayoutRotateLoops, true,                               \
600           "Allow back branches to be fall throughs in the block layout")    \
601                                                                             \
602   product(bool, InlineReflectionGetCallerClass, true, DIAGNOSTIC,           \
603           "inline sun.reflect.Reflection.getCallerClass(), known to be "    \
604           "part of base library DLL")                                       \
605                                                                             \
606   product(bool, InlineObjectCopy, true, DIAGNOSTIC,                         \
607           "inline Object.clone and Arrays.copyOf[Range] intrinsics")        \
608                                                                             \
609   product(bool, SpecialStringCompareTo, true, DIAGNOSTIC,                   \
610           "special version of string compareTo")                            \
611                                                                             \
612   product(bool, SpecialStringIndexOf, true, DIAGNOSTIC,                     \
613           "special version of string indexOf")                              \
614                                                                             \
615   product(bool, SpecialStringEquals, true, DIAGNOSTIC,                      \
616           "special version of string equals")                               \
617                                                                             \
618   product(bool, SpecialArraysEquals, true, DIAGNOSTIC,                      \
619           "special version of Arrays.equals(char[],char[])")                \
620                                                                             \
621   product(bool, SpecialEncodeISOArray, true, DIAGNOSTIC,                    \
622           "special version of ISO_8859_1$Encoder.encodeISOArray")           \
623                                                                             \
624   develop(bool, BailoutToInterpreterForThrows, false,                       \
625           "Compiled methods which throws/catches exceptions will be "       \
626           "deopt and intp.")                                                \
627                                                                             \
628   develop(bool, ConvertCmpD2CmpF, true,                                     \
629           "Convert cmpD to cmpF when one input is constant in float range") \
630                                                                             \
631   develop(bool, ConvertFloat2IntClipping, true,                             \
632           "Convert float2int clipping idiom to integer clipping")           \
633                                                                             \
634   develop(bool, MonomorphicArrayCheck, true,                                \
635           "Uncommon-trap array store checks that require full type check")  \
636                                                                             \
637   develop(bool, TracePhaseCCP, false,                                       \
638           "Print progress during Conditional Constant Propagation")         \
639                                                                             \
640   develop(bool, PrintDominators, false,                                     \
641           "Print out dominator trees for GVN")                              \
642                                                                             \
643   product(bool, TraceSpilling, false, DIAGNOSTIC,                           \
644           "Trace spilling")                                                 \
645                                                                             \
646   product(bool, TraceTypeProfile, false, DIAGNOSTIC,                        \
647           "Trace type profile")                                             \
648                                                                             \
649   develop(bool, PoisonOSREntry, true,                                       \
650            "Detect abnormal calls to OSR code")                             \
651                                                                             \
652   develop(bool, SoftMatchFailure, trueInProduct,                            \
653           "If the DFA fails to match a node, print a message and bail out") \
654                                                                             \
655   develop(bool, InlineAccessors, true,                                      \
656           "inline accessor methods (get/set)")                              \
657                                                                             \
658   product(intx, TypeProfileMajorReceiverPercent, 90,                        \
659           "% of major receiver type to all profiled receivers")             \
660           range(0, 100)                                                     \
661                                                                             \
662   product(bool, PrintIntrinsics, false, DIAGNOSTIC,                         \
663           "prints attempted and successful inlining of intrinsics")         \
664                                                                             \
665   develop(bool, StressReflectiveCode, false,                                \
666           "Use inexact types at allocations, etc., to test reflection")     \
667                                                                             \
668   product(bool, DebugInlinedCalls, true, DIAGNOSTIC,                        \
669          "If false, restricts profiled locations to the root method only")  \
670                                                                             \
671   develop(bool, VerifyLoopOptimizations, false,                             \
672           "verify major loop optimizations")                                \
673                                                                             \
674   develop(bool, VerifyNoNewIrreducibleLoops, false,                         \
675           "Verify that no new irreducible loops are created after parsing") \
676                                                                             \
677   product(bool, ProfileDynamicTypes, true, DIAGNOSTIC,                      \
678           "do extra type profiling and use it more aggressively")           \
679                                                                             \
680   develop(bool, TraceIterativeGVN, false,                                   \
681           "Print progress during Iterative Global Value Numbering")         \
682                                                                             \
683   develop(uint, VerifyIterativeGVN, 0,                                      \
684           "Verify Iterative Global Value Numbering =DCBA, with:"            \
685           "  D: verify Node::Identity did not miss opportunities"           \
686           "  C: verify Node::Ideal did not miss opportunities"              \
687           "  B: verify that type(n) == n->Value() after IGVN"               \
688           "  A: verify Def-Use modifications during IGVN"                   \
689           "Each can be 0=off or 1=on")                                      \
690           constraint(VerifyIterativeGVNConstraintFunc, AtParse)             \
691                                                                             \
692   develop(bool, TraceCISCSpill, false,                                      \
693           "Trace allocators use of cisc spillable instructions")            \
694                                                                             \
695   product(bool, SplitIfBlocks, true,                                        \
696           "Clone compares and control flow through merge points to fold "   \
697           "some branches")                                                  \
698                                                                             \
699   develop(intx, FreqCountInvocations,  1,                                   \
700           "Scaling factor for branch frequencies (deprecated)")             \
701           range(1, max_intx)                                                \
702                                                                             \
703   develop(bool, VerifyAliases, false,                                       \
704           "perform extra checks on the results of alias analysis")          \
705                                                                             \
706   product(uint, VerifyConstraintCasts, 0, DIAGNOSTIC,                       \
707           "Perform runtime checks to verify the value of a "                \
708           "ConstraintCast lies inside its type"                             \
709           "0 = does not perform any verification, "                         \
710           "1 = perform verification on ConstraintCastNodes that are "       \
711               "present during code emission, "                              \
712           "2 = Do not do widening of ConstraintCastNodes so that we can "   \
713               "have more verification coverage")                            \
714           range(0, 2)                                                       \
715                                                                             \
716   product(intx, MaxInlineLevel, 15,                                         \
717           "maximum number of nested calls that are inlined by high tier "   \
718           "compiler")                                                       \
719           range(0, max_jint)                                                \
720                                                                             \
721   product(intx, MaxRecursiveInlineLevel, 1,                                 \
722           "maximum number of nested recursive calls that are inlined by "   \
723           "high tier compiler")                                             \
724           range(0, max_jint)                                                \
725                                                                             \
726   product_pd(intx, InlineSmallCode,                                         \
727           "Only inline already compiled methods if their code size is "     \
728           "less than this")                                                 \
729           range(0, max_jint)                                                \
730                                                                             \
731   product(intx, MaxInlineSize, 35,                                          \
732           "The maximum bytecode size of a method to be inlined by high "    \
733           "tier compiler")                                                  \
734           range(0, max_jint)                                                \
735                                                                             \
736   product_pd(intx, FreqInlineSize,                                          \
737           "The maximum bytecode size of a frequent method to be inlined")   \
738           range(0, max_jint)                                                \
739                                                                             \
740   product(intx, MaxTrivialSize, 6,                                          \
741           "The maximum bytecode size of a trivial method to be inlined by " \
742           "high tier compiler")                                             \
743           range(0, max_jint)                                                \
744                                                                             \
745   product(bool, IncrementalInline, true,                                    \
746           "do post parse inlining")                                         \
747                                                                             \
748   product(bool, IncrementalInlineMH, true, DIAGNOSTIC,                      \
749           "do post parse inlining of method handle calls")                  \
750                                                                             \
751   product(bool, IncrementalInlineVirtual, true, DIAGNOSTIC,                 \
752           "do post parse inlining of virtual calls")                        \
753                                                                             \
754   develop(bool, AlwaysIncrementalInline, false,                             \
755           "do all inlining incrementally")                                  \
756                                                                             \
757   product(bool, IncrementalInlineForceCleanup, false, DIAGNOSTIC,           \
758           "do cleanup after every iteration of incremental inlining")       \
759                                                                             \
760   product(intx, LiveNodeCountInliningCutoff, 40000,                         \
761           "max number of live nodes in a method")                           \
762           range(0, max_juint / 8)                                           \
763                                                                             \
764   product(bool, OptimizeExpensiveOps, true, DIAGNOSTIC,                     \
765           "Find best control for expensive operations")                     \
766                                                                             \
767   product(bool, UseMathExactIntrinsics, true, DIAGNOSTIC,                   \
768           "Enables intrinsification of various java.lang.Math functions")   \
769                                                                             \
770   product(bool, UseCharacterCompareIntrinsics, false, DIAGNOSTIC,           \
771           "Enables intrinsification of java.lang.Character functions")      \
772                                                                             \
773   product(bool, UseMultiplyToLenIntrinsic, false, DIAGNOSTIC,               \
774           "Enables intrinsification of BigInteger.multiplyToLen()")         \
775                                                                             \
776   product(bool, UseSquareToLenIntrinsic, false, DIAGNOSTIC,                 \
777           "Enables intrinsification of BigInteger.squareToLen()")           \
778                                                                             \
779   product(bool, UseMulAddIntrinsic, false, DIAGNOSTIC,                      \
780           "Enables intrinsification of BigInteger.mulAdd()")                \
781                                                                             \
782   product(bool, UseMontgomeryMultiplyIntrinsic, false, DIAGNOSTIC,          \
783           "Enables intrinsification of BigInteger.montgomeryMultiply()")    \
784                                                                             \
785   product(bool, UseMontgomerySquareIntrinsic, false, DIAGNOSTIC,            \
786           "Enables intrinsification of BigInteger.montgomerySquare()")      \
787                                                                             \
788   product(bool, EnableVectorSupport, false, EXPERIMENTAL,                   \
789           "Enables VectorSupport intrinsics")                               \
790                                                                             \
791   product(bool, EnableVectorReboxing, false, EXPERIMENTAL,                  \
792           "Enables reboxing of vectors")                                    \
793                                                                             \
794   product(bool, EnableVectorAggressiveReboxing, false, EXPERIMENTAL,        \
795           "Enables aggressive reboxing of vectors")                         \
796                                                                             \
797   product(bool, UseTypeSpeculation, true,                                   \
798           "Speculatively propagate types from profiles")                    \
799                                                                             \
800   product(bool, UseInlineDepthForSpeculativeTypes, true, DIAGNOSTIC,        \
801           "Carry inline depth of profile point with speculative type "      \
802           "and give priority to profiling from lower inline depth")         \
803                                                                             \
804   product_pd(bool, TrapBasedRangeChecks,                                    \
805           "Generate code for range checks that uses a cmp and trap "        \
806           "instruction raising SIGTRAP. Used on PPC64.")                    \
807                                                                             \
808   product(intx, ArrayCopyLoadStoreMaxElem, 8,                               \
809           "Maximum number of arraycopy elements inlined as a sequence of"   \
810           "loads/stores")                                                   \
811           range(0, max_intx)                                                \
812                                                                             \
813   develop(bool, StressArrayCopyMacroNode, false,                            \
814           "Perform ArrayCopy load/store replacement during IGVN only")      \
815                                                                             \
816   develop(bool, RenumberLiveNodes, true,                                    \
817           "Renumber live nodes")                                            \
818                                                                             \
819   product(uintx, LoopStripMiningIter, 0,                                    \
820           "Number of iterations in strip mined loop")                       \
821           range(0, max_juint)                                               \
822           constraint(LoopStripMiningIterConstraintFunc, AfterErgo)          \
823                                                                             \
824   product(uintx, LoopStripMiningIterShortLoop, 0,                           \
825           "Loop with fewer iterations are not strip mined")                 \
826           range(0, max_juint)                                               \
827                                                                             \
828   product(bool, UseProfiledLoopPredicate, true,                             \
829           "Move checks with an uncommon trap out of loops based on "        \
830           "profiling data. "                                                \
831           "Requires UseLoopPredicate to be turned on (default).")           \
832                                                                             \
833   develop(uintx, StressLongCountedLoop, 0,                                  \
834           "if > 0, convert int counted loops to long counted loops"         \
835           "to stress handling of long counted loops: run inner loop"        \
836           "for at most jint_max / StressLongCountedLoop")                   \
837           range(0, max_juint)                                               \
838                                                                             \
839   product(bool, DuplicateBackedge, true, DIAGNOSTIC,                        \
840           "Transform loop with a merge point into 2 loops if inner loop is" \
841           "expected to optimize better")                                    \
842                                                                             \
843   develop(bool, StressDuplicateBackedge, false,                             \
844           "Run DuplicateBackedge whenever possible ignoring benefit"        \
845           "analysis")                                                       \
846                                                                             \
847   product(bool, VerifyReceiverTypes, trueInDebug, DIAGNOSTIC,               \
848           "Verify receiver types at runtime")                               \
849                                                                             \
850   product(intx, TypeProfileSubTypeCheckCommonThreshold, 50,                 \
851           "Use profile data at type check if profiled types account for"    \
852           "more than this threshold")                                       \
853           range(0, 100)                                                     \
854                                                                             \
855   develop(bool, StressPrunedExceptionHandlers, false,                       \
856           "Always prune exception handlers")                                \
857                                                                             \
858   product(bool, InlineSecondarySupersTest, true, DIAGNOSTIC,                \
859           "Inline the secondary supers hash lookup.")                       \
860                                                                             \
861   product(bool, UseStoreStoreForCtor, true, DIAGNOSTIC,                     \
862           "Use StoreStore barrier instead of Release barrier at the end "   \
863           "of constructors")                                                \
864                                                                             \
865   develop(bool, KillPathsReachableByDeadTypeNode, true,                     \
866           "When a Type node becomes top, make paths where the node is "     \
867           "used dead by replacing them with a Halt node. Turning this off " \
868           "could corrupt the graph in rare cases and should be used with "  \
869           "care.")                                                          \
870                                                                             \
871   develop(bool, StressLoopPeeling, false,                                   \
872           "Randomize loop peeling decision")                                \
873 
874 // end of C2_FLAGS
875 
876 DECLARE_FLAGS(C2_FLAGS)
877 
878 #endif // SHARE_OPTO_C2_GLOBALS_HPP