-
Notifications
You must be signed in to change notification settings - Fork 6.2k
8373134: C2: Min/Max users of Min/Max uses should be enqueued for GVN #28895
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 galder! A progress list of the required criteria for merging this PR into |
|
@galderz 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 30 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 (@benoitmaillard, @eme64, @dean-long) but any other Committer may sponsor as well. ➡️ To flag this PR as ready for integration with the above commit message, type |
Webrevs
|
| if (use->is_MinMax()) { | ||
| for (DUIterator_Fast i2max, i2 = use->fast_outs(i2max); i2 < i2max; i2++) { | ||
| Node* u = use->fast_out(i2); | ||
| if (u->Opcode() == use->Opcode()) { |
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.
So there are no Min(Max()) or Max(Min()) patterns we need to worry about? I was expecting this line to be
if (u->is_MinMax()) {
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.
Good question. There could be some patterns but I couldn't think of any when I was working on this, so I limited it to the patterns that I knew for sure required this, e.g. Max(Max()), Min(Min()).
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 took a quick look and I didn't find anything obvious.
|
There's an issue with the Float16 incubator API access that I did not notice in local testing, I'm looking into it |
|
The module issue should be fixed now |
benoitmaillard
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, thanks for making this change. I like the move from MaxNode to MinMaxNode, I always thought the naming was a bit confusing.
I have also kicked off internal testing and will come back with the results once done.
eme64
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 great, thanks for working on this Galder!
Co-authored-by: Benoît Maillard <benoit.maillard@protonmail.com>
Co-authored-by: Emanuel Peter <emanuel.peter@oracle.com>
Co-authored-by: Emanuel Peter <emanuel.peter@oracle.com>
Min/Max users of Min/Max uses need to be enqueued respectively to the GVN worklist to see if further optimizations can be applied. Without this, there are cases where additional potential ideal/identity optimizations are not applied. I need this fix to test min/max reassociation implementation with IR tests reliably.
Aside from the fix itself, I've refactored
MaxNodetoMinMaxNodeand added ais_MinMaxnode query to simplify the fix.I have also removed the Min/Max exceptions in
PhaseIterGVN::verify_Identity_forsince this fix fixescompiler/codegen/TestBooleanVect.javawith-XX:VerifyIterativeGVN=1110.To test this I've created a template framework test that validates the fix. I have tested with all Min/Max combinations including Float16, which I've verified with Intel SDE. Float16 does not use
Argument.NUMBER_42because there's no support for it yet, see JDK-8373977.During development I noticed that the test only failed when the test had
b, aparameters in that order, so I added tests for both cases asa, bandb, aso that all possible orders are covered and they don't slip in the future.I've run tier1-3 tests on linux/x64 successfully.
Progress
Issue
Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/28895/head:pull/28895$ git checkout pull/28895Update a local copy of the PR:
$ git checkout pull/28895$ git pull https://git.openjdk.org/jdk.git pull/28895/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 28895View PR using the GUI difftool:
$ git pr show -t 28895Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/28895.diff
Using Webrev
Link to Webrev Comment