[clang] [OpenACC][CIR] Implement atomic update lowering (PR #164836)

Andy Kaylor via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 24 10:46:36 PDT 2025


================
@@ -353,6 +361,50 @@ CIRGenFunction::emitOpenACCAtomicConstruct(const OpenACCAtomicConstruct &s) {
                        s.clauses());
     return mlir::success();
   }
+  case OpenACCAtomicKind::None:
+  case OpenACCAtomicKind::Update: {
+    mlir::Value x = emitLValue(inf.X).getPointer();
+    auto op =
+        mlir::acc::AtomicUpdateOp::create(builder, start, x, /*ifCond=*/{});
+    emitOpenACCClauses(op, s.getDirectiveKind(), s.getDirectiveLoc(),
+                       s.clauses());
+    mlir::LogicalResult res = mlir::success();
+    {
+      mlir::Type argTy = cast<cir::PointerType>(x.getType()).getPointee();
+      mlir::OpBuilder::InsertionGuard guardCase(builder);
----------------
andykaylor wrote:

It feels kind of weird for this not to be the first thing in the scope. Any reason for that?

https://github.com/llvm/llvm-project/pull/164836


More information about the cfe-commits mailing list