RFR: 8262355: Support for AVX-512 opmask register allocation. [v14]

Jatin Bhateja jbhateja at openjdk.java.net
Wed Mar 24 14:46:31 UTC 2021


On Tue, 23 Mar 2021 21:33:32 GMT, Vladimir Ivanov <vlivanov at openjdk.org> wrote:

>> Jatin Bhateja has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   8262355: Extending Type::isa_vect and Type::is_vect routines to TypeVectMask since its a valid vector type.
>
> src/hotspot/cpu/x86/x86_64.ad line 431:
> 
>> 429:     const_cast<RegMask*>(&_OPMASK_REG_mask)->Remove(OptoReg::as_OptoReg(k0->as_VMReg()));
>> 430:     const_cast<RegMask*>(&_OPMASK_REG_mask)->Remove(OptoReg::as_OptoReg(k0->as_VMReg()->next()));
>> 431:     // Post-loop multi-versioning expects mask to be present in K1 register, till the time
> 
> For `k1` you can add `PostLoopMultiversioning` check (which is an experimental flag and is turned off by default). Also, it's desireable to put `assert(PostLoopMultiversioning, ...)` into relevant AD instructions if you choose to do so.

Addressed

> src/hotspot/share/opto/compile.cpp line 2443:
> 
>> 2441: 
>> 2442: static bool is_vector_bitwise_cone_root(Node* n) {
>> 2443:   if (n->bottom_type()->isa_vectmask() || !is_vector_bitwise_op(n)) {
> 
> Why the check on `n->bottom_type()` is needed? I don't see how `is_vector_bitwise_op(n) == true` and `n->bottom_type()->isa_vectmask() == true` be valid at the same time.

It was added to skip few optimizations which work on vector types but may not be applicable for vector mask type.  Existing implementation treats masks as vectors and thus AndV / OrV ideal nodes are created for VectorMask.and/VectorMask.or APIs, thus turning off MacroLogic opt based on a vectmask check.

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

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


More information about the hotspot-compiler-dev mailing list