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