RFR: 8270446: Remove the MemBarNode that has been optimized from the current block

Vladimir Kozlov kvn at openjdk.java.net
Thu Jul 15 20:06:18 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

Yes, if you want to see exact generated assembler you should use `-XX:+PrintAssembly`.
If you really want to fix OptoAssembly output for this case I would suggest to adjust `unnecessary_release()` method for this case if possible. But I don't see big benefit from this because you can see from addresses in output that code is empty.

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

PR: https://git.openjdk.java.net/jdk/pull/4774


More information about the hotspot-compiler-dev mailing list