RFR: 8307513: C2: intrinsify Math.max(long,long) and Math.min(long,long) [v12]
Emanuel Peter
epeter at openjdk.org
Thu Mar 6 15:07:07 UTC 2025
On Thu, 27 Feb 2025 16:38:30 GMT, Galder ZamarreƱo <galder at openjdk.org> wrote:
>> Galder ZamarreƱo has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains 44 additional commits since the last revision:
>>
>> - Merge branch 'master' into topic.intrinsify-max-min-long
>> - Fix typo
>> - Renaming methods and variables and add docu on algorithms
>> - Fix copyright years
>> - Make sure it runs with cpus with either avx512 or asimd
>> - Test can only run with 256 bit registers or bigger
>>
>> * Remove platform dependant check
>> and use platform independent configuration instead.
>> - Fix license header
>> - Tests should also run on aarch64 asimd=true envs
>> - Added comment around the assertions
>> - Adjust min/max identity IR test expectations after changes
>> - ... and 34 more: https://git.openjdk.org/jdk/compare/47fdb836...a190ae68
>
> Also, I've started a [discussion on jmh-dev](https://mail.openjdk.org/pipermail/jmh-dev/2025-February/004094.html) to see if there's a way to minimise pollution of `Math.min(II)` compilation. As a follow to https://github.com/openjdk/jdk/pull/20098#issuecomment-2684701935 I looked at where the other `Math.min(II)` calls are coming from, and a big chunk seem related to the JMH infrastructure.
@galderz about:
> Additional performance improvement: make SuperWord recognize more cases as profitble (see Regression 1). Optional.
This should already be covered by these, and I will handle that eventually with the Cost-Model RFE [JDK-8340093](https://bugs.openjdk.org/browse/JDK-8340093):
- [JDK-8345044](https://bugs.openjdk.org/browse/JDK-8345044) Sum of array elements not vectorized
- (min/max of array)
- [JDK-8336000](https://bugs.openjdk.org/browse/JDK-8336000) C2 SuperWord: report that 2-element reductions do not vectorize
- You would for example see that on aarch64 machines with only neon/asimd support you can have at most 2 longs per vector, because the max vector length is 128 bits.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/20098#issuecomment-2704110051
More information about the core-libs-dev
mailing list