[lworld+vector] RFR: 8307715: Integrate VectorMask/Shuffle with value/primitive classes [v8]

Xiaohong Gong xgong at openjdk.org
Mon May 29 10:07:28 UTC 2023


On Mon, 29 May 2023 09:21:41 GMT, Xiaohong Gong <xgong at openjdk.org> wrote:

>> This patch changes the Vector API java side and hotspot compiler code to make the `VectorMask` and `VectorShuffle` operations work well after integrating with valhalla value/primitive classes.
>> 
>> Java side changes include:
>>  - Define the concrete `VectorMask/VectorShuffle `classes as value class.
>>  - Define the payload field type as primitive classes, which defines `MultiField` annotated field to save the element values.
>>  - Change all the relative API implementations, which use Unsafe APIs to access the new payload.
>>  - Move several VectorMask default operations to the abstract super class.
>>  - Minor code cleanup.
>> 
>> Compiler changes include:
>>  - Enable intrinsification for `VectorMask/VectorShuffle` related operations.
>>    Mask input/output of `VectorBox/VectorUnbox` is changed to the boolean vector format, to adapt C2's `InlineTypeNode`
>>    and new `VectorBox` features. Note that the mask input/output is a normal vector or predicate before.
>>  - Refine `VectorBox` expanding logic to make it right when the primitive payload instance is not flattened.
>>  - Minor code cleanup.
>> 
>> Basic VectorMask/VectorShuffle jtreg tests pass with"`-XX:+UnlockExperimentalVMOptions -XX:-EnableVectorSupport`",
>> and the basic unit tests work well after enabling vector support.
>
> Xiaohong Gong has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Check VectorBox later during merging through phi for InlineTypeNode

Hi Jatin, 

With following two patches applied on this PR, all the jtreg tests inside `[Byte|Short|Int|Float]256VectorTests.java` can pass on X86 AVX2 systems:
[fix.patch](https://github.com/openjdk/valhalla/files/11590714/fix.patch)
[deoptimize.patch](https://github.com/openjdk/valhalla/files/11590716/deoptimize.patch)

The first one (fix.patch) is used to fix the inlinetype mismatch issues that I also pasted above. I think it can also be pushed to the lworld branch. And the similar logic has been added in latest lworld. So I plan to push the patch after your merging patch is in. 

The second one is used to fix the deoptimization issue for the vectorized multifields. It's just a prototype which needs to be refine. I will try to publish it after this PR is merged.

You can run the tests by applying these two patches, or modify them if anything is wrong. Hope this could avoid some conflicts with you.

Thanks,
Xiaohong

-------------

PR Comment: https://git.openjdk.org/valhalla/pull/845#issuecomment-1566889270



More information about the valhalla-dev mailing list