-
Notifications
You must be signed in to change notification settings - Fork 767
Correct Mask unboxing in VectorAPIExpansion #21743
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
@BradleyWood fyi |
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.
Overall looks fine to me; minor refactoring suggested.
(operandObjectType == Mask && | ||
!isOpCodeImplemented(comp(), | ||
(maskConv = getLoadToMaskConversion(numLanes, | ||
TR::DataType::createMaskType(elementType, vectorLength), | ||
maskLoadOpCode))))) |
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 think this is far too complicated to put as a condition in an if statement; probably best to to refactor it out (especially since it's guarded by operandObjectType == Mask &&
).
@BradleyWood could you review from a code pov? |
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 guess my biggest complaint is that you address unboxing without fixing mask boxing. I don't really see it as much extra effort.
parentScalarized || // TODO: support unboxing into scalars | ||
(operandObjectType == Mask && | ||
!isOpCodeImplemented(comp(), | ||
(maskConv = getLoadToMaskConversion(numLanes, |
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 think if the load is a vector, you need to check support for the vload. I did find this expression hard to follow. For instance, you assign maskLoadOpCode inside the function call getLoadToMaskConversion
.
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.
Sure, I will simplify it.
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.
We don't check for vload
in several other places. I guess we assume that if a platform supports vectorization (check at the beginning of this opt) then vload/vstore
are supported.
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.
Simplified the code.
bitsLength != 128 || | ||
parentScalarized) // TODO: support unboxing into scalars | ||
elementType != TR::Int8 || // TODO: support more types (needs support in createClassesForBoxing) | ||
bitsLength != 128 || |
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.
any reason to limit this to 128-bit?
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.
Yes, we need to create class objects for all other types. I would like to give it a thought on what's the best way to do it.
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.
The TODO comment explains why only 128-bit.
I prefer to make incremental changes in this case. |
Made dependent on eclipse-omr/omr#7737 since we replaced |
Just wanted to note that Vector API boxing/unboxing is currently not enabled by default. The whole feature is still WIP with many remaining todos. |
- use the same code as for loading a mask from an array
Addressed comments above. |
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.
LGTM; will wait for @BradleyWood's OK.
jenkins test sanity all jdk21 depends eclipse-omr/omr#7737 |
Running tests pre-emptively; but won't be able to merge until either the OMR PR gets merged (which is contingent on the OMR Jenkins instance being operational or the change is verified with some internal/personal build). Testing all because the change here is common code. |
Only failure due to known issue:
This PR is ok to merge once the OMR PR gets merged. |
Merged the OMR PR; will need to wait until it propagates to openj9-omr before I merge this one. |
Dependent OMR changes have propagated to openj9-omr; merging. |
Depends on: eclipse-omr/omr#7737