-
Notifications
You must be signed in to change notification settings - Fork 6.2k
8371558: C2: Missing optimization opportunity in AbsNode::Ideal #28237
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 21 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 |
|
@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. |
Webrevs
|
chhagedorn
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 good, thanks!
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 good to me otherwise.
test/hotspot/jtreg/compiler/c2/TestMissingOptAbsZeroMinusX.java
Outdated
Show resolved
Hide resolved
Co-authored-by: Tobias Hartmann <tobias.hartmann@oracle.com>
robcasloz
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 good!
At some point, we will have to think about some kind of system to enforce notification of indirect users "by construction", or at least make it possible to somehow detect when such notification may be needed.
|
Thank you for the reviews! @chhagedorn @TobiHartmann @robcasloz
I agree, this seems quite difficult to sustain over time. But finding a good solution is probably quite hard, as there are different locations in the code where these notifications can happen ( In the meantime at least we get the opportunity to add more tests (most work in these PRs goes into reproducing these missing optimizations reliably and reducing the tests to the maximum), and this will still be super useful if we ever change the notification mechanism. /integrate |
|
Going to push as commit 9d6a61f.
Your commit was automatically rebased without conflicts. |
|
@benoitmaillard Pushed as commit 9d6a61f. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
This PR addresses another missed optimization in
PhaseIterGVNdue to a missing notification to indirect users withinPhaseIterGVN::add_users_of_use_to_worklist.The affected optimization is the transformation of
abs(0-x)intoabs(x). This transformation is implemented inAbsNode::Ideal.The bug was found by the fuzzer. At some point during IGVN, we have the following setup:
The
Phinode gets folded into aConI, and we callreplace_node(phi, zero), which ends up callingadd_users_to_worklist(phi), andadd_users_of_use_to_worklist(phi, zero, ...). However the case for this specific notification was missing there, and theAbsInode is never notified (not added to the worklist).This PR brings the following changes:
add_users_of_use_to_worklistforAbsI,AbsL,AbsFandAbsDTestMissingOptAbsZeroMinusX.java, initially obtained from the fuzzer and then heavily reduced, both with the usual tools and manually. In addition toAbsI, I have also added test cases forAbsFandAbsD, but was not able to reproduce forAbsLdespite my best efforts.Testing
Thank you for reviewing!
Progress
Issue
Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/28237/head:pull/28237$ git checkout pull/28237Update a local copy of the PR:
$ git checkout pull/28237$ git pull https://git.openjdk.org/jdk.git pull/28237/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 28237View PR using the GUI difftool:
$ git pr show -t 28237Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/28237.diff
Using Webrev
Link to Webrev Comment