-
Notifications
You must be signed in to change notification settings - Fork 6.2k
8319451: PhaseIdealLoop::conditional_move is too conservative #16524
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
|
👋 Welcome back qamai! A progress list of the required criteria for merging this PR into |
|
@merykitty The following label 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 list. If you would like to change these labels, use the /label pull request command. |
Webrevs
|
|
This is the result of the benchmark running on my machine. The result is consistent with the common knowledge, as the |
cl4es
left a comment
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.
Nice, especially the property that run-to-run variance drops in the 1-20% range.
@TobiHartmann told me he'll review and that he has queued up a batch of benchmarks to evaluate this change more widely.
| @Param({"3", "6", "10", "20", "30", "60", "100", "200", "300", "600"}) | ||
| int freq; |
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.
That freq is expressed in "occurrences per thousand" was only obvious after reading the code - perhaps a probability between 0 and 1 (with the appropriate adjustment to r.nextFloat() < freq below) would be slightly more intuitive?
| @Param({"3", "6", "10", "20", "30", "60", "100", "200", "300", "600"}) | |
| int freq; | |
| @Param({"0.003", "0.006", "0.01", "0.02", "0.03", "0.06", "0.1", "0.2", "0.3", "0.6"}) | |
| float freq; |
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.
@cl4es You are right, I have fixed that.
TobiHartmann
left a comment
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.
Looks reasonable to me. All tests passed and performance results look neutral (no statistically significant improvements or regressions).
|
/reviewers 2 |
|
@merykitty 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 73 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. ➡️ To integrate this PR with the above commit message to the |
|
@TobiHartmann |
vnkozlov
left a comment
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.
Looks fine to me.
Looking on history of this code and I added it to address JDK-7097546.
But later it was found not correct for some case and I even had similar fix prototype: JDK-8034833. There was additional changes proposed there: in block.hpp and .ad file.
Please, look on attached in that report test and additional code changes there. May be be we can improve more cmove. It could be done separately from this your fix if you want to spend more time on it.
|
@vnkozlov I have investigated a little bit. For these kinds of loops Since this loop is perfectly predictable, no threshold of Regarding the register pressure relating to a |
vnkozlov
left a comment
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.
Thank you for additional investigation.
|
@TobiHartmann @vnkozlov @cl4es Thanks a lot for your reviews and testings, if there is nothing that concerns you, I will integrate the patch, |
cl4es
left a comment
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.
Thank you for the work on this and for picking up on my suggestions for the microbenchmark! Looking forward to see the effects of this on a wider selection of benchmarks.
|
/integrate |
|
Going to push as commit ac968c3.
Your commit was automatically rebased without conflicts. |
|
@merykitty Pushed as commit ac968c3. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
Hi,
When transforming a Phi into a CMove, the threshold is set to be approximately BlockLayoutMinDiamondPercentage, the reason is given:
This sets the default value of the threshold to be around 18%, which is too conservative. The reason also does not make a lot of sense since the important property which makes jumping expensive is not code layout. We should remove this.
Please kindly review, thank you very much.
Progress
Issue
Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/16524/head:pull/16524$ git checkout pull/16524Update a local copy of the PR:
$ git checkout pull/16524$ git pull https://git.openjdk.org/jdk.git pull/16524/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 16524View PR using the GUI difftool:
$ git pr show -t 16524Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/16524.diff
Webrev
Link to Webrev Comment