-
Notifications
You must be signed in to change notification settings - Fork 721
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use profilingOpts strategy under JitProfiling mode only #16155
Use profilingOpts strategy under JitProfiling mode only #16155
Conversation
Rahil @r30shah, I'm just running a personal build on this change to make sure there aren't any unexpected test failures, so I've marked it as a draft pull request. Once I mark it as ready-for-review, may I ask you to review this change? |
The profilingOpts optimization strategy includes profileGenerator and deadTreesElimination. The profileGenerator simply returns if the JProfiling mode is enabled, while the deadTreesElimination is intended to clean up trees that might have been introduced by profileGenerator, so it too is really only needed if JitProfilng mode is enabled. However, the optimization strategy as a whole is being run if either JProfiling or JitProfiling is enabled. Some optimization strategies run compactLocals very late, just before profileOpts is run. Running deadTreesElimination after compactLocals might invalidate the analysis compactLocals has performed. The compactLocals analysis is only run if JitProfiling mode is not enabled. This changes uses of profilingGroup to only take effect if JitProfilng mode is enabled, preventing deadTreesElimination from running after compactLocals. It also renames profilingGroup and profilingOpts to jitProfilingGroup and jitProfilingOpts to avoid confusion, as they really are specific to JitProfiling mode. Signed-off-by: Henry Zongaro <zongaro@ca.ibm.com>
cbed00e
to
86f0c00
Compare
I have revised this change to reflect the recommendations from @r30shah Rahil's review comments on OMR pull request #6782. I've made this as a draft pull request, as it depends on the revised OMR pull request eclipse-omr/omr#6782 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes looks good to me.
Jenkins test sanity all jdk8,jdk11,jdk17 |
Jenkins test sanity win32 jdk8 |
Vijay @vijaysun-omr, may I ask you to review this change? This fix takes advantage of the new |
While I don't have any issue with the logic in the commit as it stands, I did wonder about the "compact locals is only run if JIT profiling is not going to run" aspect. If this is just for saving some compile time, i.e. why bother running compact locals when the compile is only going to run for a relatively short time (as profiling compiles do) then I'd imagine a similar argument could apply to profiling compiles even when they use JProfiling. The only reason for bringing this up is that it might have changed the nature of the fix (where we may not have had to distinguish JIT profiling as such from JProfiling). If you prefer to deal with that in some other PR/issue, I may be okay with that, but I thought I would ask this question in any case. |
Viajy @vijaysun-omr, my understanding is that if JIT profiling is enabled, compact locals does not run for correctness reasons rather than to improve compile-time performance - the transformations performed by When JProfiling was introduced, the condition under which compact locals runs was revised (in commit 25ae1d0) so that compact locals would not run under JIT profiling, but it would run under JProfiling or if neither profiling mode was enabled. |
Thanks for the clarification (and the edit to the above comment to make it even easier to follow). Merging. |
The
profilingOpts
optimization strategy includesprofileGenerator
anddeadTreesElimination
. TheprofileGenerator
simply returns if the JProfiling mode is enabled, while thedeadTreesElimination
is intended to clean up trees that might have been introduced byprofileGenerator
, so it too is really only needed if JitProfilng mode is enabled. However, the optimization strategy as a whole is being run if either JProfiling or JitProfiling is enabled.Some optimization strategies run
compactLocals
very late, just beforeprofileOpts
is run. RunningdeadTreesElimination
aftercompactLocals
might invalidate the analysiscompactLocals
has performed. ThecompactLocals
analysis is only run if JitProfiling mode is not enabled.This changes uses of
profilingGroup
to only take effect if JitProfilng mode is enabled, preventingdeadTreesElimination
from running aftercompactLocals
. It also renamesprofilingGroup
andprofilingOpts
tojitProfilingGroup
andjitProfilingOpts
to avoid confusion, as they really are specific to JitProfiling mode.This change depends on OMR pull request eclipse-omr/omr#6782
Fixes #15569