RFR: 8289186: Support predicated vector load/store operations over X86 AVX2 targets. [v2]

Jatin Bhateja jbhateja at openjdk.org
Wed Jul 6 13:17:59 UTC 2022


On Wed, 6 Jul 2022 02:46:42 GMT, Xiaohong Gong <xgong at openjdk.org> wrote:

>> src/hotspot/share/opto/vectorIntrinsics.cpp line 313:
>> 
>>> 311:     if (!is_supported && (sopc == Op_StoreVectorMasked || sopc == Op_LoadVectorMasked)) {
>>> 312:       return true;
>>> 313:     }
>> 
>> Still unclear for me. As I understand `the upfront checks`, you mention, are checks at lines 270 and 286. So we know that `StoreVectorMasked` and `LoadVectorMasked` are supported.
>> The second part of your comment is talking about `non-predicated targets`. Does it mean that the real check should be next?:
>> 
>>    if (Matcher::has_predicated_vectors()) {
>>       ....
>>    } else if (sopc == Op_StoreVectorMasked || sopc == Op_LoadVectorMasked) {
>>      // your comment
>>      return true;
>>    }
>>    ```
>>    Or I am still missing what are you trying to do here?
>
> Could we change the `VectorMaskUseType` here https://github.com/openjdk/jdk/blob/master/src/hotspot/share/opto/vectorIntrinsics.cpp#L1221 instead of doing the modification here? Originally we assume `LoadVectorMasked/StoreVectorMasked` is implemented with predicated feature, we added the `VectorMaskUsePred`. If the assumption is changed now, we can just remove `VectorMaskUsePred` and so only `match_rule_supported_vector` is checked for such ops.

> 

Hi Vladimir,
L220 is checking for backend support for these IR using match_rule_supported_vector, if targets do not support them then we exit early,  LoadVectorMasked and StoreVectorMasked are special IR node which were added only for predicated targets.

I agree with @XiaohongGong that we can remove this constraint for masked memory operations from the caller side i.e. LibraryCallKit::inline_vector_mem_masked_operation,  such a constraint is only useful for shared IR nodes which can carry additional mask edge on common IR for predicated targets, since there we need to check for existence of blend + vector op as a fall back case.

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

PR: https://git.openjdk.org/jdk/pull/9324


More information about the hotspot-compiler-dev mailing list