RFR: 8288294: [vector] Add Identity/Ideal transformations for vector logic operations
Vladimir Kozlov
kvn at openjdk.org
Thu Jun 30 03:19:40 UTC 2022
On Thu, 30 Jun 2022 02:54:02 GMT, Xiaohong Gong <xgong at openjdk.org> wrote:
>> src/hotspot/share/opto/vectornode.cpp line 1802:
>>
>>> 1800: // (AndV (Replicate zero) src) => (Replicate zero)
>>> 1801: // (AndVMask (MaskAll zero) src) => (MaskAll zero)
>>> 1802: if (VectorNode::is_all_zeros_vector(in(1))) {
>>
>> Why you expect it to be `in(1)` instead of `in(2)` as in previous case? Do we create inputs in such order based on mask value?
>> At least add comment explaining it.
>
> We also have the case that the all zeros vector is `in(2)` in the followed codes. Please see line 1817. The main reason to do the different handle is the consideration for the predicated vector operations in Vector API.
That is what confuses me. The comment there says: `masked operation requires the unmasked lanes to save the same values in the first operand`.
I'm interpreting it as mask should be `in(2)`:
https://github.com/openjdk/jdk/blob/master/src/hotspot/cpu/aarch64/aarch64_sve.ad#L379
But here you check `in(1)`.
-------------
PR: https://git.openjdk.org/jdk/pull/9211
More information about the hotspot-compiler-dev
mailing list