-
Notifications
You must be signed in to change notification settings - Fork 6.2k
8337791: VectorAPI jtreg ABSMaskedByteMaxVectorTests crashes with UseAVX=0 -XX:MaxVectorSize=8 #28533
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 jbhateja! A progress list of the required criteria for merging this PR into |
|
❗ This change is not yet ready to be integrated. |
|
@jatin-bhateja 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
|
…X=0 -XX:MaxVectorSize=8
7060049 to
6ca9542
Compare
|
@jatin-bhateja Please do not rebase or force-push to an active PR as it invalidates existing review comments. Note for future reference, the bots always squash all changes into a single commit automatically as part of the integration. See OpenJDK Developers’ Guide for more information. |
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.
src/hotspot/cpu/x86/x86.ad
Outdated
| } | ||
| break; | ||
| case Op_VectorBlend: | ||
| if (UseAVX == 0 && MaxVectorSize < 16) { |
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.
While its technically fesable to create a 64-bit wide byte vector blend for AVX level 0 using blendvp selection pattern and emit pblendv instruction for it, but the machine nodes inputs will not be iso-morphic, ie. MachTemp node for xmm0 will be 128 bit wide TypeVect::VECTX and other input will be of type 64bit TypeVect::VECTD type. Given that blend is a lanewise operation hence IR type must be compatible with input types. Its better to use size_in_bits rather than MaxVectorSize in guard check.
We could have pushed this check to actual pattern predicate but its better to uplift the checks to match_rule_supported_vector since it prevents creation non-matchable IR during construction.
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.
@jatin-bhateja Thanks for looking into this!
I think it is fine to just disable the small vector size for AVX=0. Those platforms are quite rare now anyway.
Should we also adjust the predicate in the matching rule here?
22509 instruct blendvp(vec dst, vec src, vec mask, rxmm0 tmp) %{
22510 predicate(UseAVX == 0);
22511 match(Set dst (VectorBlend (Binary dst src) mask));
22512 format %{ "vector_blend $dst,$src,$mask\t! using $tmp as TEMP" %}
22513 effect(TEMP tmp);
22514 ins_encode %{
22515 assert(UseSSE >= 4, "required");
22516
22517 if ($mask$$XMMRegister != $tmp$$XMMRegister) {
22518 __ movdqu($tmp$$XMMRegister, $mask$$XMMRegister);
22519 }
22520 __ pblendvb($dst$$XMMRegister, $src$$XMMRegister); // uses xmm0 as mask
22521 %}
22522 ins_pipe( pipe_slow );
22523 %}
As mentioned above #28533 (comment) |
|
Ok, that's fine with me too. It would be nice if you could also attach a regression test, or maybe add an additional run to the existing test, with the required flags for reproducing this issue. |
@eme64 addressed. |
| @IR(failOn = {IRNode.ABS_VB}, applyIfAnd={"MaxVectorSize", " <= 8 ", "UseAVX", "0"}) | ||
| @IR(counts = {IRNode.ABS_VB, "1"}, applyIf={"MaxVectorSize", " > 8 "}) |
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.
Are you sure this is going to pass on all platforms? Does this test run ok on aarch64 where there is no UseAVX flag?
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.
Thanks, fixed
I intend to pass UseAVX=0 as a run flag to reproduce exact bug scenario, our framework is not sensitive to IgnoreUnrecoginzedVMOptions.
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.
You could also just limit the rules to sse4.1 platforms. Then you can run the tests everywhere, but limit IR rules to what is easy to test for you ;)
Platform features get tested before flags, so that helps with platform specific flags ;)
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.
Thanks!! , that is much better!
https://github.com/openjdk/jdk/tree/master/test/hotspot/jtreg/compiler/lib/ir_framework#disableenable-ir-rules-based-on-platform
a0e008d to
c84f473
Compare
|
@jatin-bhateja Please do not rebase or force-push to an active PR as it invalidates existing review comments. Note for future reference, the bots always squash all changes into a single commit automatically as part of the integration. See OpenJDK Developers’ Guide for more information. |
c84f473 to
2f77313
Compare
|
@jatin-bhateja Please do not rebase or force-push to an active PR as it invalidates existing review comments. Note for future reference, the bots always squash all changes into a single commit automatically as part of the integration. See OpenJDK Developers’ Guide for more information. |
2f77313 to
ef84ffa
Compare
|
@jatin-bhateja Please do not rebase or force-push to an active PR as it invalidates existing review comments. Note for future reference, the bots always squash all changes into a single commit automatically as part of the integration. See OpenJDK Developers’ Guide for more information. |
|
Hi @eme64 , kindly verify latest changes. |
|
Testing submitted! Code looks good to me :) |
This bug patch fixes a crash seen while querying the bottom type of MachTempNode corresponding to rxmm0 operand of blend pattern during late scheduling. Here, MaxVectorSize is contrainted to 8 bytes thus during C2 type system initialization, TypeVect::VECTX guarded by target supprted vector size remains uninitialized.
Its better to reject matching of VectorBlend in such a scenario.
All exisitng VectorAPI jtreg tests are passing with -XX:UseAVX=0 and -XX:MaxVectorSize=8
Kindly review and share your feedback.
Best Regards,
Jatin
Progress
Issue
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/28533/head:pull/28533$ git checkout pull/28533Update a local copy of the PR:
$ git checkout pull/28533$ git pull https://git.openjdk.org/jdk.git pull/28533/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 28533View PR using the GUI difftool:
$ git pr show -t 28533Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/28533.diff
Using Webrev
Link to Webrev Comment