-
Notifications
You must be signed in to change notification settings - Fork 5.8k
8271589: fatal error with variable shift count integer rotate operation. #4956
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 jbhateja! A progress list of the required criteria for merging this PR into |
/label hotspot-compiler-dev |
@jatin-bhateja |
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.
I assume TestLongVectRotate.java
should be also updated.
And you need add cases for Long type vector shifts if they can be generated.
@@ -2488,7 +2488,6 @@ void SuperWord::output() { | |||
} else if (VectorNode::is_scalar_rotate(n)) { | |||
Node* in1 = low_adr->in(1); | |||
Node* in2 = p->at(0)->in(2); | |||
assert(in2->bottom_type()->isa_int(), "Shift must always be an int value"); |
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.
Why you removed the assert? What other types can be seen here?
The following code (specifically in2->get_int()
) will fail if it is not Integer type.
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.
At this point in code, the shift is either an int value or a vector of an int value. If it's a vector !in2->is_Con() will make the condition true and no need to check for get_int due to short-circuiting.
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.
Okay. IT should be fine because get_int() has own assert.
} else { | ||
// Variable shift case. | ||
} else if (VectorNode::is_invariant_vector(cnt)) { | ||
// Scalar variable shift, handle replicates generated by auto vectorizer. | ||
assert(VectorNode::is_invariant_vector(cnt), "Broadcast expected"); |
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.
This assert is not needed anymore since you already checked for this 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.
Will remove this before checking in the final version of the patch.
cnt = cnt->in(1); | ||
} else { | ||
assert(cnt->bottom_type()->isa_long() && | ||
cnt->bottom_type()->is_long()->is_con(), "Long constant expected"); |
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.
Is this case from Vector API? I think in Java we can have only Int type for shifts.
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.
Is this case from Vector API? I think in Java we can have only Int type for shifts.
This is to handle long rotates, SLP will insert a ConvI2L before broadcasting shift value into a long vector. In case of constant int value, ConvI2L::Value will create a constant of TypeLong and which is what is being handled here.
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.
Got it.
Long rotates patterns with variable shifts i.e. Long.rotateLeft/Right(a[i], int_b[i]/ (int) long_b[i]) are not auto-vectorized currently. |
Hi @vnkozlov, I have responded to your individual comments, please let me know if there are more comments. |
You said in an other comment: Is it really a big change for test to cover this case? This is new code in your changes which needs test coverage I think. I will start testing current changes (with removed assert(is_invariant_vector()) we agreed on). |
Testing passed clean. |
Yes this comment is valid for Long.rotateLeft/Right(a[i], SHIFT/IMM_SHIFT) patterns.
|
@jatin-bhateja I don't understand why you don't want to add testing for And you need second review. |
Hi @vnkozlov , |
@jatin-bhateja 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 44 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 |
} | ||
shiftRCnt = cnt; |
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.
This seems redundant. shiftRCnt is being overwritten in the very next statement.
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.
Other than this redundant statement, the patch looks good to me.
/integrate |
Going to push as commit 392fcc9.
Your commit was automatically rebased without conflicts. |
@jatin-bhateja Pushed as commit 392fcc9. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
Problem seen on targets which do not support variable vector shifts, in such a case vector rotation node inferred by auto-vectorizer are not disintegrable into LeftShift/RightShift and Or operations.
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/4956/head:pull/4956
$ git checkout pull/4956
Update a local copy of the PR:
$ git checkout pull/4956
$ git pull https://git.openjdk.java.net/jdk pull/4956/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 4956
View PR using the GUI difftool:
$ git pr show -t 4956
Using diff file
Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/4956.diff