<div dir="ltr"><div dir="ltr"><div dir="ltr">Hi Andrew,<div> I tested "dmb.ishst; dmb.ishld" for release barrier. The test case is jmh of allocation with final fields. <a href="https://gist.github.com/kuaiwei/f71fba40df29991c93325a8600e34c13" target="_blank" style="font-family:Tahoma,Arial,STHeiti,SimSun;font-size:14px">https://gist.github.com/kuaiwei/f71fba40df29991c93325a8600e34c13</a></div><div>In N1</div><div> dmb.ish : 1168.059 ops/s</div><div> dmb.ishst+dmb.ishld: 1321.783 ops/s </div><div> dmb.ishst : 1511.267 ops/s</div><div>In N2</div><div><div> dmb.ish : 3672.087 ops/s</div><div> dmb.ishst+dmb.ishld: 4840.322 ops/s </div><div> dmb.ishst : 6005.430 ops/s</div><div><br></div><div>The "dmb.ishst+dmb.ishld" can gain 13% and 32% on N1 and N2. It looks a better replacement for "dmb.ish"</div><div><br></div><div>Thanks,</div><div>Kuai Wei</div><div></div></div></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Jan 17, 2024 at 10:49 PM Andrew Haley <<a href="mailto:aph-open@littlepinkcloud.com">aph-open@littlepinkcloud.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 1/11/24 11:58, Kuai Wei wrote:<br>
> Thanks for reply. I checked the previous discussion and not clear about the root cause.<br>
> <br>
> If you can provide more detail about the optimize, like what load or load dependency will be elided, so we may check chance to detect or prevent.<br>
<br>
We think you're probably right. However, C2 does a lot of reorganization,<br>
so it's hard to say that C2 can never predict what might be stored by<br>
static field initialization in one thread.<br>
<br>
If you're benchmarking this, can you try dmb st; dmb ld without fusing<br>
them together, thus avoiding a storeload? This would help us understand<br>
the performance benefit.<br>
<br>
-- <br>
Andrew Haley (he/him)<br>
Java Platform Lead Engineer<br>
Red Hat UK Ltd. <<a href="https://www.redhat.com" rel="noreferrer" target="_blank">https://www.redhat.com</a>><br>
<a href="https://keybase.io/andrewhaley" rel="noreferrer" target="_blank">https://keybase.io/andrewhaley</a><br>
EAC8 43EB D3EF DB98 CC77 2FAD A5CD 6035 332F A671<br>
<br>
</blockquote></div>