RFR: 8354242: VectorAPI: combine vector not operation with compare [v5]

Jatin Bhateja jbhateja at openjdk.org
Wed May 7 11:06:21 UTC 2025


On Wed, 7 May 2025 10:24:14 GMT, erifan <duke at openjdk.org> wrote:

>> src/hotspot/share/opto/vectornode.cpp line 2231:
>> 
>>> 2229:   }
>>> 2230:   if (in1->Opcode() != Op_VectorMaskCmp || in1->outcnt() > 1 ||
>>> 2231:       !((VectorMaskCmpNode*) in1)->predicate_can_be_inverted() ||
>> 
>> Do you plan  to extend your testcase /  matching logic to cover following equivalent patterns:
>> 
>> - compare.xor(maskAll(true))
>> - compare.xor(VectorMask.fromLong(SPECIES, -1L))
>
> Hi @jatin-bhateja It is feasible. But I was thinking about whether another solution would be better, which is to turn  `VectorMask.fromLong(SPECIES, -1L)` into `MaskAll(true)` in the mid-end. In this way, we don't need to check this pattern in this optimization. What do you think ?

Yes, that's the right approach. For this PR, I think you can mix some test points covering compare, xor(maskAll(true)).

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

PR Review Comment: https://git.openjdk.org/jdk/pull/24674#discussion_r2077373581


More information about the core-libs-dev mailing list