RFR: 8283232: x86: Improve vector broadcast operations [v13]
Quan Anh Mai
duke at openjdk.org
Thu Aug 4 07:41:15 UTC 2022
On Fri, 29 Jul 2022 13:48:07 GMT, Quan Anh Mai <duke at openjdk.org> wrote:
>> Hi,
>>
>> This patch improves the generation of broadcasting a scalar in several ways:
>>
>> - As it has been pointed out, dumping the whole vector into the constant table is costly in terms of code size, this patch minimises this overhead for vector replicate of constants. Also, options are available for constants to be generated with more alignment so that vector load can be made efficiently without crossing cache lines.
>> - Vector broadcasting should prefer rematerialising to spilling when register pressure is high.
>> - Load vectors using the same kind (integral vs floating point) of instructions as that of the results to avoid potential data bypass delay
>>
>> With this patch, the result of the added benchmark, which performs some operations with a really high register pressure, on my machine with Intel i7-7700HQ (avx2) is as follow:
>>
>> Before After
>> Benchmark Mode Cnt Score Error Score Error Units Gain
>> SpiltReplicate.testDouble avgt 5 42.621 ± 0.598 38.771 ± 0.797 ns/op +9.03%
>> SpiltReplicate.testFloat avgt 5 42.245 ± 1.464 38.603 ± 0.367 ns/op +8.62%
>> SpiltReplicate.testInt avgt 5 20.581 ± 5.791 13.755 ± 0.375 ns/op +33.17%
>> SpiltReplicate.testLong avgt 5 17.794 ± 4.781 13.663 ± 0.387 ns/op +23.22%
>>
>> As expected, the constant table sizes shrink significantly from 1024 bytes to 256 bytes for `long`/`double` and 128 bytes for `int`/`float` cases.
>>
>> This patch also removes some redundant code paths and renames some incorrectly named instructions.
>>
>> Thank you very much.
>
> Quan Anh Mai has updated the pull request incrementally with one additional commit since the last revision:
>
> add load_constant_vector
May I have this PR sponsored, please? Thanks a lot for your help.
-------------
PR: https://git.openjdk.org/jdk/pull/7832
More information about the hotspot-compiler-dev
mailing list