[clang] [CIR] Add atomic load and store operations (PR #153814)
Sirui Mu via cfe-commits
cfe-commits at lists.llvm.org
Wed Aug 20 06:11:44 PDT 2025
================
@@ -187,12 +244,85 @@ void AtomicInfo::emitCopyIntoMemory(RValue rvalue) const {
}
}
+static void emitAtomicOp(CIRGenFunction &cgf, AtomicExpr *expr, Address dest,
+ Address ptr, Address val1, uint64_t size,
+ cir::MemOrder order) {
+ std::unique_ptr<AtomicScopeModel> scopeModel = expr->getScopeModel();
+ if (scopeModel) {
+ assert(!cir::MissingFeatures::atomicScope());
+ cgf.cgm.errorNYI(expr->getSourceRange(), "emitAtomicOp: atomic scope");
+ return;
+ }
+
+ assert(!cir::MissingFeatures::atomicSyncScopeID());
+
+ CIRGenBuilderTy &builder = cgf.getBuilder();
+ mlir::Location loc = cgf.getLoc(expr->getSourceRange());
+ auto orderAttr = cir::MemOrderAttr::get(builder.getContext(), order);
+
+ switch (expr->getOp()) {
+ default:
----------------
Lancern wrote:
Updated.
https://github.com/llvm/llvm-project/pull/153814
More information about the cfe-commits
mailing list