RFR: 8372154: AArch64: Match rule failure with some CompareAndSwap operand shapes [v2]
Aleksey Shipilev
shade at openjdk.org
Thu Nov 20 07:55:51 UTC 2025
> See bug for more details.
>
> Following up on [JDK-8371959](https://bugs.openjdk.org/browse/JDK-8371959) failures, I managed to reproduce the "bad AD" file assert. It is heavily intermittent, and needs hours of runs before we hit the lucky seed, plus [JDK-8360557](https://bugs.openjdk.org/browse/JDK-8360557) to have broader testing scope.
>
> It looks like `CastII` node accepts the wider operand type (`iRegI`), which fails to match against narrower type in CAS match rules (`iRegINoSp`). It makes sense to use `iRegINoSp` for destination regs, so that we do not start writing to these special registers. But for operand registers, it makes little sense, IMO. I note that cas.m4-generated CAE/WCAS stubs actually already have the wider `iRegI` for operand types.
>
> So it looks to me the manual CAS match rules should also use `iRegI`. It would be even better to auto-generate these match rules from M4 stencils, and I tried that, but ultimately decided it obscures the actual bug fix. [JDK-8372188](https://bugs.openjdk.org/browse/JDK-8372188) is dedicated to moving the match rules, hopefully without the semantic change.
>
> In this change, I dropped `*NoSp` from CAS operand match rules. It fixes the `iRegI` mismatch, and prepares us for harmonizing these rules with the rest of CAS/CAE generated ones.
>
> Additional testing:
> - [x] Linux AArch64 server fastdebug, local `bad AD` assert reproducer no longer fails
> - [ ] Linux AArch64 server fastdebug, `all`
> - [ ] Linux AArch64 server fastdebug, jcstress run
Aleksey Shipilev 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 two additional commits since the last revision:
- Merge branch 'master' into JDK-8372154-aarch64-cas-operand-match
- Fix
-------------
Changes:
- all: https://git.openjdk.org/jdk/pull/28398/files
- new: https://git.openjdk.org/jdk/pull/28398/files/fa95aa0f..cb459969
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jdk&pr=28398&range=01
- incr: https://webrevs.openjdk.org/?repo=jdk&pr=28398&range=00-01
Stats: 23201 lines in 445 files changed: 14248 ins; 5807 del; 3146 mod
Patch: https://git.openjdk.org/jdk/pull/28398.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/28398/head:pull/28398
PR: https://git.openjdk.org/jdk/pull/28398
More information about the hotspot-compiler-dev
mailing list