RFR: 8320725: C2: Add "is_associative" flag for floating-point add-reduction [v3]

Bhavana Kilambi bkilambi at openjdk.org
Wed Apr 3 11:12:25 UTC 2024


On Mon, 18 Mar 2024 17:24:03 GMT, Andrew Haley <aph at openjdk.org> wrote:

>> Bhavana Kilambi has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Naming changes: replace strict/non-strict with more technical terms
>
> src/hotspot/cpu/aarch64/aarch64_vector.ad line 2858:
> 
>> 2856: // reduction addF
>> 2857: instruct reduce_add2F_neon(vRegF dst, vRegF fsrc, vReg vsrc) %{
>> 2858:   predicate(Matcher::vector_length(n->in(2)) == 2 && n->as_Reduction()->is_associative());
> 
> This `vector_length(n->in(2)) == 2` is very obscure. I suspect that anyone coming across this code would not understand it.
> 
> What exactly is the reason that this pattern is only applied for the 16b case? You need to give a justification in a comment right here.

This is for vector length of 8B (64 bits). It adds two floats. I have added my comments in the new PS.

> src/hotspot/share/opto/vectornode.hpp line 235:
> 
>> 233:   // Floating-point addition and multiplication are non-associative, so
>> 234:   // AddReductionVF/D and MulReductionVF/D require strict-ordering
>> 235:   // in auto-vectorization. Currently, Vector API allows
> 
> Don't say "currently".

Done

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

PR Review Comment: https://git.openjdk.org/jdk/pull/18034#discussion_r1549499929
PR Review Comment: https://git.openjdk.org/jdk/pull/18034#discussion_r1549498697


More information about the hotspot-compiler-dev mailing list