JonChesterfield added a comment. In D75917#1916160 <https://reviews.llvm.org/D75917#1916160>, @sameerds wrote:
> how this builtin fits in with the overall scheme of language-specific and > target-specific details of an atomic operation. For example, is this meant > only for OpenCL? Does it work with CUDA? Or HIP? What is the behaviour for > scope in C++? Identical to the fence instruction. Which is assumed well thought through already, given it's an IR instruction. As far as I can tell, fence composes sensibly with other IR then generates the right thing at the back end. So it looks fit for purpose, just not currently available from clang. ================ Comment at: clang/lib/CodeGen/CGBuiltin.cpp:3707 + Value *Scope = EmitScalarExpr(E->getArg(1)); + auto ScopeModel = AtomicScopeModel::create(AtomicScopeModelKind::OpenCL); + ---------------- sameerds wrote: > The proposed builtin does not claim to be an OpenCL builtin, so it's probably > not correct to simply assume the OpenCL model. Should the model be chosen > based on the source language specified? The only values for AtomicScopeModelKind are none and OpenCL. Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D75917/new/ https://reviews.llvm.org/D75917 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits