RFR: 8270446: Remove the MemBarNode that has been optimized from the current block
Vladimir Kozlov
kvn at openjdk.java.net
Wed Jul 14 15:53:16 UTC 2021
On Wed, 14 Jul 2021 07:35:25 GMT, SUN Guoyun <github.com+40024232+sunny868 at openjdk.org> wrote:
> Hi all,
> aarch64 and mips64 also had an optimization to merge two memory barrier instructions. But when I use the args -XX:+UnlockDiagnosticVMOptions -XX:+PrintOptoAssembly, I see some information like the following
>
> 1a0 membar_release
> dmb ish
> 1a4 membar_release
> dmb ish
> 1a4 spill R19 -> R0 # spill size = 64
>
>
> Here, "1a4 membar_release" is actually optimized out . so I think it should be better to display it like this
>
>
> 1a0 membar_release
> dmb ish
> 1a4 spill R19 -> R0 # spill size = 64
>
> Please review this trivial change.
>
> Thanks,
> Sun Guoyun
Modifying block during emit phase could be dangerous. These empty membars still used for instructions ordering.
And your case should be handled already:
https://github.com/openjdk/jdk/blob/master/src/hotspot/cpu/aarch64/aarch64.ad#L8517
`-XX:+PrintOptoAssembly` output should be `"membar_release (elided)"`
Please, look why it is not the case.
-------------
Changes requested by kvn (Reviewer).
PR: https://git.openjdk.java.net/jdk/pull/4774
More information about the hotspot-compiler-dev
mailing list