RFR: 8288294: [vector] Add Identity/Ideal transformations for vector logic operations
Xiaohong Gong
xgong at openjdk.org
Thu Jun 30 03:33:44 UTC 2022
On Thu, 30 Jun 2022 03:17:34 GMT, Vladimir Kozlov <kvn at openjdk.org> wrote:
>> 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)`.
The comment means: for masked operations, the result of non-masked lanes should be from `in(1)`, and the masked lanes are from the operation results.
For `"AndV"` with zero, the results is zero. So if `in(1)` is all zeros vector which is the expected result, no matter whether the `AndV` is masked or not, the result is right (i.e. for masked `AndV`, the non-masked lanes should be from `in(1)`, and the masked lanes should be from the operation result which is also `in(1)`). But if the all zeros vector is `in(2)`, this transformation will the results not right for masked `AndV`. That's why I added `!is_predicated_vector()` limit for the second case while not for the first one.
-------------
PR: https://git.openjdk.org/jdk/pull/9211
More information about the hotspot-compiler-dev
mailing list