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

Jatin Bhateja jbhateja at openjdk.org
Mon May 29 07:06:29 UTC 2023


On Thu, 25 May 2023 03:55:05 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:
> 
>   Address review comments

src/hotspot/share/opto/inlinetypenode.cpp line 154:

> 152: // Merges 'this' with 'other' by updating the input PhiNodes added by 'clone_with_phis'
> 153: InlineTypeNode* InlineTypeNode::merge_with(PhaseGVN* gvn, const InlineTypeNode* other, int pnum, bool transform) {
> 154:   assert(this->Opcode() == other->Opcode(), "");

May I know the reason to remove this assertion? it ensures we never merge an InlineTypeNode with VectorBoxNode.

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

PR Review Comment: https://git.openjdk.org/valhalla/pull/845#discussion_r1208985042



More information about the valhalla-dev mailing list