[lworld+vector] RFR: 8304310: Initial compilers and runtime handling for multifield backed vectors. [v13]

Xiaohong Gong xgong at openjdk.org
Sat May 6 09:33:39 UTC 2023


On Thu, 4 May 2023 06:52:35 GMT, Jatin Bhateja <jbhateja at openjdk.org> wrote:

>> Please find below the summary of changes included with the patch:
>>   
>> a) _ci Model:_
>>    oops model creates separate fieldDescriptor/FieldInfo for each scalar field of a multifield bundle, root field is marked as multifield_base and non -  root (synthetic) fileds carry a multifield flag. To ease vector IR construction ci only exposes base multifield and ciType holding bundle size to compilers.
>> 
>> b) _C1 compiler:_
>>    Special handling to copy entire multifield bundle during withfield bytecode processing.
>> 
>> c) _C2 compiler:_
>>    VectorBox becomes a derivative of InlineType IR node, changes in vector box/unbox expansions. Preventing scalarization of Vector arguments and return values.
>> 
>> d) _Runtime:_
>>    Changes in object re-construction during deoptimization since now concrete vectors have multifield based payloads. Payload (VectorPayloadMF) is a primitive class object which gets fully flattened within its parent/holding instance i.e. a concrete vector, special handling has been added for non-flattened case where payload is allocated over heap and concrete vector payload field is assigned its reference.
>> 
>> e) Added type specific multifield payloads to ease vector IR creation by C2, this will ensure bundle type and C2 IR type are compatible.               
>> 
>> Scope of current changes is limited to Vector types only, shuffles and masks are still backed by array based payloads. This PoC patch has been validated over vector only tests. More robust validation will be done in due course.
>> 
>> More information can be found at following link
>> [https://cr.openjdk.org/~jbhateja/vectorIntrinsics/Valhalla/lworld%2Bvector.pptx](https://cr.openjdk.org/~jbhateja/vectorIntrinsics/Valhalla/lworld%2Bvector.pptx)
>> 
>> Please share your feedback and suggestions.
>> 
>> Best Regards,
>> Jatin
>
> Jatin Bhateja has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Handling multifield access through Unsafe.get API, some more cleanups.

src/hotspot/share/opto/vector.cpp line 326:

> 324: }
> 325: 
> 326: Node* PhaseVector::expand_vbox_node_helper(Node* vec_box,

The first VectorBox argument is not used and can be removed, right?

src/hotspot/share/opto/vector.cpp line 551:

> 549:                                           num_elem,
> 550:                                           bt);
> 551:       vec_val_load = gvn.transform(vec_val_load);

Can simply use "vec_unbox->obj()->as_as_InlineType()->field_value(0)" ?

src/hotspot/share/opto/vectornode.cpp line 1642:

> 1640:   // a VectorBox but we still need to traverse back through chain of cast nodes
> 1641:   // to get to the VectorBox.
> 1642:   if (n->is_InlineType() &&

Since compiler will generate an InlineTypeNode for any value/primitive instance, is there any other cases that the input of `VectorUnbox` is not an `InlineTypeNode` ?  If not, maybe we could remove this condition and add an assertion instead?

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

PR Review Comment: https://git.openjdk.org/valhalla/pull/833#discussion_r1186667820
PR Review Comment: https://git.openjdk.org/valhalla/pull/833#discussion_r1186670541
PR Review Comment: https://git.openjdk.org/valhalla/pull/833#discussion_r1186670350



More information about the valhalla-dev mailing list