RFR: 8357460: RISC-V: Optimize array fill stub for small size [v2]
Feilong Jiang
fjiang at openjdk.org
Fri May 23 06:19:37 UTC 2025
> Please consider.
> As discussed in https://github.com/openjdk/jdk/pull/23890#discussion_r2094920943, we can also further optimize the array fill stub by unrolling the storage of values when the size is less than 8.
>
> This PR also removes the **aligned tail part** with the consideration of code size and testing coverage. As the test reveals there are no significant regressions.
>
>
> Before:
> Benchmark (size) Mode Cnt Score Error Units
> ArrayFill.fillByteArray 7 avgt 12 27.215 ± 0.073 ns/op
> ArrayFill.fillByteArray 15 avgt 12 32.687 ± 0.904 ns/op
> ArrayFill.fillIntArray 7 avgt 12 28.629 ± 0.006 ns/op
> ArrayFill.fillIntArray 15 avgt 12 29.351 ± 0.009 ns/op
> ArrayFill.fillShortArray 7 avgt 12 30.776 ± 0.006 ns/op
> ArrayFill.fillShortArray 15 avgt 12 31.724 ± 0.447 ns/op
> ArrayFill.zeroByteArray 7 avgt 12 27.199 ± 0.006 ns/op
> ArrayFill.zeroByteArray 15 avgt 12 32.685 ± 0.900 ns/op
> ArrayFill.zeroIntArray 7 avgt 12 28.630 ± 0.007 ns/op
> ArrayFill.zeroIntArray 15 avgt 12 29.352 ± 0.011 ns/op
> ArrayFill.zeroShortArray 7 avgt 12 30.776 ± 0.006 ns/op
> ArrayFill.zeroShortArray 15 avgt 12 31.497 ± 0.012 ns/op
>
> After:
> Benchmark (size) Mode Cnt Score Error Units
> ArrayFill.fillByteArray 7 avgt 12 20.137 ± 0.042 ns/op
> ArrayFill.fillByteArray 15 avgt 12 32.928 ± 0.004 ns/op
> ArrayFill.fillIntArray 7 avgt 12 28.630 ± 0.004 ns/op
> ArrayFill.fillIntArray 15 avgt 12 29.344 ± 0.005 ns/op
> ArrayFill.fillShortArray 7 avgt 12 31.494 ± 0.004 ns/op
> ArrayFill.fillShortArray 15 avgt 12 31.492 ± 0.008 ns/op
> ArrayFill.zeroByteArray 7 avgt 12 19.980 ± 0.164 ns/op
> ArrayFill.zeroByteArray 15 avgt 12 32.927 ± 0.004 ns/op
> ArrayFill.zeroIntArray 7 avgt 12 28.629 ± 0.005 ns/op
> ArrayFill.zeroIntArray 15 avgt 12 29.346 ± 0.006 ns/op
> ArrayFill.zeroShortArray 7 avgt 12 32.193 ± 0.027 ns/op
> ArrayFill.zeroShortArray 15 avgt 12 31.495 ± 0.010 ns/op
>
>
> Testing:
> - [x] tier1
Feilong Jiang has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains three additional commits since the last revision:
- Merge branch 'openjdk:master' into riscv-optimize-generate-fill
- Merge branch 'master' of https://github.com/openjdk/jdk into riscv-optimize-generate-fill
- optimize array fill stub for small size
-------------
Changes:
- all: https://git.openjdk.org/jdk/pull/25350/files
- new: https://git.openjdk.org/jdk/pull/25350/files/5deb7146..79e09023
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jdk&pr=25350&range=01
- incr: https://webrevs.openjdk.org/?repo=jdk&pr=25350&range=00-01
Stats: 2391 lines in 61 files changed: 1664 ins; 474 del; 253 mod
Patch: https://git.openjdk.org/jdk/pull/25350.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/25350/head:pull/25350
PR: https://git.openjdk.org/jdk/pull/25350
More information about the hotspot-compiler-dev
mailing list