RFR: 8360654: AArch64: Remove redundant dmb from C1 compareAndSet [v2]

Andrew Haley aph at openjdk.org
Wed Aug 6 14:10:10 UTC 2025


On Tue, 5 Aug 2025 14:45:58 GMT, Samuel Chee <duke at openjdk.org> wrote:

> My proposal is:
> 
>     1. For `cmpxchg`, we add a trailingDMB option, and emit if `!useLSE && trailingDMB`, moving the dmbs from outside to inside the method. Have default value for trailingDMB be false so other call sites won't emit this dmb hence won't be affected.

I think it would be better to refactor things so that the intent is clear. better have `cmpxchg_barrier` and use that for C1.

>     2. In a separate ticket, `cmpxchgptr` and `cmpxchgw` already have DMBs inside their method definitions, so add extra trailingDMB parameter defaulted to true. And emit dmb if true.

Likewise.

>     3. In a separate ticket, apply same logic to `atomic_##NAME` to move DMB inside function and default trailingDMB to false to not affect other call sites.

Likewise.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/26000#discussion_r2257304936


More information about the hotspot-compiler-dev mailing list