-
Notifications
You must be signed in to change notification settings - Fork 5.8k
JDK-8298813: [C2] Converting double to float cause a loss of precision and resulting crypto.aes scores fluctuate #11685
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
Conversation
…d resulting crypto.aes scores fluctuate
👋 Welcome back sunny868! A progress list of the required criteria for merging this PR into |
Webrevs
|
The test FAIL and ERROR items has nothing to do with this patch. |
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.
This looks reasonable to me but I'm not an expert in that area. I'll run some performance testing for sanity and report back once it passed.
src/hotspot/share/opto/chaitin.hpp
Outdated
@@ -478,7 +478,7 @@ class PhaseChaitin : public PhaseRegAlloc { | |||
|
|||
Block **_blks; // Array of blocks sorted by frequency for coalescing | |||
|
|||
float _high_frequency_lrg; // Frequency at which LRG will be spilled for debug info | |||
double _high_frequency_lrg; // Frequency at which LRG will be spilled for debug info |
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.
double _high_frequency_lrg; // Frequency at which LRG will be spilled for debug info | |
double _high_frequency_lrg; // Frequency at which LRG will be spilled for debug info |
OK. you can focus on the instruction generation of function com.sun.crypto.provider.DESCrypt::cipherBlock, sometimes it is
and sometimes it is
|
And in order to eliminate the fluctuation of running scores caused by C1, it is recommended that you use |
By the way, adding the following changes to this patch will allow crypto.aes to get a stable high score.
But I'm not sure if this change can be committed with this patch or if a new patch can be committed for it. |
Tests passed and performance results looks good. I think the other change that you proposed should not be part of this. |
|
@sunny868 This change now passes all automated pre-integration checks. ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details. After integration, the commit message for the final commit will be:
You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been 1626 new commits pushed to the
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details. As you do not have Committer status in this project an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@TobiHartmann) but any other Committer may sponsor as well. ➡️ To flag this PR as ready for integration with the above commit message, type |
…d resulting crypto.aes scores fluctuate
/integrate |
/sponsor |
Going to push as commit 3637660.
Your commit was automatically rebased without conflicts. |
@TobiHartmann @sunny868 Pushed as commit 3637660. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
@TobiHartmann Thank you for your review. I have one more question for you, How did you test SPECjvm2008 performance? take the maximum or average value of multiple test results? |
@sunny868 We take the average value of multiple test runs. |
How many times do I need to run SPECjvm2008? And is this average from all jvm2008 benchmarks or a single one? |
We run the SPECjvm2008 benchmarks individually and gather different results (average, low/high, statistical significance, ...). I think the exact configuration differs depending on the platform and benchmark. Since this is part of our internal performance testing infrastructure, no public documentation is available. |
Hi all,
For C2, convert double to float cause a loss of precision,
Here, _high_frequency_lrg type is float, so maybe has a loss of precision. when it be used:
Here, lrg._maxfreq type is double, so _high_frequency_lrg will be convert double again. But now, due to the loss of precision of _high_frequency_lrg, the conditions here may be true or false.
There are two cases that I tested for SPECjvm2008 crypto.aes.
case 1:
case2:
The above two cases result in different block generation(case2 can insert new SpillCopyNodes), and resulting score on cryto.aes is fluctuate.
This is a patch to fix this problem. Please help review it.
Thanks,
Sun Guoyun
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk pull/11685/head:pull/11685
$ git checkout pull/11685
Update a local copy of the PR:
$ git checkout pull/11685
$ git pull https://git.openjdk.org/jdk pull/11685/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 11685
View PR using the GUI difftool:
$ git pr show -t 11685
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/11685.diff