-
Notifications
You must be signed in to change notification settings - Fork 6.1k
8359603: Missed optimization in PhaseIterGVN for redundant ConvX2Y->ConvY2X->ConvX2Y sequences due to missing notification in PhaseIterGVN::add_users_of_use_to_worklist #26368
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
base: master
Are you sure you want to change the base?
Conversation
👋 Welcome back bmaillard! A progress list of the required criteria for merging this PR into |
@benoitmaillard 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 35 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 (@chhagedorn) but any other Committer may sponsor as well. ➡️ To flag this PR as ready for integration with the above commit message, type |
@benoitmaillard 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. |
…t could be trigerred
… optimization patterns
@benoitmaillard this pull request can not be integrated into git checkout JDK-8359603
git fetch https://git.openjdk.org/jdk.git master
git merge FETCH_HEAD
# resolve conflicts and follow the instructions given by git merge
git commit -m "Merge master"
git push |
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.
Two minor comments, otherwise, it looks good to me!
* @summary Redundant ConvX2Y->ConvY2X->ConvX2Y sequences should be | ||
* simplified to a single ConvX2Y operation when applicable | ||
* VerifyIterativeGVN checks that this optimization was applied | ||
* @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:CompileCommand=quiet |
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.
I think you can remove quiet
:
* @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:CompileCommand=quiet | |
* @run main/othervm -XX:+IgnoreUnrecognizedVMOptions |
} | ||
|
||
public static void main(String[] strArr) { | ||
for (int i = 0; i < 50_000; ++i) { |
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.
Do you really need 50000 iterations each? Would less also trigger the bug?
// ConvD2L->ConvL2D->ConvD2L | ||
// ConvF2I->ConvI2F->ConvF2I | ||
// ConvF2L->ConvL2F->ConvF2L | ||
// ConvI2F->ConvF2I->ConvI2F |
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.
Another thought: Since this is an incomplete list of variations (especially missing, for example, the I2D version while the I2F version is here), should we leave a comment about not being able to trigger issues with the other versions? Otherwise, it could suggest that it was just forgotten.
This PR addresses a missed optimization in
PhaseIterGVN
due to the lack of change notification to indirect users withinPhaseIterGVN::add_users_of_use_to_worklist
(again). This is similar to JDK-8361700.The optimization in question is the removal of redundant
ConvX2Y->ConvY2X->ConvX2Y
sequences (whereX
andY
are primitive number types), which get replaced by a singleConvX2Y
as an identity optimization. This missing optimization was originally reported only forConvD2LNode
, but it turns out that other conversion nodes have analog optimization patterns. After manual inspection of identity optimizations inconvertnode.cpp
, I was able to reproduce missing optimizations for the following conversion sequences:ConvD2L->ConvL2D->ConvD2L
ConvF2I->ConvI2F->ConvF2I
ConvF2L->ConvL2F->ConvF2L
ConvI2F->ConvF2I->ConvI2F
Similar optimization patterns exist for additional conversion nodes. However, it is not clear if these nodes are subject to the same missed optimization issue. Further investigation may be needed, as I was unable to reproduce such cases with simple tests.
This is again a case where an optimization depends on the input of its input. Currently,
PhaseIterGVN::add_users_of_use_to_worklist
contains specific logic to handle similar dependencies for other cases, but this specific scenario is not addressed. The proposed fix adds the necessary logic inadd_users_of_use_to_worklist
to ensure proper notification for this optimization pattern.Testing
Thank you for reviewing!
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/26368/head:pull/26368
$ git checkout pull/26368
Update a local copy of the PR:
$ git checkout pull/26368
$ git pull https://git.openjdk.org/jdk.git pull/26368/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 26368
View PR using the GUI difftool:
$ git pr show -t 26368
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/26368.diff
Using Webrev
Link to Webrev Comment