missing memory barrier in acmp with C2

Andrew Haley aph at redhat.com
Wed Oct 26 18:15:51 UTC 2016


On 26/10/16 17:19, Aleksey Shipilev wrote:
> I understand the sentiment, and have nothing against it.
> 
> However, in the particular case of acmp barrier, loadload seems
> enough, because we are indeed only ordering the loads. No potential
> stores are of our interest here, and Hans' example talks about
> stores. As far as I understood Hans' argument over the years, it was
> basically about "think about what is happening around too", and we
> don't care about that for acmp.

Yes, I get that, in this particular case, it's OK.  No argument.  But
the additional cost of loadload|loadstore is close to zero (and may
actually be zero) on many architectures.  Except in some extraordinary
cases we don't need to apply such finicky reasoning.  And if we do, we
may get it wrong, and we only have to get it wrong once to suffer some
major pain.  So let's not go there.

Andrew.


More information about the shenandoah-dev mailing list