Integrated: 8283232: x86: Improve vector broadcast operations
Quan Anh Mai
duke at openjdk.org
Thu Aug 4 16:31:27 UTC 2022
On Wed, 16 Mar 2022 01:19:24 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.
This pull request has now been integrated.
Changeset: 92d2982f
Author: Quan Anh Mai <anhmdq99 at gmail.com>
Committer: Jatin Bhateja <jbhateja at openjdk.org>
URL: https://git.openjdk.org/jdk/commit/92d2982f3f4ecf7d17df4267bd67af2490badd1e
Stats: 551 lines in 14 files changed: 357 ins; 85 del; 109 mod
8283232: x86: Improve vector broadcast operations
Reviewed-by: kvn, jbhateja
-------------
PR: https://git.openjdk.org/jdk/pull/7832
More information about the hotspot-compiler-dev
mailing list