[flang-commits] [mlir] [flang] [acc] Initial implementation of MemoryEffects on `acc` operations (PR #75970)

Razvan Lupusoru via flang-commits flang-commits at lists.llvm.org
Tue Dec 19 14:17:00 PST 2023


================
@@ -299,50 +308,73 @@ class OpenACC_DataEntryOp<string mnemonic, string clause, string extraDescriptio
 // 2.5.13 private clause
 //===----------------------------------------------------------------------===//
 def OpenACC_PrivateOp : OpenACC_DataEntryOp<"private",
-    "mlir::acc::DataClause::acc_private", ""> {
+    "mlir::acc::DataClause::acc_private", "", [],
+    (ins OpenACC_PointerLikeTypeInterface:$varPtr)> {
   let summary = "Represents private semantics for acc private clause.";
+  let results = (outs Arg<OpenACC_PointerLikeTypeInterface,
+                          "Address of device variable",[MemWrite]>:$accPtr);
----------------
razvanlupusoru wrote:

> Can we use MemAlloc here?

I was conflicted what to do about the memory effects on `accPtr` for the `private` operation. For `firstprivate` it was more obvious because it gets written to. I agree that `MemAlloc` makes sense - I was just hesitant because scope for such case is important. And current placement of the `private` operation does not properly convey scope. So I think it is preferable to use `MemWrite` here for now. What do you think?

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


More information about the flang-commits mailing list