Integrated: 8344916: RISC-V: Misaligned access in array fill stub
Fei Yang
fyang at openjdk.org
Tue Nov 26 01:03:44 UTC 2024
On Sun, 24 Nov 2024 07:27:08 GMT, Fei Yang <fyang at openjdk.org> wrote:
> Hi, Please review this small change.
>
> In `generate_fill`, we fill the remaining elements by a single 8-byte store when the remaining count is less than 8 bytes in size after `fill_words`. This may overwrite some elements and create misaligned access. While it's not an issue for mordern CPUs with fast misaligned access, this does affect performance on CPUs where misaligned access is emulated by a trap handler and thus is very slow. async-profiler tells 2.8% of `jshort_fill` in flame graph when sampling Specjbb2005 on these platforms.
>
> In this particular case, the copy address `to` is 8-byte aligned after `fill_words`. So if `AvoidUnalignedAccesses` is true, one choice would be directing control to `L_fill_elements` which avoids alignment issue while filling the remaining elements.
>
> Test on linux-riscv64 platform:
> - [x] tier1-3 (release)
> - [x] 2.5% Specjbb2005 performance benefit on both HiFive Unmatched and Premier P550 SBCs.
> - [x] No obvious performance impact witnessed on other platforms like BFI-F3 or Pioneer box (-XX:+AvoidUnalignedAccesses).
This pull request has now been integrated.
Changeset: 5e0d42b6
Author: Fei Yang <fyang at openjdk.org>
URL: https://git.openjdk.org/jdk/commit/5e0d42b6a633d58d7303257569a7b45483f2db53
Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod
8344916: RISC-V: Misaligned access in array fill stub
Reviewed-by: rehn, mli
-------------
PR: https://git.openjdk.org/jdk/pull/22347
More information about the hotspot-compiler-dev
mailing list