RFR: 8340093: C2 SuperWord: implement cost model [v4]
Emanuel Peter
epeter at openjdk.org
Wed Nov 5 12:55:18 UTC 2025
On Wed, 5 Nov 2025 12:33:58 GMT, Galder Zamarreño <galder at openjdk.org> wrote:
>> Emanuel Peter has updated the pull request incrementally with one additional commit since the last revision:
>>
>> rename cost methods for Vladimir K
>
>> [JDK-8370671](https://bugs.openjdk.org/browse/JDK-8370671) C2 SuperWord [x86]: implement Long.max/min reduction for AVX2
>
> This is familiar to me. I discovered this when I was intrinsifying MinL/MaxL for [JDK-8307513](https://bugs.openjdk.org/browse/JDK-8307513) and one of my servers only had AX2. Vectorization kicked in with AVX512 so I left it there.
>
>> Note: some of the min/max benchmarks are not very stable. That is due to random input data: in some cases the scalar performance is better because it uses branching.
>
> Looking at the results, seems like most instability is with doubles? In any case, on the topic of instability of min/max and branching, https://github.com/openjdk/jdk/pull/20098#issuecomment-2379386872 has a good analysis on past observations with the JMH benchmark now called `MinMaxVector`. This benchmark shapes the data such that data in the arrays is laid out to achieve a certain % of branch taken. It might not be fully applicable to the instabilities you observe but might help direct attention.
>
> WRT to the code changes in this PR, I don't have anything else to say other than I'm glad basic cases like [JDK-8345044](https://bugs.openjdk.org/browse/JDK-8345044) are getting solved.
@galderz Right, I did remember that you have had a better benchmark, and that's why I understood more quickly that the issue here with the doubles is just noise :)
-------------
PR Comment: https://git.openjdk.org/jdk/pull/27803#issuecomment-3491050395
More information about the hotspot-compiler-dev
mailing list