-
Notifications
You must be signed in to change notification settings - Fork 6.2k
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
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 88 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, @TobiHartmann) 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 |
Webrevs
|
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!
test/hotspot/jtreg/compiler/c2/TestEliminateRedundantConversionSequences.java
Outdated
Show resolved
Hide resolved
test/hotspot/jtreg/compiler/c2/TestEliminateRedundantConversionSequences.java
Outdated
Show resolved
Hide resolved
// 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.
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 notification issue that is solved here only happens with optimizations that have this chain pattern with three nodes (checking the input of the input) and this is specific to conversions that have a loss of precision. ConvI2D is not here because the ConvI2D->ConvD2I
gets optimized to a NOP already (ConvD2INode::Identity
). But there are also chains for which there is a known optimization and for which I was not able to trigger a missed optimization, so it would make sense to have mention this in any case.
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 have added a short note, let me know what you think!
…nSequences.java Co-authored-by: Christian Hagedorn <[email protected]>
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 good to me!
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.
Update looks good, thanks!
/integrate |
@benoitmaillard |
/sponsor |
Going to push as commit 2829741.
Your commit was automatically rebased without conflicts. |
@chhagedorn @benoitmaillard Pushed as commit 2829741. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
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