[jdk21u-dev] RFR: 8320379: C2: Sort spilling/unspilling sequence for better ld/st merging into ldp/stp on AArch64
Aleksey Shipilev
shade at openjdk.org
Fri Jun 7 18:12:13 UTC 2024
On Fri, 7 Jun 2024 17:51:07 GMT, Andrew Haley <aph-open at littlepinkcloud.com> wrote:
> So if there's a cost-benefit argument to be made, then feature backport PRs (as opposed to bug fixes) should at least make the argument. It is not obvious to me where the cost-benefit argument lands in this case.
Out of my own curiosity, did the following test to confirm my gut feelings about this patch:
% for I in `seq 1 5`; do build/linux-aarch64-server-release/images/jdk/bin/java -Xcomp -XX:-TieredCompilation -Xbatch -XX:ActiveProcessorCount=1 -XX:+CITime Hello.java 2>&1 | grep "nmethod code size"; done
# Before
nmethod code size : 3781016 bytes
nmethod code size : 3780984 bytes
nmethod code size : 3780984 bytes
nmethod code size : 3780984 bytes
nmethod code size : 3780984 bytes
# After
nmethod code size : 3775176 bytes
nmethod code size : 3775176 bytes
nmethod code size : 3775176 bytes
nmethod code size : 3775144 bytes
nmethod code size : 3775176 bytes
In other words, on this trivial workload, this saves us ~0.2% of code cache. If this holds for larger apps, this amounts at about 256K for 128M code cache. This looks like a benefit enough for the cost of this backport :) It would, of course, impact even higher when we miss `ldp` optimization somewhere near heavy spills on a hot path.
-------------
PR Comment: https://git.openjdk.org/jdk21u-dev/pull/665#issuecomment-2155297100
More information about the jdk-updates-dev
mailing list