Increase stride size to better unroll more loops
Radosław Smogura
mail at smogura.eu
Fri Jul 2 15:39:48 UTC 2021
Hi all,
I wonder if you can take a look at this PR https://github.com/openjdk/jdk/pull/4658
It's about increasing stride size, to possible maximum value, but as there's no bug right now, so it can't go through pre-verify.
It has been found during this discussion [https://mail.openjdk.java.net/pipermail/panama-dev/2021-June/014310.html], that current stride size can prevent unrolling vector loops, both for buffers and arrays. However, this is proposition of quite generic change.
I'm not the expert here, but it looks like that stride size can be increase to max_jint / 2 - 2 just to prevent overflow in C2 when stride is doubled and some adjustments are added or subtracted.
The test has shown increase in performance, and disassembly shown vector loops to be unrolled 2-4 times in read and store to YMM registers.
In history I've found this change https://github.com/openjdk/panama-foreign/commit/2683d5390bd58683ae13bdd8582127c308d8fd04 to stride size, but I'm not sure if it really important.
Kind regards,
Rado
More information about the hotspot-compiler-dev
mailing list