-
Notifications
You must be signed in to change notification settings - Fork 0
How to place my optimization in the optimization strategy?
Just because your new hello world optimization is now being compiled by the standard build process, doesn't mean that your optimization will get triggered. In order for your optimization to run, you need to add it to at least one optimization strategy.
There are 5 optimization levels in OpenJ9:
- cold
- warm
- hot
- very-hot
- scorching
The optimizations strategies for each optimization level can be found in the J9Optimizer.cpp file. Each level is actually a bit more nuanced, and warm is actually the default level for all compiles, unless a few special circumstances apply.
To add your optimization, you must first create an enum in OMROptimizations.enum. This enum will then be accessible as OMR::yourenumname.
In order for your optimization to run, you need to let the optimizer know about your optimization.
-
Include your opt by adding
#include "<path-to-your-opt's-headerfile>"here -
add your opt to the
_optsarray. . Use the enum that you declared in OMROptimizations.enum and the create method of your optimization. -
Place your optimization in one of these strategies by adding your enum to one of the arrays
Do not place the opt in plain warm however, as it is overridden by the cheapwarm strategy.