-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
8275643: C2's unaryOp vector intrinsic does not properly handle LongVector.neg #6428
Conversation
👋 Welcome back thartmann! A progress list of the required criteria for merging this PR into |
@TobiHartmann 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. |
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 looks good to me!
@TobiHartmann 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 13 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 |
Thanks for the review, Christian! |
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 the review, Sandhya! |
@sviswa7 @jatin-bhateja any thoughts on the other related FIXMEs brought up by Tobias? e.g. if (op == AND_NOT) {
// FIXME: Support this in the JIT.
that = that.lanewise(NOT);
op = AND; |
@PaulSandoz Those fixme notes are from John, pointing to us where further optimizations are possible and not related to correctness. I also looked at the vop2ideal, it now handles all the opcodes for the relevant data types (inegral/fp). |
Thanks, i also looked at |
Thanks for checking! |
/integrate |
Going to push as commit 47564ca.
Your commit was automatically rebased without conflicts. |
@TobiHartmann Pushed as commit 47564ca. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
Code in
LongVector::lanewiseTemplate
currently implements theNEG
operation as aSUB
and has a correspondingFIXME
comment:jdk/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/LongVector.java
Lines 534 to 541 in e9934e1
The implicit assumption is that since we will never pass
NEG
toVectorSupport.unaryOp
in line 540, the corresponding C2 intrinsic does not need to handle that case. That's not guaranteed though because C2 might still compile that path when not being able to prove that it's unreachable at parse time. As a result, we then assert in the intrinsic because the negation operation on a long vector is currently not supported (i.e. there is noOp_NegVL
). I propose to simply handle this case inVectorSupport::vop2ideal
. We will then bail out from intrinsification withoperation not supported: opc=NegL bt=long
becauseVectorNode::opcode
returns 0:jdk/src/hotspot/share/opto/vectorIntrinsics.cpp
Lines 390 to 394 in e9934e1
Question to the Vector API experts: There are other
FIXME: Support this in the JIT
comments in the code. Do these code paths suffer from similar issues? Is there a tracking RFE/bug?Thanks,
Tobias
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/6428/head:pull/6428
$ git checkout pull/6428
Update a local copy of the PR:
$ git checkout pull/6428
$ git pull https://git.openjdk.java.net/jdk pull/6428/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 6428
View PR using the GUI difftool:
$ git pr show -t 6428
Using diff file
Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/6428.diff