Skip to content

Commit

Permalink
Add flag to indicate compile time is not that important
Browse files Browse the repository at this point in the history
This commit adds a new option bit called TR_NotCompileTimeSensitive
which will be turned on by an upstream project (OpenJ9) in situations
where we favor throughput over compile time.
The commit also adds a new optimization qualifier, `IfLoopsAndNotCompileTimeSensitive`.
An optimization pass flagged as such will be performed only if
the method being compiled has loops and the `TR_NotCompileTimeSensitive`
bit is turned on.

Signed-off-by: Marius Pirvu <mpirvu@ca.ibm.com>
  • Loading branch information
mpirvu committed Jan 3, 2024
1 parent 787725a commit 33740ef
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion compiler/control/OMROptions.hpp
Expand Up @@ -302,7 +302,7 @@ enum TR_CompilationOptions
TR_DisableDelayRelocationForAOTCompilations = 0x00000200 + 7,
TR_DisableRecompDueToInlinedMethodRedefinition = 0x00000400 + 7,
TR_DisableLoopReplicatorColdSideEntryCheck = 0x00000800 + 7,
// Available = 0x00001000 + 7,
TR_NotCompileTimeSensitive = 0x00001000 + 7, // Can afford to spend more time compiling
TR_DontDowgradeToColdDuringGracePeriod = 0x00002000 + 7,
TR_EnableRecompilationPushing = 0x00004000 + 7,
TR_EnableJCLInline = 0x00008000 + 7, // enable JCL Integer and Long methods inline
Expand Down
6 changes: 6 additions & 0 deletions compiler/optimizer/OMROptimizer.cpp
Expand Up @@ -1551,6 +1551,12 @@ int32_t OMR::Optimizer::performOptimization(const OptimizationStrategy *optimiza
doThisOptimization = true;
}
break;
case IfLoopsAndNotCompileTimeSensitive:
{
if (comp()->mayHaveLoops() && comp()->getOption(TR_NotCompileTimeSensitive))
doThisOptimization = true;
}
break;
case MarkLastRun:
doThisOptimization = true;
TR_ASSERT(optNum < OMR::numOpts ,"No current support for marking groups as last (optNum=%d,numOpt=%d\n",optNum,OMR::numOpts); //make sure we didn't mark groups
Expand Down
1 change: 1 addition & 0 deletions compiler/optimizer/OMROptimizer.hpp
Expand Up @@ -135,6 +135,7 @@ enum
IfAggressiveLiveness,
IfVectorAPI, // JEP414: Extra analysis required to optimize Vector API
IfExceptionHandlers,
IfLoopsAndNotCompileTimeSensitive, // If loops and compile time is not that important
MarkLastRun
};

Expand Down

0 comments on commit 33740ef

Please sign in to comment.