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