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