jrtc27 wrote:

> > lr/sc builtins are extremely fragile: there's no reasonable way for the 
> > compiler to guarantee that the sc is placed in such a way that it will 
> > eventually succeed.
> 
> I think the user should have enough knowledges about lr/sc to make the logic 
> reasonable.

It's not about knowledge, it's that they are basically impossible for the 
compiler to actually guarantee they'll work at all.

> If we don't provide these intrinsics, the user who wants to implement custom 
> locks will use inline assemly instead.

Good, because other than using C11-style atomics (or Itanium-style __sync 
builtins), that's the right thing to do.

https://github.com/llvm/llvm-project/pull/94578
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to