Skip to content

Remember whether dltOptLevel= is specified in a subset - #7596

Merged
vijaysun-omr merged 1 commit into
eclipse-omr:masterfrom
mpirvu:dltoptlevel
Dec 18, 2024
Merged

Remember whether dltOptLevel= is specified in a subset#7596
vijaysun-omr merged 1 commit into
eclipse-omr:masterfrom
mpirvu:dltoptlevel

Conversation

@mpirvu

@mpirvu mpirvu commented Dec 18, 2024

Copy link
Copy Markdown
Contributor

The command line option -Xjit:dltOptLevel=... existed, but it was inspected in the OpenJ9 downstream project only when the TR_DebugDLT env var was set. The reason is that we have to account for the possibility of specifying the option in a subset and retrieving options from subsets is relatively expensive and not something that we may want to do too often.
This commit remembers whether dltOptLevel= is specified in any subset by setting a flag in the JIT command line options. Then, in OpenJ9 we can first check if this flag is set and only then proceed to find the correct subset for the method in question. This should eliminate the overhead when -Xjit:dltOptLevel= is not specified in a subset, which is the common case.

@mpirvu
mpirvu requested a review from dsouzai as a code owner December 18, 2024 16:24
@mpirvu

mpirvu commented Dec 18, 2024

Copy link
Copy Markdown
Contributor Author

@vijaysun-omr FYI

Comment thread compiler/control/OMROptions.cpp Outdated
const char *retVal = processingMethod(option + opt->length, base, opt);

// Check to see whether the dltOptLevel option is specified in a subset
// and remember that informartion in the global JIT cmdLineOptions

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo "informartion"

@vijaysun-omr

Copy link
Copy Markdown
Contributor

Jenkins build all

@vijaysun-omr

Copy link
Copy Markdown
Contributor

I am starting broader testing, that I won't repeat if it ends before Marius fixes the typo in comment

The command line option -Xjit:dltOptLevel=... existed,
but it was inspected in the OpenJ9 downstream project
only when the `TR_DebugDLT` env var was set. The reason
is that we have to account for the possibility of specifying
the option in a subset and retrieving options from
subsets is relatively expensive and not something that we
may want to do too often.
This commit remembers whether `dltOptLevel=` is specified
in any subset by setting a flag in the JIT command line options.
Then, in OpenJ9 we can first check if this flag is set and
only then proceed to find the correct subset for the method
in question. This should eliminate the overhead when
-Xjit:dltOptLevel= is not specified in a subset, which is
the common case.

Signed-off-by: Marius Pirvu <mpirvu@ca.ibm.com>
@mpirvu

mpirvu commented Dec 18, 2024

Copy link
Copy Markdown
Contributor Author

Will wait for tests to pass before submitting the correction to the comment

@vijaysun-omr

Copy link
Copy Markdown
Contributor

I don't believe riscv, zos and windows will pass, for other known/infra reasons

@mpirvu

mpirvu commented Dec 18, 2024

Copy link
Copy Markdown
Contributor Author

Just pushed the correction

@vijaysun-omr

Copy link
Copy Markdown
Contributor

Tests had passed (except for known platform issues) before the comment was updated to fix typo. So I am going to merge on the basis of the change since testing was done to be trivial.

@vijaysun-omr
vijaysun-omr merged commit a3a92be into eclipse-omr:master Dec 18, 2024
mpirvu added a commit to mpirvu/openj9 that referenced this pull request Dec 19, 2024
Before this change one could force the optimization
level of a particular DLT compilation through a
command line option (dltOptLevel=...) only if the
TR_DebugDLT env var was defined. This was done to avoid
the overhead of searching the option subsets for a
given method.
This commit allows one to specify the optimization level
of DLT compilations without the need of an env var.
Examples:
  -Xjit:dltOptLevel=hot
  -Xjit:{myMethod}(dltOptLevel=cold)
The overhead for searching option sets has been eliminated
if no option subset uses the dltOptlevel= option

Depends on eclipse-omr/omr#7596

Signed-off-by: Marius Pirvu <mpirvu@ca.ibm.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants