Skip to content

Commit

Permalink
GRA changes to reduce JIT overhead at warm opt levels
Browse files Browse the repository at this point in the history
The commit introduces a new option -Xjit:graFreqThresholdAtWarm=<NNN>
that can be used to control the JIT overhead for compilations
performed at warm optimization level or below. The default value
of the threshold is 500. A larger value leads to lower JIT overhead
but also to potentially lower quality of the generated code.
For hot compilations or in situations where we think we can afford
more JIT overhead, the threshold is automatically set to 0.

Signed-off-by: Marius Pirvu <mpirvu@ca.ibm.com>
  • Loading branch information
mpirvu committed Apr 5, 2024
1 parent 8037ccd commit 3d1b3ad
Show file tree
Hide file tree
Showing 5 changed files with 151 additions and 834 deletions.
3 changes: 3 additions & 0 deletions compiler/control/OMROptions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -829,6 +829,8 @@ TR::OptionTable OMR::Options::_jitOptions[] = {
{"GCRresetCount=", "R<nnn>\tthe value to which the counter is reset to after being tripped by guarded counting recompilations (positive value)",
TR::Options::setCount, offsetof(OMR::Options,_GCRResetCount), 0, "F%d"},
{"generateCompleteInlineRanges", "O\tgenerate meta data ranges for each change in inliner depth", SET_OPTION_BIT(TR_GenerateCompleteInlineRanges), "F"},
{"graFreqThresholdAtWarm=", "O<nnn>\tgra threshold for block frequency for opt level less of equal to warm",
TR::Options::set32BitNumeric, offsetof(OMR::Options, _graFreqThresholdAtWarm), 500, "F%d"},
{"help", " \tdisplay this help information", TR::Options::helpOption, 0, 0, "F", NOT_IN_SUBSET},
{"help=", " {regex}\tdisplay help for options whose names match {regex}", TR::Options::helpOption, 1, 0, "F", NOT_IN_SUBSET},
{"highCodeCacheOccupancyBCount=", "R<nnn>\tthe initial invocation count used during high code cache occupancy for methods with loops",
Expand Down Expand Up @@ -2678,6 +2680,7 @@ OMR::Options::jitPreProcess()
_alwaysWorthInliningThreshold = 15;
_maxLimitedGRACandidates = TR_MAX_LIMITED_GRA_CANDIDATES;
_maxLimitedGRARegs = TR_MAX_LIMITED_GRA_REGS;
_graFreqThresholdAtWarm = 500;
_counterBucketGranularity = 2;
_minCounterFidelity = INT_MIN;
_lastIpaOptTransformationIndex = INT_MAX;
Expand Down
3 changes: 3 additions & 0 deletions compiler/control/OMROptions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1468,6 +1468,7 @@ class OMR_EXTENSIBLE Options
_insertGCRTrees = false;
_maxLimitedGRACandidates = 0;
_maxLimitedGRARegs = 0;
_graFreqThresholdAtWarm = 0;
_enableGPU = 0;
_isAOTCompile = false;
_jProfilingMethodRecompThreshold = 0;
Expand Down Expand Up @@ -1822,6 +1823,7 @@ class OMR_EXTENSIBLE Options
int32_t getAlwaysWorthInliningThreshold() const { return _alwaysWorthInliningThreshold; }
int32_t getMaxLimitedGRACandidates() { return _maxLimitedGRACandidates; }
int32_t getMaxLimitedGRARegs() { return _maxLimitedGRARegs; }
int32_t getGRAFreqThresholdAtWarm() { return _graFreqThresholdAtWarm; }
int32_t getNumLimitedGRARegsWithheld();

int32_t getProfilingCompNodecountThreshold() { return _profilingCompNodecountThreshold; }
Expand Down Expand Up @@ -2481,6 +2483,7 @@ class OMR_EXTENSIBLE Options

int32_t _maxLimitedGRACandidates;
int32_t _maxLimitedGRARegs;
int32_t _graFreqThresholdAtWarm;

int32_t _enableGPU;

Expand Down
Loading

0 comments on commit 3d1b3ad

Please sign in to comment.