b3384031f355eb00d0c41204fef02f85eafa0cd6
[platform/upstream/dotnet/runtime.git] / src / coreclr / jit / jitconfigvalues.h
1 // Licensed to the .NET Foundation under one or more agreements.
2 // The .NET Foundation licenses this file to you under the MIT license.
3
4 #if !defined(CONFIG_INTEGER) || !defined(CONFIG_STRING) || !defined(CONFIG_METHODSET)
5 #error CONFIG_INTEGER, CONFIG_STRING, and CONFIG_METHODSET must be defined before including this file.
6 #endif // !defined(CONFIG_INTEGER) || !defined(CONFIG_STRING) || !defined(CONFIG_METHODSET)
7
8 #ifdef DEBUG
9 #define OPT_CONFIG // Enable optimization level configuration.
10 #endif
11
12 #if defined(DEBUG)
13
14 ///
15 /// JIT
16 ///
17 CONFIG_INTEGER(AltJitLimit, W("AltJitLimit"), 0)               // Max number of functions to use altjit for (decimal)
18 CONFIG_INTEGER(AltJitSkipOnAssert, W("AltJitSkipOnAssert"), 0) // If AltJit hits an assert, fall back to the fallback
19                                                                // JIT. Useful in conjunction with
20                                                                // DOTNET_ContinueOnAssert=1
21 CONFIG_INTEGER(BreakOnDumpToken, W("BreakOnDumpToken"), 0xffffffff) // Breaks when using internal logging on a
22                                                                     // particular token value.
23 CONFIG_INTEGER(DebugBreakOnVerificationFailure, W("DebugBreakOnVerificationFailure"), 0) // Halts the jit on
24                                                                                          // verification failure
25 CONFIG_INTEGER(JitDasmWithAddress, W("JitDasmWithAddress"), 0) // Print the process address next to each instruction of
26                                                                // the disassembly
27 CONFIG_INTEGER(DisplayLoopHoistStats, W("JitLoopHoistStats"), 0) // Display JIT loop hoisting statistics
28 CONFIG_INTEGER(DisplayLsraStats, W("JitLsraStats"), 0)      // Display JIT Linear Scan Register Allocator statistics
29                                                             // If set to "1", display the stats in textual format.
30                                                             // If set to "2", display the stats in csv format.
31                                                             // If set to "3", display the stats in summarize format.
32                                                             // Recommended to use with JitStdOutFile flag.
33 CONFIG_STRING(JitLsraOrdering, W("JitLsraOrdering"))        // LSRA heuristics ordering
34 CONFIG_INTEGER(EnablePCRelAddr, W("JitEnablePCRelAddr"), 1) // Whether absolute addr be encoded as PC-rel offset by
35                                                             // RyuJIT where possible
36 CONFIG_INTEGER(JitAssertOnMaxRAPasses, W("JitAssertOnMaxRAPasses"), 0)
37 CONFIG_INTEGER(JitBreakEmitOutputInstr, W("JitBreakEmitOutputInstr"), -1)
38 CONFIG_INTEGER(JitBreakMorphTree, W("JitBreakMorphTree"), 0xffffffff)
39 CONFIG_INTEGER(JitBreakOnBadCode, W("JitBreakOnBadCode"), 0)
40 CONFIG_INTEGER(JitBreakOnMinOpts, W("JITBreakOnMinOpts"), 0) // Halt if jit switches to MinOpts
41 CONFIG_INTEGER(JitCloneLoops, W("JitCloneLoops"), 1) // If 0, don't clone. Otherwise clone loops for optimizations.
42 CONFIG_INTEGER(JitCloneLoopsWithGdvTests, W("JitCloneLoopsWithGdvTests"), 1) // If 0, don't clone loops based on
43                                                                              // invariant type/method address tests
44 CONFIG_INTEGER(JitDebugLogLoopCloning, W("JitDebugLogLoopCloning"), 0) // In debug builds log places where loop cloning
45                                                                        // optimizations are performed on the fast path.
46 CONFIG_INTEGER(JitDefaultFill, W("JitDefaultFill"), 0xdd) // In debug builds, initialize the memory allocated by the nra
47                                                           // with this byte.
48 CONFIG_INTEGER(JitAlignLoopMinBlockWeight,
49                W("JitAlignLoopMinBlockWeight"),
50                DEFAULT_ALIGN_LOOP_MIN_BLOCK_WEIGHT) // Minimum weight needed for the first block of a loop to make it a
51                                                     // candidate for alignment.
52 CONFIG_INTEGER(JitAlignLoopMaxCodeSize,
53                W("JitAlignLoopMaxCodeSize"),
54                DEFAULT_MAX_LOOPSIZE_FOR_ALIGN) // For non-adaptive alignment, minimum loop size (in bytes) for which
55                                                // alignment will be done.
56                                                // Defaults to 3 blocks of 32 bytes chunks = 96 bytes.
57 CONFIG_INTEGER(JitAlignLoopBoundary,
58                W("JitAlignLoopBoundary"),
59                DEFAULT_ALIGN_LOOP_BOUNDARY) // For non-adaptive alignment, address boundary (power of 2) at which loop
60                                             // alignment should be done. By default, 32B.
61 CONFIG_INTEGER(JitAlignLoopForJcc,
62                W("JitAlignLoopForJcc"),
63                0) // If set, for non-adaptive alignment, ensure loop jmps are not on or cross alignment boundary.
64
65 CONFIG_INTEGER(JitAlignLoopAdaptive,
66                W("JitAlignLoopAdaptive"),
67                1) // If set, perform adaptive loop alignment that limits number of padding based on loop size.
68
69 CONFIG_INTEGER(JitHideAlignBehindJmp,
70                W("JitHideAlignBehindJmp"),
71                1) // If set, try to hide align instruction (if any) behind an unconditional jump instruction (if any)
72                   // that is present before the loop start.
73
74 CONFIG_INTEGER(JitOptimizeStructHiddenBuffer, W("JitOptimizeStructHiddenBuffer"), 1) // Track assignments to locals done
75                                                                                      // through return buffers.
76
77 CONFIG_INTEGER(JitUnrollLoopMaxIterationCount,
78                W("JitUnrollLoopMaxIterationCount"),
79                DEFAULT_UNROLL_LOOP_MAX_ITERATION_COUNT)
80
81 CONFIG_INTEGER(JitDirectAlloc, W("JitDirectAlloc"), 0)
82 CONFIG_INTEGER(JitDoubleAlign, W("JitDoubleAlign"), 1)
83 CONFIG_INTEGER(JitDumpASCII, W("JitDumpASCII"), 1)               // Uses only ASCII characters in tree dumps
84 CONFIG_INTEGER(JitDumpTerseLsra, W("JitDumpTerseLsra"), 1)       // Produce terse dump output for LSRA
85 CONFIG_INTEGER(JitDumpToDebugger, W("JitDumpToDebugger"), 0)     // Output JitDump output to the debugger
86 CONFIG_INTEGER(JitDumpVerboseSsa, W("JitDumpVerboseSsa"), 0)     // Produce especially verbose dump output for SSA
87 CONFIG_INTEGER(JitDumpVerboseTrees, W("JitDumpVerboseTrees"), 0) // Enable more verbose tree dumps
88 CONFIG_INTEGER(JitDumpTreeIDs, W("JitDumpTreeIDs"), 1)           // Print tree IDs in dumps
89 CONFIG_INTEGER(JitEmitPrintRefRegs, W("JitEmitPrintRefRegs"), 0)
90 CONFIG_INTEGER(JitEnableDevirtualization, W("JitEnableDevirtualization"), 1) // Enable devirtualization in importer
91 CONFIG_INTEGER(JitEnableLateDevirtualization, W("JitEnableLateDevirtualization"), 1) // Enable devirtualization after
92                                                                                      // inlining
93 CONFIG_INTEGER(JitExpensiveDebugCheckLevel, W("JitExpensiveDebugCheckLevel"), 0) // Level indicates how much checking
94                                                                                  // beyond the default to do in debug
95                                                                                  // builds (currently 1-2)
96 CONFIG_INTEGER(JitForceFallback, W("JitForceFallback"), 0) // Set to non-zero to test NOWAY assert by forcing a retry
97 CONFIG_INTEGER(JitFullyInt, W("JitFullyInt"), 0)           // Forces Fully interruptible code
98 CONFIG_INTEGER(JitFunctionTrace, W("JitFunctionTrace"), 0) // If non-zero, print JIT start/end logging
99 CONFIG_INTEGER(JitGCChecks, W("JitGCChecks"), 0)
100 CONFIG_INTEGER(JitGCInfoLogging, W("JitGCInfoLogging"), 0) // If true, prints GCInfo-related output to standard output.
101 CONFIG_INTEGER(JitHashBreak, W("JitHashBreak"), -1)        // Same as JitBreak, but for a method hash
102 CONFIG_INTEGER(JitHashDump, W("JitHashDump"), -1)          // Same as JitDump, but for a method hash
103 CONFIG_INTEGER(JitHashHalt, W("JitHashHalt"), -1)          // Same as JitHalt, but for a method hash
104 CONFIG_INTEGER(JitInlineAdditionalMultiplier, W("JitInlineAdditionalMultiplier"), 0)
105 CONFIG_INTEGER(JitInlinePrintStats, W("JitInlinePrintStats"), 0)
106 CONFIG_INTEGER(JitInlineSize, W("JITInlineSize"), DEFAULT_MAX_INLINE_SIZE)
107 CONFIG_INTEGER(JitInlineDepth, W("JITInlineDepth"), DEFAULT_MAX_INLINE_DEPTH)
108 CONFIG_INTEGER(JitForceInlineDepth, W("JITForceInlineDepth"), DEFAULT_MAX_FORCE_INLINE_DEPTH)
109 CONFIG_INTEGER(JitLongAddress, W("JitLongAddress"), 0) // Force using the large pseudo instruction form for long address
110 CONFIG_INTEGER(JitMaxUncheckedOffset, W("JitMaxUncheckedOffset"), 8)
111 CONFIG_INTEGER(JitMinOpts, W("JITMinOpts"), 0)                                       // Forces MinOpts
112 CONFIG_INTEGER(JitMinOptsBbCount, W("JITMinOptsBbCount"), DEFAULT_MIN_OPTS_BB_COUNT) // Internal jit control of MinOpts
113 CONFIG_INTEGER(JitMinOptsCodeSize, W("JITMinOptsCodeSize"), DEFAULT_MIN_OPTS_CODE_SIZE)       // Internal jit control of
114                                                                                               // MinOpts
115 CONFIG_INTEGER(JitMinOptsInstrCount, W("JITMinOptsInstrCount"), DEFAULT_MIN_OPTS_INSTR_COUNT) // Internal jit control of
116                                                                                               // MinOpts
117 CONFIG_INTEGER(JitMinOptsLvNumCount, W("JITMinOptsLvNumcount"), DEFAULT_MIN_OPTS_LV_NUM_COUNT) // Internal jit control
118                                                                                                // of MinOpts
119 CONFIG_INTEGER(JitMinOptsLvRefCount, W("JITMinOptsLvRefcount"), DEFAULT_MIN_OPTS_LV_REF_COUNT) // Internal jit control
120                                                                                                // of MinOpts
121 CONFIG_INTEGER(JitNoCSE, W("JitNoCSE"), 0)
122 CONFIG_INTEGER(JitNoCSE2, W("JitNoCSE2"), 0)
123 CONFIG_INTEGER(JitNoForceFallback, W("JitNoForceFallback"), 0) // Set to non-zero to prevent NOWAY assert testing.
124                                                                // Overrides DOTNET_JitForceFallback and JIT stress
125                                                                // flags.
126 CONFIG_INTEGER(JitNoForwardSub, W("JitNoForwardSub"), 0)       // Disables forward sub
127 CONFIG_INTEGER(JitNoHoist, W("JitNoHoist"), 0)
128 CONFIG_INTEGER(JitNoInline, W("JitNoInline"), 0)                 // Disables inlining of all methods
129 CONFIG_INTEGER(JitNoMemoryBarriers, W("JitNoMemoryBarriers"), 0) // If 1, don't generate memory barriers
130 CONFIG_INTEGER(JitNoRegLoc, W("JitNoRegLoc"), 0)
131 CONFIG_INTEGER(JitNoStructPromotion, W("JitNoStructPromotion"), 0) // Disables struct promotion 1 - for all, 2 - for
132                                                                    // params.
133 CONFIG_INTEGER(JitNoUnroll, W("JitNoUnroll"), 0)
134 CONFIG_INTEGER(JitOrder, W("JitOrder"), 0)
135 CONFIG_INTEGER(JitQueryCurrentStaticFieldClass, W("JitQueryCurrentStaticFieldClass"), 1)
136 CONFIG_INTEGER(JitReportFastTailCallDecisions, W("JitReportFastTailCallDecisions"), 0)
137 CONFIG_INTEGER(JitPInvokeCheckEnabled, W("JITPInvokeCheckEnabled"), 0)
138 CONFIG_INTEGER(JitPInvokeEnabled, W("JITPInvokeEnabled"), 1)
139
140 // Controls verbosity for JitPrintInlinedMethods. Ignored for JitDump where
141 // it's always set.
142 CONFIG_INTEGER(JitPrintInlinedMethodsVerbose, W("JitPrintInlinedMethodsVerboseLevel"), 0)
143 // Prints a tree of inlinees for a specific method (use '*' for all methods)
144 CONFIG_METHODSET(JitPrintInlinedMethods, W("JitPrintInlinedMethods"))
145
146 CONFIG_METHODSET(JitPrintDevirtualizedMethods, W("JitPrintDevirtualizedMethods"))
147 CONFIG_INTEGER(JitProfileChecks, W("JitProfileChecks"), 0) // Bitflag: 0x1 check classic, 0x2 check likely, 0x4 enable
148                                                            // asserts
149 CONFIG_INTEGER(JitRequired, W("JITRequired"), -1)
150 CONFIG_INTEGER(JitRoundFloat, W("JITRoundFloat"), DEFAULT_ROUND_LEVEL)
151 CONFIG_INTEGER(JitStackAllocToLocalSize, W("JitStackAllocToLocalSize"), DEFAULT_MAX_LOCALLOC_TO_LOCAL_SIZE)
152 CONFIG_INTEGER(JitSkipArrayBoundCheck, W("JitSkipArrayBoundCheck"), 0)
153 CONFIG_INTEGER(JitSlowDebugChecksEnabled, W("JitSlowDebugChecksEnabled"), 1) // Turn on slow debug checks
154 CONFIG_INTEGER(JitSplitFunctionSize, W("JitSplitFunctionSize"), 0) // On ARM, use this as the maximum function/funclet
155                                                                    // size for creating function fragments (and creating
156                                                                    // multiple RUNTIME_FUNCTION entries)
157 CONFIG_INTEGER(JitSsaStress, W("JitSsaStress"), 0) // Perturb order of processing of blocks in SSA; 0 = no stress; 1 =
158                                                    // use method hash; * = supplied value as random hash
159 CONFIG_INTEGER(JitStackChecks, W("JitStackChecks"), 0)
160 CONFIG_INTEGER(JitStress, W("JitStress"), 0) // Internal Jit stress mode: 0 = no stress, 2 = all stress, other = vary
161                                              // stress based on a hash of the method and this value
162 CONFIG_INTEGER(JitStressBBProf, W("JitStressBBProf"), 0)               // Internal Jit stress mode
163 CONFIG_INTEGER(JitStressBiasedCSE, W("JitStressBiasedCSE"), 0x101)     // Internal Jit stress mode: decimal bias value
164                                                                        // between (0,100) to perform CSE on a candidate.
165                                                                        // 100% = All CSEs. 0% = 0 CSE. (> 100) means no
166                                                                        // stress.
167 CONFIG_INTEGER(JitStressModeNamesOnly, W("JitStressModeNamesOnly"), 0) // Internal Jit stress: if nonzero, only enable
168                                                                        // stress modes listed in JitStressModeNames
169 CONFIG_INTEGER(JitStressProcedureSplitting, W("JitStressProcedureSplitting"), 0) // Always split after the first basic
170                                                                                  // block.
171 CONFIG_INTEGER(JitStressRegs, W("JitStressRegs"), 0)
172 CONFIG_STRING(JitStressRegsRange, W("JitStressRegsRange")) // Only apply JitStressRegs to methods in this hash range
173
174 CONFIG_INTEGER(JitVNMapSelLimit, W("JitVNMapSelLimit"), 0) // If non-zero, assert if # of VNF_MapSelect applications
175                                                            // considered reaches this
176 CONFIG_INTEGER(RunAltJitCode, W("RunAltJitCode"), 1) // If non-zero, and the compilation succeeds for an AltJit, then
177                                                      // use the code. If zero, then we always throw away the generated
178                                                      // code and fall back to the default compiler.
179 CONFIG_INTEGER(RunComponentUnitTests, W("JitComponentUnitTests"), 0) // Run JIT component unit tests
180 CONFIG_INTEGER(ShouldInjectFault, W("InjectFault"), 0)
181 CONFIG_INTEGER(StressCOMCall, W("StressCOMCall"), 0)
182 CONFIG_INTEGER(TailcallStress, W("TailcallStress"), 0)
183 CONFIG_INTEGER(TreesBeforeAfterMorph, W("JitDumpBeforeAfterMorph"), 0) // If 1, display each tree before/after morphing
184
185 CONFIG_METHODSET(JitBreak, W("JitBreak")) // Stops in the importer when compiling a specified method
186 CONFIG_METHODSET(JitDebugBreak, W("JitDebugBreak"))
187 CONFIG_STRING(JitDisasmAssemblies, W("JitDisasmAssemblies")) // Only show JitDisasm and related info for methods
188                                                              // from this semicolon-delimited list of assemblies.
189 CONFIG_INTEGER(JitDisasmWithGC, W("JitDisasmWithGC"), 0)     // Dump interleaved GC Info for any method disassembled.
190 CONFIG_INTEGER(JitDisasmWithDebugInfo, W("JitDisasmWithDebugInfo"), 0) // Dump interleaved debug info for any method
191                                                                        // disassembled.
192 CONFIG_INTEGER(JitDisasmSpilled, W("JitDisasmSpilled"), 0)      // Display native code when any register spilling occurs
193 CONFIG_METHODSET(JitDump, W("JitDump"))                         // Dumps trees for specified method
194 CONFIG_INTEGER(JitDumpTier0, W("JitDumpTier0"), 1)              // Dump tier0 requests
195 CONFIG_INTEGER(JitDumpAtOSROffset, W("JitDumpAtOSROffset"), -1) // Only dump OSR requests for this offset
196 CONFIG_INTEGER(JitDumpInlinePhases, W("JitDumpInlinePhases"), 1) // Dump inline compiler phases
197 CONFIG_METHODSET(JitEHDump, W("JitEHDump")) // Dump the EH table for the method, as reported to the VM
198 CONFIG_METHODSET(JitExclude, W("JitExclude"))
199 CONFIG_INTEGER(JitFakeProcedureSplitting, W("JitFakeProcedureSplitting"), 0) // Do code splitting independent of VM.
200 CONFIG_METHODSET(JitForceProcedureSplitting, W("JitForceProcedureSplitting"))
201 CONFIG_METHODSET(JitGCDump, W("JitGCDump"))
202 CONFIG_METHODSET(JitDebugDump, W("JitDebugDump"))
203 CONFIG_METHODSET(JitHalt, W("JitHalt")) // Emits break instruction into jitted code
204 CONFIG_METHODSET(JitInclude, W("JitInclude"))
205 CONFIG_METHODSET(JitLateDisasm, W("JitLateDisasm"))
206 CONFIG_METHODSET(JitMinOptsName, W("JITMinOptsName"))                   // Forces MinOpts for a named function
207 CONFIG_METHODSET(JitNoProcedureSplitting, W("JitNoProcedureSplitting")) // Disallow procedure splitting for specified
208                                                                         // methods
209 CONFIG_METHODSET(JitNoProcedureSplittingEH, W("JitNoProcedureSplittingEH")) // Disallow procedure splitting for
210                                                                             // specified methods if they contain
211                                                                             // exception handling
212 CONFIG_METHODSET(JitStressOnly, W("JitStressOnly")) // Internal Jit stress mode: stress only the specified method(s)
213 CONFIG_METHODSET(JitUnwindDump, W("JitUnwindDump")) // Dump the unwind codes for the method
214
215 CONFIG_METHODSET(JitDumpFg, W("JitDumpFg"))        // Dumps Xml/Dot Flowgraph for specified method
216 CONFIG_STRING(JitDumpFgDir, W("JitDumpFgDir"))     // Directory for Xml/Dot flowgraph dump(s)
217 CONFIG_STRING(JitDumpFgFile, W("JitDumpFgFile"))   // Filename for Xml/Dot flowgraph dump(s) (default: "default")
218 CONFIG_STRING(JitDumpFgPhase, W("JitDumpFgPhase")) // Phase-based Xml/Dot flowgraph support. Set to the short name of a
219                                                    // phase to see the flowgraph after that phase. Leave unset to dump
220                                                    // after COLD-BLK (determine first cold block) or set to * for all
221                                                    // phases
222 CONFIG_STRING(JitDumpFgPrePhase,
223               W("JitDumpFgPrePhase")) // Same as JitDumpFgPhase, but specifies to dump pre-phase, not post-phase.
224 CONFIG_INTEGER(JitDumpFgDot, W("JitDumpFgDot"), 1)     // 0 == dump XML format; non-zero == dump DOT format
225 CONFIG_INTEGER(JitDumpFgEH, W("JitDumpFgEH"), 0)       // 0 == no EH regions; non-zero == include EH regions
226 CONFIG_INTEGER(JitDumpFgLoops, W("JitDumpFgLoops"), 0) // 0 == no loop regions; non-zero == include loop regions
227
228 CONFIG_INTEGER(JitDumpFgConstrained, W("JitDumpFgConstrained"), 1) // 0 == don't constrain to mostly linear layout;
229                                                                    // non-zero == force mostly lexical block
230                                                                    // linear layout
231 CONFIG_INTEGER(JitDumpFgBlockID, W("JitDumpFgBlockID"), 0) // 0 == display block with bbNum; 1 == display with both
232                                                            // bbNum and bbID
233 CONFIG_INTEGER(JitDumpFgBlockFlags, W("JitDumpFgBlockFlags"), 0) // 0 == don't display block flags; 1 == display flags
234 CONFIG_INTEGER(JitDumpFgLoopFlags, W("JitDumpFgLoopFlags"), 0)   // 0 == don't display loop flags; 1 == display flags
235 CONFIG_INTEGER(JitDumpFgBlockOrder, W("JitDumpFgBlockOrder"), 0) // 0 == bbNext order;  1 == bbNum order; 2 == bbID
236                                                                  // order
237 CONFIG_INTEGER(JitDumpFgMemorySsa, W("JitDumpFgMemorySsa"), 0)   // non-zero: show memory phis + SSA/VNs
238
239 CONFIG_STRING(JitLateDisasmTo, W("JITLateDisasmTo"))
240 CONFIG_STRING(JitRange, W("JitRange"))
241 CONFIG_STRING(JitStressModeNames, W("JitStressModeNames")) // Internal Jit stress mode: stress using the given set of
242                                                            // stress mode names, e.g. STRESS_REGS, STRESS_TAILCALL
243 CONFIG_STRING(JitStressModeNamesNot, W("JitStressModeNamesNot")) // Internal Jit stress mode: do NOT stress using the
244                                                                  // given set of stress mode names, e.g. STRESS_REGS,
245                                                                  // STRESS_TAILCALL
246 CONFIG_STRING(JitStressRange, W("JitStressRange"))               // Internal Jit stress mode
247 ///
248 /// JIT Hardware Intrinsics
249 ///
250 CONFIG_INTEGER(EnableIncompleteISAClass, W("EnableIncompleteISAClass"), 0) // Enable testing not-yet-implemented
251 #endif                                                                     // defined(DEBUG)
252
253 CONFIG_METHODSET(JitDisasm, W("JitDisasm"))                // Print codegen for given methods
254 CONFIG_INTEGER(JitDisasmTesting, W("JitDisasmTesting"), 0) // Display BEGIN METHOD/END METHOD anchors for disasm testing
255 CONFIG_INTEGER(JitDisasmDiffable, W("JitDisasmDiffable"), 0) // Make the disassembly diff-able
256 CONFIG_INTEGER(JitDisasmSummary, W("JitDisasmSummary"), 0)   // Prints all jitted methods to the console
257 CONFIG_INTEGER(JitDisasmWithAlignmentBoundaries, W("JitDisasmWithAlignmentBoundaries"), 0) // Print the alignment
258                                                                                            // boundaries.
259 CONFIG_INTEGER(JitDisasmWithCodeBytes, W("JitDisasmWithCodeBytes"), 0) // Print the instruction code bytes
260 CONFIG_STRING(JitStdOutFile, W("JitStdOutFile")) // If set, sends JIT's stdout output to this file.
261
262 // These are supported for backward compatibility, to be removed:
263 #ifdef DEBUG
264 CONFIG_INTEGER(JitDiffableDasm, W("JitDiffableDasm"), 0)
265 CONFIG_INTEGER(JitDasmWithAlignmentBoundaries, W("JitDasmWithAlignmentBoundaries"), 0)
266 #endif
267
268 CONFIG_INTEGER(RichDebugInfo, W("RichDebugInfo"), 0) // If 1, keep rich debug info and report it back to the EE
269
270 #ifdef DEBUG
271 CONFIG_STRING(WriteRichDebugInfoFile, W("WriteRichDebugInfoFile")) // Write rich debug info in JSON format to this file
272 #endif
273
274 #if FEATURE_LOOP_ALIGN
275 CONFIG_INTEGER(JitAlignLoops, W("JitAlignLoops"), 1) // If set, align inner loops
276 #else
277 CONFIG_INTEGER(JitAlignLoops, W("JitAlignLoops"), 0)
278 #endif
279
280 ///
281 /// JIT
282 ///
283 #ifdef FEATURE_ENABLE_NO_RANGE_CHECKS
284 CONFIG_INTEGER(JitNoRangeChks, W("JitNoRngChks"), 0) // If 1, don't generate range checks
285 #endif
286
287 // AltJitAssertOnNYI should be 0 on targets where JIT is under development or bring up stage, so as to facilitate
288 // fallback to main JIT on hitting a NYI.
289 CONFIG_INTEGER(AltJitAssertOnNYI, W("AltJitAssertOnNYI"), 1) // Controls the AltJit behavior of NYI stuff
290
291 CONFIG_INTEGER(EnableEHWriteThru, W("EnableEHWriteThru"), 1) // Enable the register allocator to support EH-write thru:
292                                                              // partial enregistration of vars exposed on EH boundaries
293 CONFIG_INTEGER(EnableMultiRegLocals, W("EnableMultiRegLocals"), 1) // Enable the enregistration of locals that are
294                                                                    // defined or used in a multireg context.
295 #if defined(DEBUG)
296 CONFIG_INTEGER(JitStressEvexEncoding, W("JitStressEvexEncoding"), 0) // Enable EVEX encoding for SIMD instructions when
297                                                                      // AVX-512VL is available.
298 #endif
299
300 // clang-format off
301
302 CONFIG_INTEGER(PreferredVectorBitWidth,     W("PreferredVectorBitWidth"),   0) // The preferred decimal width, in bits, to use for any implicit vectorization emitted. A value less than 128 is treated as the system default.
303
304 //
305 // Hardware Intrinsic ISAs; keep in sync with clrconfigvalues.h
306 //
307 #if defined(TARGET_LOONGARCH64) || defined(TARGET_RISCV64)
308 //TODO: should implement LoongArch64's features.
309 //TODO-RISCV64-CQ: should implement RISCV64's features.
310 CONFIG_INTEGER(EnableHWIntrinsic,           W("EnableHWIntrinsic"),         0) // Allows Base+ hardware intrinsics to be disabled
311 #else
312 CONFIG_INTEGER(EnableHWIntrinsic,           W("EnableHWIntrinsic"),         1) // Allows Base+ hardware intrinsics to be disabled
313 #endif // defined(TARGET_LOONGARCH64) || defined(TARGET_RISCV64)
314
315 #if defined(TARGET_AMD64) || defined(TARGET_X86)
316 CONFIG_INTEGER(EnableAES,                   W("EnableAES"),                 1) // Allows AES+ hardware intrinsics to be disabled
317 CONFIG_INTEGER(EnableAVX,                   W("EnableAVX"),                 1) // Allows AVX+ hardware intrinsics to be disabled
318 CONFIG_INTEGER(EnableAVX2,                  W("EnableAVX2"),                1) // Allows AVX2+ hardware intrinsics to be disabled
319 CONFIG_INTEGER(EnableAVX512BW,              W("EnableAVX512BW"),            1) // Allows AVX512BW+ hardware intrinsics to be disabled
320 CONFIG_INTEGER(EnableAVX512BW_VL,           W("EnableAVX512BW_VL"),         1) // Allows AVX512BW+ AVX512VL+ hardware intrinsics to be disabled
321 CONFIG_INTEGER(EnableAVX512CD,              W("EnableAVX512CD"),            1) // Allows AVX512CD+ hardware intrinsics to be disabled
322 CONFIG_INTEGER(EnableAVX512CD_VL,           W("EnableAVX512CD_VL"),         1) // Allows AVX512CD+ AVX512VL+ hardware intrinsics to be disabled
323 CONFIG_INTEGER(EnableAVX512DQ,              W("EnableAVX512DQ"),            1) // Allows AVX512DQ+ hardware intrinsics to be disabled
324 CONFIG_INTEGER(EnableAVX512DQ_VL,           W("EnableAVX512DQ_VL"),         1) // Allows AVX512DQ+ AVX512VL+ hardware intrinsics to be disabled
325 CONFIG_INTEGER(EnableAVX512F,               W("EnableAVX512F"),             1) // Allows AVX512F+ hardware intrinsics to be disabled
326 CONFIG_INTEGER(EnableAVX512F_VL,            W("EnableAVX512F_VL"),          1) // Allows AVX512BW+ AVX512VL+ hardware intrinsics to be disabled
327 CONFIG_INTEGER(EnableAVX512VBMI,            W("EnableAVX512VBMI"),          1) // Allows AVX512VBMI+ hardware intrinsics to be disabled
328 CONFIG_INTEGER(EnableAVX512VBMI_VL,         W("EnableAVX512VBMI_VL"),       1) // Allows AVX512VBMI_VL+ hardware intrinsics to be disabled
329 CONFIG_INTEGER(EnableAVXVNNI,               W("EnableAVXVNNI"),             1) // Allows AVXVNNI+ hardware intrinsics to be disabled
330 CONFIG_INTEGER(EnableBMI1,                  W("EnableBMI1"),                1) // Allows BMI1+ hardware intrinsics to be disabled
331 CONFIG_INTEGER(EnableBMI2,                  W("EnableBMI2"),                1) // Allows BMI2+ hardware intrinsics to be disabled
332 CONFIG_INTEGER(EnableFMA,                   W("EnableFMA"),                 1) // Allows FMA+ hardware intrinsics to be disabled
333 CONFIG_INTEGER(EnableLZCNT,                 W("EnableLZCNT"),               1) // Allows LZCNT+ hardware intrinsics to be disabled
334 CONFIG_INTEGER(EnablePCLMULQDQ,             W("EnablePCLMULQDQ"),           1) // Allows PCLMULQDQ+ hardware intrinsics to be disabled
335 CONFIG_INTEGER(EnablePOPCNT,                W("EnablePOPCNT"),              1) // Allows POPCNT+ hardware intrinsics to be disabled
336 CONFIG_INTEGER(EnableSSE,                   W("EnableSSE"),                 1) // Allows SSE+ hardware intrinsics to be disabled
337 CONFIG_INTEGER(EnableSSE2,                  W("EnableSSE2"),                1) // Allows SSE2+ hardware intrinsics to be disabled
338 CONFIG_INTEGER(EnableSSE3,                  W("EnableSSE3"),                1) // Allows SSE3+ hardware intrinsics to be disabled
339 CONFIG_INTEGER(EnableSSE3_4,                W("EnableSSE3_4"),              1) // Allows SSE3+ hardware intrinsics to be disabled
340 CONFIG_INTEGER(EnableSSE41,                 W("EnableSSE41"),               1) // Allows SSE4.1+ hardware intrinsics to be disabled
341 CONFIG_INTEGER(EnableSSE42,                 W("EnableSSE42"),               1) // Allows SSE4.2+ hardware intrinsics to be disabled
342 CONFIG_INTEGER(EnableSSSE3,                 W("EnableSSSE3"),               1) // Allows SSSE3+ hardware intrinsics to be disabled
343 #elif defined(TARGET_ARM64)
344 CONFIG_INTEGER(EnableArm64AdvSimd,          W("EnableArm64AdvSimd"),        1) // Allows Arm64 AdvSimd+ hardware intrinsics to be disabled
345 CONFIG_INTEGER(EnableArm64Aes,              W("EnableArm64Aes"),            1) // Allows Arm64 Aes+ hardware intrinsics to be disabled
346 CONFIG_INTEGER(EnableArm64Atomics,          W("EnableArm64Atomics"),        1) // Allows Arm64 Atomics+ hardware intrinsics to be disabled
347 CONFIG_INTEGER(EnableArm64Crc32,            W("EnableArm64Crc32"),          1) // Allows Arm64 Crc32+ hardware intrinsics to be disabled
348 CONFIG_INTEGER(EnableArm64Dczva,            W("EnableArm64Dczva"),          1) // Allows Arm64 Dczva+ hardware intrinsics to be disabled
349 CONFIG_INTEGER(EnableArm64Dp,               W("EnableArm64Dp"),             1) // Allows Arm64 Dp+ hardware intrinsics to be disabled
350 CONFIG_INTEGER(EnableArm64Rdm,              W("EnableArm64Rdm"),            1) // Allows Arm64 Rdm+ hardware intrinsics to be disabled
351 CONFIG_INTEGER(EnableArm64Sha1,             W("EnableArm64Sha1"),           1) // Allows Arm64 Sha1+ hardware intrinsics to be disabled
352 CONFIG_INTEGER(EnableArm64Sha256,           W("EnableArm64Sha256"),         1) // Allows Arm64 Sha256+ hardware intrinsics to be disabled
353 #endif
354
355 // clang-format on
356
357 #ifdef FEATURE_SIMD
358 CONFIG_INTEGER(JitDisableSimdVN, W("JitDisableSimdVN"), 0) // Default 0, ValueNumbering of SIMD nodes and HW Intrinsic
359                                                            // nodes enabled
360                                                            // If 1, then disable ValueNumbering of SIMD nodes
361                                                            // If 2, then disable ValueNumbering of HW Intrinsic nodes
362                                                            // If 3, disable both SIMD and HW Intrinsic nodes
363 #endif                                                     // FEATURE_SIMD
364
365 // Default 0, enable the CSE of Constants, including nearby offsets. (only for ARM64)
366 // If 1, disable all the CSE of Constants
367 // If 2, enable the CSE of Constants but don't combine with nearby offsets. (only for ARM64)
368 // If 3, enable the CSE of Constants including nearby offsets. (all platforms)
369 // If 4, enable the CSE of Constants but don't combine with nearby offsets. (all platforms)
370 //
371 CONFIG_INTEGER(JitConstCSE, W("JitConstCSE"), 0)
372
373 #define CONST_CSE_ENABLE_ARM 0
374 #define CONST_CSE_DISABLE_ALL 1
375 #define CONST_CSE_ENABLE_ARM_NO_SHARING 2
376 #define CONST_CSE_ENABLE_ALL 3
377 #define CONST_CSE_ENABLE_ALL_NO_SHARING 4
378
379 ///
380 /// JIT
381 ///
382 #if !defined(DEBUG) && !defined(_DEBUG)
383 CONFIG_INTEGER(JitEnableNoWayAssert, W("JitEnableNoWayAssert"), 0)
384 #else  // defined(DEBUG) || defined(_DEBUG)
385 CONFIG_INTEGER(JitEnableNoWayAssert, W("JitEnableNoWayAssert"), 1)
386 #endif // !defined(DEBUG) && !defined(_DEBUG)
387
388 #if defined(TARGET_AMD64) || defined(TARGET_X86)
389 #define JitMinOptsTrackGCrefs_Default 0 // Not tracking GC refs in MinOpts is new behavior
390 #else
391 #define JitMinOptsTrackGCrefs_Default 1
392 #endif
393 CONFIG_INTEGER(JitMinOptsTrackGCrefs, W("JitMinOptsTrackGCrefs"), JitMinOptsTrackGCrefs_Default) // Track GC roots
394
395 // The following should be wrapped inside "#if MEASURE_MEM_ALLOC / #endif", but
396 // some files include this one without bringing in the definitions from "jit.h"
397 // so we don't always know what the "true" value of that flag should be. For now
398 // we take the easy way out and always include the flag, even in release builds
399 // (normally MEASURE_MEM_ALLOC is off for release builds but if it's toggled on
400 // for release in "jit.h" the flag would be missing for some includers).
401 // TODO-Cleanup: need to make 'MEASURE_MEM_ALLOC' well-defined here at all times.
402 CONFIG_INTEGER(DisplayMemStats, W("JitMemStats"), 0) // Display JIT memory usage statistics
403
404 #if defined(DEBUG)
405 CONFIG_INTEGER(JitEnregStats, W("JitEnregStats"), 0) // Display JIT enregistration statistics
406 #endif                                               // DEBUG
407
408 CONFIG_INTEGER(JitAggressiveInlining, W("JitAggressiveInlining"), 0) // Aggressive inlining of all methods
409 CONFIG_INTEGER(JitELTHookEnabled, W("JitELTHookEnabled"), 0)         // If 1, emit Enter/Leave/TailCall callbacks
410 CONFIG_INTEGER(JitInlineSIMDMultiplier, W("JitInlineSIMDMultiplier"), 3)
411
412 // Ex lclMAX_TRACKED constant.
413 CONFIG_INTEGER(JitMaxLocalsToTrack, W("JitMaxLocalsToTrack"), 0x400)
414
415 #if defined(FEATURE_ENABLE_NO_RANGE_CHECKS)
416 CONFIG_INTEGER(JitNoRngChks, W("JitNoRngChks"), 0) // If 1, don't generate range checks
417 #endif                                             // defined(FEATURE_ENABLE_NO_RANGE_CHECKS)
418
419 #if defined(OPT_CONFIG)
420 CONFIG_INTEGER(JitDoAssertionProp, W("JitDoAssertionProp"), 1) // Perform assertion propagation optimization
421 CONFIG_INTEGER(JitDoCopyProp, W("JitDoCopyProp"), 1)   // Perform copy propagation on variables that appear redundant
422 CONFIG_INTEGER(JitDoEarlyProp, W("JitDoEarlyProp"), 1) // Perform Early Value Propagation
423 CONFIG_INTEGER(JitDoLoopHoisting, W("JitDoLoopHoisting"), 1)   // Perform loop hoisting on loop invariant values
424 CONFIG_INTEGER(JitDoLoopInversion, W("JitDoLoopInversion"), 1) // Perform loop inversion on "for/while" loops
425 CONFIG_INTEGER(JitDoRangeAnalysis, W("JitDoRangeAnalysis"), 1) // Perform range check analysis
426 CONFIG_INTEGER(JitDoVNBasedDeadStoreRemoval, W("JitDoVNBasedDeadStoreRemoval"), 1) // Perform VN-based dead store
427                                                                                    // removal
428 CONFIG_INTEGER(JitDoRedundantBranchOpts, W("JitDoRedundantBranchOpts"), 1) // Perform redundant branch optimizations
429 CONFIG_STRING(JitEnableRboRange, W("JitEnableRboRange"))
430 CONFIG_STRING(JitEnableTailMergeRange, W("JitEnableTailMergeRange"))
431 CONFIG_STRING(JitEnableVNBasedDeadStoreRemovalRange, W("JitEnableVNBasedDeadStoreRemovalRange"))
432 CONFIG_STRING(JitEnableEarlyLivenessRange, W("JitEnableEarlyLivenessRange"))
433 CONFIG_STRING(JitOnlyOptimizeRange,
434               W("JitOnlyOptimizeRange")) // If set, all methods that do _not_ match are forced into MinOpts
435 CONFIG_STRING(JitEnablePhysicalPromotionRange, W("JitEnablePhysicalPromotionRange"))
436
437 CONFIG_INTEGER(JitDoSsa, W("JitDoSsa"), 1) // Perform Static Single Assignment (SSA) numbering on the variables
438 CONFIG_INTEGER(JitDoValueNumber, W("JitDoValueNumber"), 1) // Perform value numbering on method expressions
439
440 CONFIG_METHODSET(JitOptRepeat, W("JitOptRepeat"))            // Runs optimizer multiple times on the method
441 CONFIG_INTEGER(JitOptRepeatCount, W("JitOptRepeatCount"), 2) // Number of times to repeat opts when repeating
442 CONFIG_INTEGER(JitDoIfConversion, W("JitDoIfConversion"), 1) // Perform If conversion
443 #endif                                                       // defined(OPT_CONFIG)
444
445 CONFIG_INTEGER(JitTelemetry, W("JitTelemetry"), 1) // If non-zero, gather JIT telemetry data
446
447 // Max # of MapSelect's considered for a particular top-level invocation.
448 CONFIG_INTEGER(JitVNMapSelBudget, W("JitVNMapSelBudget"), DEFAULT_MAP_SELECT_BUDGET)
449
450 CONFIG_INTEGER(TailCallLoopOpt, W("TailCallLoopOpt"), 1) // Convert recursive tail calls to loops
451 CONFIG_METHODSET(AltJit, W("AltJit"))         // Enables AltJit and selectively limits it to the specified methods.
452 CONFIG_METHODSET(AltJitNgen, W("AltJitNgen")) // Enables AltJit for NGEN and selectively limits it
453                                               // to the specified methods.
454
455 CONFIG_STRING(AltJitExcludeAssemblies, W("AltJitExcludeAssemblies")) // Do not use AltJit on this
456                                                                      // semicolon-delimited list of assemblies.
457
458 CONFIG_INTEGER(JitMeasureIR, W("JitMeasureIR"), 0) // If set, measure the IR size after some phases and report it in
459                                                    // the time log.
460
461 CONFIG_STRING(JitFuncInfoFile, W("JitFuncInfoLogFile")) // If set, gather JIT function info and write to this file.
462 CONFIG_STRING(JitTimeLogCsv, W("JitTimeLogCsv")) // If set, gather JIT throughput data and write to a CSV file. This
463                                                  // mode must be used in internal retail builds.
464 CONFIG_STRING(TailCallOpt, W("TailCallOpt"))
465 CONFIG_INTEGER(FastTailCalls, W("FastTailCalls"), 1) // If set, allow fast tail calls; otherwise allow only helper-based
466                                                      // calls
467                                                      // for explicit tail calls.
468
469 CONFIG_INTEGER(JitMeasureNowayAssert, W("JitMeasureNowayAssert"), 0) // Set to 1 to measure noway_assert usage. Only
470                                                                      // valid if MEASURE_NOWAY is defined.
471 CONFIG_STRING(JitMeasureNowayAssertFile,
472               W("JitMeasureNowayAssertFile")) // Set to file to write noway_assert usage to a file (if not
473                                               // set: stdout). Only valid if MEASURE_NOWAY is defined.
474 #if defined(DEBUG)
475 CONFIG_INTEGER(EnableExtraSuperPmiQueries, W("EnableExtraSuperPmiQueries"), 0) // Make extra queries to somewhat
476                                                                                // future-proof SuperPmi method contexts.
477 #endif                                                                         // DEBUG
478
479 #if defined(DEBUG) || defined(INLINE_DATA)
480 CONFIG_INTEGER(JitInlineDumpData, W("JitInlineDumpData"), 0)
481 CONFIG_INTEGER(JitInlineDumpXml, W("JitInlineDumpXml"), 0) // 1 = full xml (+ failures in DEBUG)
482                                                            // 2 = only methods with inlines (+ failures in DEBUG)
483                                                            // 3 = only methods with inlines, no failures
484 CONFIG_STRING(JitInlineDumpXmlFile, W("JitInlineDumpXmlFile"))
485 CONFIG_INTEGER(JitInlinePolicyDumpXml, W("JitInlinePolicyDumpXml"), 0)
486 CONFIG_INTEGER(JitInlineLimit, W("JitInlineLimit"), -1)
487 CONFIG_INTEGER(JitInlinePolicyDiscretionary, W("JitInlinePolicyDiscretionary"), 0)
488 CONFIG_INTEGER(JitInlinePolicyFull, W("JitInlinePolicyFull"), 0)
489 CONFIG_INTEGER(JitInlinePolicySize, W("JitInlinePolicySize"), 0)
490 CONFIG_INTEGER(JitInlinePolicyRandom, W("JitInlinePolicyRandom"), 0) // nonzero enables; value is the external random
491                                                                      // seed
492 CONFIG_INTEGER(JitInlinePolicyReplay, W("JitInlinePolicyReplay"), 0)
493 CONFIG_STRING(JitNoInlineRange, W("JitNoInlineRange"))
494 CONFIG_STRING(JitInlineReplayFile, W("JitInlineReplayFile"))
495 #endif // defined(DEBUG) || defined(INLINE_DATA)
496
497 // Extended version of DefaultPolicy that includes a more precise IL scan,
498 // relies on PGO if it exists and generally is more aggressive.
499 CONFIG_INTEGER(JitExtDefaultPolicy, W("JitExtDefaultPolicy"), 1)
500 CONFIG_INTEGER(JitExtDefaultPolicyMaxIL, W("JitExtDefaultPolicyMaxIL"), 0x80)
501 CONFIG_INTEGER(JitExtDefaultPolicyMaxILProf, W("JitExtDefaultPolicyMaxILProf"), 0x400)
502 CONFIG_INTEGER(JitExtDefaultPolicyMaxBB, W("JitExtDefaultPolicyMaxBB"), 7)
503
504 // Inliner uses the following formula for PGO-driven decisions:
505 //
506 //    BM = BM * ((1.0 - ProfTrust) + ProfWeight * ProfScale)
507 //
508 // Where BM is a benefit multiplier composed from various observations (e.g. "const arg makes a branch foldable").
509 // If a profile data can be trusted for 100% we can safely just give up on inlining anything inside cold blocks
510 // (except the cases where inlining in cold blocks improves type info/escape analysis for the whole caller).
511 // For now, it's only applied for dynamic PGO.
512 CONFIG_INTEGER(JitExtDefaultPolicyProfTrust, W("JitExtDefaultPolicyProfTrust"), 0x7)
513 CONFIG_INTEGER(JitExtDefaultPolicyProfScale, W("JitExtDefaultPolicyProfScale"), 0x2A)
514
515 CONFIG_INTEGER(JitInlinePolicyModel, W("JitInlinePolicyModel"), 0)
516 CONFIG_INTEGER(JitInlinePolicyProfile, W("JitInlinePolicyProfile"), 0)
517 CONFIG_INTEGER(JitInlinePolicyProfileThreshold, W("JitInlinePolicyProfileThreshold"), 40)
518 CONFIG_INTEGER(JitObjectStackAllocation, W("JitObjectStackAllocation"), 0)
519
520 CONFIG_INTEGER(JitEECallTimingInfo, W("JitEECallTimingInfo"), 0)
521
522 #if defined(DEBUG)
523 CONFIG_INTEGER(JitEnableFinallyCloning, W("JitEnableFinallyCloning"), 1)
524 CONFIG_INTEGER(JitEnableRemoveEmptyTry, W("JitEnableRemoveEmptyTry"), 1)
525 #endif // DEBUG
526
527 // Overall master enable for Guarded Devirtualization.
528 CONFIG_INTEGER(JitEnableGuardedDevirtualization, W("JitEnableGuardedDevirtualization"), 1)
529
530 #define MAX_GDV_TYPE_CHECKS 5
531 // Number of types to probe for polymorphic virtual call-sites to devirtualize them,
532 // Max number is MAX_GDV_TYPE_CHECKS defined above ^. -1 means it's up to JIT to decide
533 CONFIG_INTEGER(JitGuardedDevirtualizationMaxTypeChecks, W("JitGuardedDevirtualizationMaxTypeChecks"), -1)
534
535 // Various policies for GuardedDevirtualization
536 CONFIG_INTEGER(JitGuardedDevirtualizationChainLikelihood, W("JitGuardedDevirtualizationChainLikelihood"), 0x4B) // 75
537 CONFIG_INTEGER(JitGuardedDevirtualizationChainStatements, W("JitGuardedDevirtualizationChainStatements"), 1)
538 #if defined(DEBUG)
539 CONFIG_STRING(JitGuardedDevirtualizationRange, W("JitGuardedDevirtualizationRange"))
540 CONFIG_INTEGER(JitRandomGuardedDevirtualization, W("JitRandomGuardedDevirtualization"), 0)
541 #endif // DEBUG
542
543 // Enable insertion of patchpoints into Tier0 methods, switching to optimized where needed.
544 #if defined(TARGET_AMD64) || defined(TARGET_ARM64) || defined(TARGET_LOONGARCH64)
545 CONFIG_INTEGER(TC_OnStackReplacement, W("TC_OnStackReplacement"), 1)
546 #else
547 CONFIG_INTEGER(TC_OnStackReplacement, W("TC_OnStackReplacement"), 0)
548 #endif // defined(TARGET_AMD64) || defined(TARGET_ARM64) || defined(TARGET_LOONGARCH64)
549 // Initial patchpoint counter value used by jitted code
550 CONFIG_INTEGER(TC_OnStackReplacement_InitialCounter, W("TC_OnStackReplacement_InitialCounter"), 1000)
551 // Enable partial compilation for Tier0 methods
552 CONFIG_INTEGER(TC_PartialCompilation, W("TC_PartialCompilation"), 0)
553 // Patchpoint strategy:
554 // 0 - backedge sources
555 // 1 - backedge targets
556 // 2 - adaptive (default)
557 CONFIG_INTEGER(TC_PatchpointStrategy, W("TC_PatchpointStrategy"), 2)
558 #if defined(DEBUG)
559 // Randomly sprinkle patchpoints. Value is the likelihood any given stack-empty point becomes a patchpoint.
560 CONFIG_INTEGER(JitRandomOnStackReplacement, W("JitRandomOnStackReplacement"), 0)
561 // Place patchpoint at the specified IL offset, if possible. Overrides random placement.
562 CONFIG_INTEGER(JitOffsetOnStackReplacement, W("JitOffsetOnStackReplacement"), -1)
563 #endif // debug
564
565 #if defined(DEBUG)
566 // EnableOsrRange allows you to limit the set of methods that will rely on OSR to escape
567 // from Tier0 code. Methods outside the range that would normally be jitted at Tier0
568 // and have patchpoints will instead be switched to optimized.
569 CONFIG_STRING(JitEnableOsrRange, W("JitEnableOsrRange"))
570 // EnablePatchpointRange allows you to limit the set of Tier0 methods that
571 // will have patchpoints, and hence control which methods will create OSR methods.
572 // Unlike EnableOsrRange, it will not alter the optimization setting for methods
573 // outside the enabled range.
574 CONFIG_STRING(JitEnablePatchpointRange, W("JitEnablePatchpointRange"))
575 #endif
576
577 // Profile instrumentation options
578 CONFIG_INTEGER(JitInterlockedProfiling, W("JitInterlockedProfiling"), 0)
579 CONFIG_INTEGER(JitScalableProfiling, W("JitScalableProfiling"), 1)
580 CONFIG_INTEGER(JitMinimalJitProfiling, W("JitMinimalJitProfiling"), 1)
581 CONFIG_INTEGER(JitMinimalPrejitProfiling, W("JitMinimalPrejitProfiling"), 0)
582
583 CONFIG_INTEGER(JitProfileCasts, W("JitProfileCasts"), 0)                     // Profile castclass/isinst
584 CONFIG_INTEGER(JitConsumeProfileForCasts, W("JitConsumeProfileForCasts"), 1) // Consume profile data (if any) for
585                                                                              // castclass/isinst
586
587 CONFIG_INTEGER(JitClassProfiling, W("JitClassProfiling"), 1)         // Profile virtual and interface calls
588 CONFIG_INTEGER(JitDelegateProfiling, W("JitDelegateProfiling"), 1)   // Profile resolved delegate call targets
589 CONFIG_INTEGER(JitVTableProfiling, W("JitVTableProfiling"), 0)       // Profile resolved vtable call targets
590 CONFIG_INTEGER(JitEdgeProfiling, W("JitEdgeProfiling"), 1)           // Profile edges instead of blocks
591 CONFIG_INTEGER(JitCollect64BitCounts, W("JitCollect64BitCounts"), 0) // Collect counts as 64-bit values.
592
593 // Profile consumption options
594 CONFIG_INTEGER(JitDisablePgo, W("JitDisablePgo"), 0) // Ignore pgo data for all methods
595 #if defined(DEBUG)
596 CONFIG_STRING(JitEnablePgoRange, W("JitEnablePgoRange"))         // Enable pgo data for only some methods
597 CONFIG_INTEGER(JitRandomEdgeCounts, W("JitRandomEdgeCounts"), 0) // Substitute random values for edge counts
598 CONFIG_INTEGER(JitCrossCheckDevirtualizationAndPGO, W("JitCrossCheckDevirtualizationAndPGO"), 0)
599 CONFIG_INTEGER(JitNoteFailedExactDevirtualization, W("JitNoteFailedExactDevirtualization"), 0)
600 CONFIG_INTEGER(JitRandomlyCollect64BitCounts, W("JitRandomlyCollect64BitCounts"), 0) // Collect 64-bit counts randomly
601                                                                                      // for some methods.
602 // 1: profile synthesis for root methods
603 // 2: profile synthesis for root methods w/o pgo data
604 // 3: profile synthesis for root methods, blend with existing PGO data
605 CONFIG_INTEGER(JitSynthesizeCounts, W("JitSynthesizeCounts"), 0)
606 // Check if synthesis left consistent counts
607 CONFIG_INTEGER(JitCheckSynthesizedCounts, W("JitCheckSynthesizedCounts"), 0)
608 // If instrumenting the method, run synthesis and save the synthesis results
609 // as edge or block profile data. Do not actually instrument.
610 CONFIG_INTEGER(JitPropagateSynthesizedCountsToProfileData, W("JitPropagateSynthesizedCountsToProfileData"), 0)
611 #endif
612
613 // Devirtualize virtual calls with getExactClasses (NativeAOT only for now)
614 CONFIG_INTEGER(JitEnableExactDevirtualization, W("JitEnableExactDevirtualization"), 1)
615
616 // Force the generation of CFG checks
617 CONFIG_INTEGER(JitForceControlFlowGuard, W("JitForceControlFlowGuard"), 0);
618 // JitCFGUseDispatcher values:
619 // 0: Never use dispatcher
620 // 1: Use dispatcher on all platforms that support it
621 // 2: Default behavior, depends on platform (yes on x64, no on arm64)
622 CONFIG_INTEGER(JitCFGUseDispatcher, W("JitCFGUseDispatcher"), 2)
623
624 // Enable tail merging
625 CONFIG_INTEGER(JitEnableTailMerge, W("JitEnableTailMerge"), 1)
626
627 // Enable physical promotion
628 CONFIG_INTEGER(JitEnablePhysicalPromotion, W("JitEnablePhysicalPromotion"), 1)
629
630 #if defined(DEBUG)
631 // JitFunctionFile: Name of a file that contains a list of functions. If the currently compiled function is in the
632 // file, certain other JIT config variables will be active. If the currently compiled function is not in the file,
633 // the specific JIT config variables will not be active.
634 //
635 // Functions are approximately in the format output by JitFunctionTrace, e.g.:
636 //
637 // System.CLRConfig:GetBoolValue(ref,byref):bool (MethodHash=3c54d35e)
638 //   -- use the MethodHash, not the function name
639 //
640 // System.CLRConfig:GetBoolValue(ref,byref):bool
641 //   -- use just the name
642 //
643 // Lines with leading ";" "#" or "//" are ignored.
644 //
645 // If this is unset, then the JIT config values have their normal behavior.
646 //
647 CONFIG_STRING(JitFunctionFile, W("JitFunctionFile"))
648 #endif // DEBUG
649
650 #if defined(DEBUG)
651 #if defined(TARGET_ARM64)
652 // JitSaveFpLrWithCalleeSavedRegisters:
653 //    0: use default frame type decision
654 //    1: disable frames that save FP/LR registers with the callee-saved registers (at the top of the frame)
655 //    2: force all frames to use the frame types that save FP/LR registers with the callee-saved registers (at the top
656 //    of the frame)
657 //    3: force all frames to use the frame types that save FP/LR registers with the callee-saved registers (at the top
658 //    of the frame) and also force using the large funclet frame variation (frame 5) if possible.
659 CONFIG_INTEGER(JitSaveFpLrWithCalleeSavedRegisters, W("JitSaveFpLrWithCalleeSavedRegisters"), 0)
660 #endif // defined(TARGET_ARM64)
661
662 #if defined(TARGET_LOONGARCH64)
663 // Disable emitDispIns by default
664 CONFIG_INTEGER(JitDispIns, W("JitDispIns"), 0)
665 #endif // defined(TARGET_LOONGARCH64)
666 #endif // DEBUG
667
668 CONFIG_INTEGER(JitEnregStructLocals, W("JitEnregStructLocals"), 1) // Allow to enregister locals with struct type.
669
670 #undef CONFIG_INTEGER
671 #undef CONFIG_STRING
672 #undef CONFIG_METHODSET