RFR: 8342393: Promote commutative vector IR node sharing [v23]
Jatin Bhateja
jbhateja at openjdk.org
Fri Feb 7 14:13:15 UTC 2025
On Wed, 5 Feb 2025 09:48:09 GMT, Emanuel Peter <epeter at openjdk.org> wrote:
>> Jatin Bhateja has refreshed the contents of this pull request, and previous commits have been removed. The incremental views will show differences compared to the previous content of the PR. The pull request contains one new commit since the last revision:
>>
>> Lowering feature check to IR annotation level
>
> src/hotspot/share/opto/vectornode.cpp line 1058:
>
>> 1056: if (is_predicated_vector()) {
>> 1057: return false;
>> 1058: }
>
> Hmm. Can you give me a concrete example of a masked operation that would be filtered out?
>
> Can it for example be a `AddVI`? But that only has 2 inputs for `VEC1` and `VEC2`. Where would the mask be located - and why does that not get us to `req() > 3`?
>
> Ah, I see it can be added in `VectorNode::try_to_gen_masked_vector`, with `add_req`, but then we should have `req() > 3`.
>
> Ok, this looks a bit complicated, but it looks like we are doing this.
>
> // Generate a vector mask for vector operation whose vector length is lower than the
> // hardware supported max vector length.
>
>
> Ok, fine.
>
> It could be good to add a comment here though, explaining why the operation seemingly has 3 inputs, but we don't exit at `req() != 3` above.
Hi @eme64, Since we are selectively enabling commoning based on opcodes checks, hence skipping over their predicated counterparts should suffice.
Please find below the code reference adding mask operands it targets supports perdicated instructions.
https://github.com/openjdk/jdk/blob/master/src/hotspot/share/opto/vectorIntrinsics.cpp#L495
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/22863#discussion_r1946586266
More information about the hotspot-compiler-dev
mailing list