RFR: JDK-8270147: Increase stride size allowing unrolling more loops [v7]
Vladimir Kozlov
kvn at openjdk.java.net
Wed Jul 14 03:14:13 UTC 2021
On Wed, 14 Jul 2021 01:06:45 GMT, Radoslaw Smogura <github.com+7535718+rsmogura at openjdk.org> wrote:
>> # Description
>>
>> Increase allowed stride size for loop unrolling to the maximum vector size on runtime platform.
>>
>> The motivation for this change is discussion and research about unrolling vector (SIMD) loops. For vector usage, stride size depends on vector element type, and platform vector size. For AVX256 and int stride size is 8, and loop unroll happens. However short and byte loops could not get unrolled (stride size 16 & 32):
>>
>> for (int i = 0; i < SPECIES.loopBound(longSize); i += SPECIES.length() /* 8 for int, 16 for short */ ) {
>> var v = ShortVector.fromByteBuffer(SPECIES, srcBufferHeap, i, ByteOrder.nativeOrder());
>> v.intoByteBuffer(dstBufferHeap, i, ByteOrder.nativeOrder());
>> }
>>
>> After this change, the maximum stride, which allows loops to unroll, will depend on the maximum bytes size of vectors registers (AVX256 - 32, AVX512 - 64, SVE up to 256)
>>
>> # Notes
>> Stride size was decreased some time ago https://github.com/openjdk/panama-foreign/commit/2683d5390bd58683ae13bdd8582127c308d8fd04
>>
>> The exact reasons for this are not known for me (over unroll of some loops?).
>>
>> Original thread https://mail.openjdk.java.net/pipermail/panama-dev/2021-June/014310.html
>
> Radoslaw Smogura has updated the pull request incrementally with one additional commit since the last revision:
>
> Add copyright headers.
Good.
I submitted SPEC benchmarks testing.
-------------
Marked as reviewed by kvn (Reviewer).
PR: https://git.openjdk.java.net/jdk/pull/4658
More information about the hotspot-compiler-dev
mailing list