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

Xiaohong Gong xgong at openjdk.org
Thu Mar 30 04:11:11 UTC 2023


On Wed, 29 Mar 2023 00:28:47 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:
> 
>   Extend ci model to capture synthetic multi-fields, these are used for scalarization if target does not support load/store bundle size.

src/hotspot/share/ci/ciField.hpp line 213:

> 211:   friend class ciInstanceKlass;
> 212: 
> 213:   GrowableArray<ciField*>*   _secondary_fields;

Style: GrowableArray<ciField*>* _secondary_fields;

src/hotspot/share/ci/ciInlineKlass.hpp line 34:

> 32: #include "ci/ciSymbol.hpp"
> 33: #include "oops/inlineKlass.hpp"
> 34: #include "ci/ciField.hpp"

Style: please float this new "include" above line-30.

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

> 495:       assert(is_java_primitive(bt) || adr->bottom_type()->is_ptr_to_narrowoop() == UseCompressedOops, "inconsistent");
> 496:       if (value->bottom_type()->isa_vect()) {
> 497:         Node* store = kit->gvn().transform(StoreVectorNode::make(0, kit->control(), kit->memory(adr), adr, adr_type, value, vec_len));

Does it need to check the Op_StoreVector supported or not here?

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

> 771:     } else {
> 772:       // scalar default value to match the bundle size will be returned in subsiquent calls to default_value.
> 773:     }

Suggest to change to:

  BasicType bt = field_type->basic_type();
  Node* value = gvn.zerocon(bt);
  if (field_type->bundle_size() > 1 &&
      Matcher::match_rule_supported_vector(xxx, xxx, bt)) {
    value = gvn.transform(VectorNode::scalar2vector(value, ...));
  }

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

PR Review Comment: https://git.openjdk.org/valhalla/pull/833#discussion_r1152698744
PR Review Comment: https://git.openjdk.org/valhalla/pull/833#discussion_r1152699233
PR Review Comment: https://git.openjdk.org/valhalla/pull/833#discussion_r1152706204
PR Review Comment: https://git.openjdk.org/valhalla/pull/833#discussion_r1152707486



More information about the valhalla-dev mailing list