[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
Tue Jun 11 18:28:16 UTC 2024


On Sat, 8 Jun 2024 09:04:31 GMT, Andrew Haley <aph at openjdk.org> wrote:

> > In other words, on this trivial workload, this saves us ~0.15% of code cache. If this holds for larger apps, this amounts at about 192K 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.
> 
> So this is the kind of argument that should have been made.

True. Are you satisfied with it?

> It's not quite obvious that it'll help a hot path, though. ARMv8.4 made a change that makes LDP and STP atomic in some cases (see "Changes to single-copy atomicity in Armv8.4"). While this is very useful, it is a behavioural change. I'm guessing that there won't be any regressions for spills and fills, because stack-local accesses are uncontended.

Yup. I expect that if LDP/STP merging becomes problematic on some platforms, the merging code would somehow account for that. This seems orthogonal to what this patch is doing.

-------------

PR Comment: https://git.openjdk.org/jdk21u-dev/pull/665#issuecomment-2161366671


More information about the jdk-updates-dev mailing list