RFR: 8264104: Eliminate unnecessary vector mask conversion during VectorUnbox for floating point VectorMask [v4]

Vladimir Ivanov vlivanov at openjdk.java.net
Tue Apr 13 11:21:05 UTC 2021


On Tue, 13 Apr 2021 10:49:51 GMT, Jatin Bhateja <jbhateja at openjdk.org> wrote:

>> Xiaohong Gong has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Use "Matcher::match_rule_supported_vector" for vector nodes checking
>
> src/hotspot/cpu/aarch64/aarch64_sve_ad.m4 line 861:
> 
>> 859: instruct vmaskcast(vReg dst) %{
>> 860:   predicate(UseSVE > 0);
>> 861:   match(Set dst (VectorMaskCast dst));
> 
> A strict check based on in-type and out-type in predicate could strengthen the pattern.

I agree.

> src/hotspot/share/opto/vectornode.hpp line 1240:
> 
>> 1238: };
>> 1239: 
>> 1240: class VectorMaskCastNode : public VectorNode {
> 
> VectorMaskReinterpret seems better choice, since its a re-interpretation and not a casting (up/down).

Considering masks have platform-specific representation, full-blown casts between different element types look more appropriate here.

In this particular case, the focus is on the cheapest possible case when representations share the same bit pattern and the cast degenerates into a no-op. But in the longer term, it makes perfect sense to support the full matrix of conversions and don't rely on `VectorLoadMask <=> VectorStoreMask` and intermediate canonical vector representation.

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

PR: https://git.openjdk.java.net/jdk/pull/3238


More information about the hotspot-compiler-dev mailing list