[Mlir-commits] [mlir] [flang][OpenACC] Fix host fallback for acc.atomic.update (PR #207597)
Razvan Lupusoru
llvmlistbot at llvm.org
Mon Jul 6 08:51:52 PDT 2026
================
@@ -155,3 +155,66 @@ func.func @declare_enter_exit(%arg0 : memref<i32>) attributes {acc.routine_info
acc.declare_exit token(%token) dataOperands(%0 : memref<i32>)
return
}
+
+//===----------------------------------------------------------------------===//
+// Atomic operations (host fallback)
+//===----------------------------------------------------------------------===//
+
+acc.routine @acc_routine_atomic_read func(@atomic_read) seq
+// CHECK-LABEL: func.func @atomic_read
+// CHECK-NOT: acc.atomic
+// CHECK: memref.load
+func.func @atomic_read(%src : memref<f64>, %dst : memref<f64>) attributes {acc.routine_info = #acc.routine_info<[@acc_routine_atomic_read]>} {
+ acc.atomic.read %dst = %src : memref<f64>, memref<f64>, f64
+ return
+}
+
+acc.routine @acc_routine_atomic_write func(@atomic_write) seq
+// CHECK-LABEL: func.func @atomic_write
+// CHECK-NOT: acc.atomic
+// CHECK: memref.store
+func.func @atomic_write(%addr : memref<f64>) attributes {acc.routine_info = #acc.routine_info<[@acc_routine_atomic_write]>} {
+ %val = arith.constant 5.0e-01 : f64
+ acc.atomic.write %addr = %val : memref<f64>, f64
+ return
+}
+
+acc.routine @acc_routine_atomic_update func(@atomic_update) seq
+// CHECK-LABEL: func.func @atomic_update
+// CHECK-NOT: acc.atomic
+// CHECK: arith.select
----------------
razvanlupusoru wrote:
Can you please update the CHECK lines to include all of the cloned operations and also include ssa value checks to make sure everything is threaded through correctly?
https://github.com/llvm/llvm-project/pull/207597
More information about the Mlir-commits
mailing list