RFR: 8372862: AArch64: Fix GetAndSet-acquire costs after JDK-8372188
Dean Long
dlong at openjdk.org
Tue Dec 2 18:41:44 UTC 2025
On Tue, 2 Dec 2025 10:44:24 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:
> I just noticed (while looking at [JDK-8372800](https://bugs.openjdk.org/browse/JDK-8372800)) that I made a little error in [JDK-8372188](https://bugs.openjdk.org/browse/JDK-8372188) refactor, which made GetAndSet-acquire instruction cost twice as high. The usual cost for acquire versions are twice as low, likely to be selected instead of non-acquire versions.
>
> This bug happened as I "simplified" stencils at some point by dropping some arguments and renumbering the remaining ones. This is one place where I apparently forgot to renumber one usage. See other checks for `ifelse($3,Acq,...` in that stencil, all of them are `$3` (correct), not `$4` (incorrect). Seen no real bugs because of this mishap, but it would be good to fix it in case we see issues later. I also looked at stencils again, and I think there are no other argument-index problems like this anywhere else.
>
> The real change is in `aarch64_atomic_ad.m4`, `.ad` is re-generated from that stencil.
>
> Additional testing:
> - [x] Linux AArch64 server fastdebug, `all`
> - [ ] Linux AArch64 server fastdebug, quick jcstress run
Marked as reviewed by dlong (Reviewer).
I kicked off Oracle testing. I'm tempted to say this is trivial, reverting the costs to what they were before, but a 2nd review wouldn't hurt. I think the reason it didn't cause a regression is because in case of ties, the later acquire rule is still the first candidate.
-------------
PR Review: https://git.openjdk.org/jdk/pull/28598#pullrequestreview-3531635921
PR Comment: https://git.openjdk.org/jdk/pull/28598#issuecomment-3603461868
More information about the hotspot-compiler-dev
mailing list