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