-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
8346989: Deoptimization and re-compilation cycle with C2 compiled code #23916
base: master
Are you sure you want to change the base?
Conversation
👋 Welcome back marc-chevalier! A progress list of the required criteria for merging this PR into |
❗ This change is not yet ready to be integrated. |
@marc-chevalier The following labels will be automatically applied to this pull request:
When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing lists. If you would like to change these labels, use the /label pull request command. |
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.
The benchmark generally looks good to me, I only have some minor suggestions ;)
@Fork(value = 1) | ||
public static class C2 extends MultiplyExact {} |
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.
What about a C2 version where you just disable the intrinsic?
public int test(int i) { | ||
try { | ||
return square(i); | ||
} catch (Throwable e) { |
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.
Can you catch a more specific exception? Catching very general exceptions can often mask other bugs. I suppose this is only a benchmark, but it would still be good practice ;)
You ask this in the PR description. I think I was not thinking about |
Ah. And is this only about And yet another idea: you could probably write an IR test that checks that we at first have the compilation with the trap, and another test where we trap too much and then get a different compilation (without the intrinsic?). Plus: the issue title is very generic. I think it should mention something about |
My fault. I used "inline" instead of "intrinsic" because the functions implementing the intrinsic are called I'll edit the text to fix that. |
Math.*Exact
intrinsics can cause many deopt when used repeatedly with problematic arguments.This fix proposes not to rely on inlining after
too_many_traps()
has been reached.I've reproduced the issue on a slightly simpler code than the one in the bug:
And we can indeed reproduce the issue:
And with this fix, with C1:
and with C2:
As for the benchmark test, before the fix:
and with the fix:
Is it worth having intrinsics at all? @eme64 wondered, so I tried with this code:
No intrinsic (inlined Java implem):
Always intrinsic (current behavior, and new behavior in absence of overflow, like in this example):
So it's... not very conclusive, but likely to be a bit useful. The gap between the means is about 0.4s, which is less than half the standard deviation.
Still, it seems good to have.
Thanks,
Marc
Progress
Issue
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/23916/head:pull/23916
$ git checkout pull/23916
Update a local copy of the PR:
$ git checkout pull/23916
$ git pull https://git.openjdk.org/jdk.git pull/23916/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 23916
View PR using the GUI difftool:
$ git pr show -t 23916
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/23916.diff