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