[Mlir-commits] [mlir] [flang][MLIR][OpenMP] Add support for `target update` directive. (PR #75047)

Akash Banerjee llvmlistbot at llvm.org
Mon Dec 11 06:47:24 PST 2023


================
@@ -1370,6 +1370,49 @@ def Target_ExitDataOp: OpenMP_Op<"target_exit_data",
   let hasVerifier = 1;
 }
 
+//===---------------------------------------------------------------------===//
+// 2.14.6 target update data Construct
+//===---------------------------------------------------------------------===//
+
+def Target_UpdateDataOp: OpenMP_Op<"target_update_data",
+                                                 [AttrSizedOperandSegments]>{
+  let  summary = "target update data construct";
+  let description = [{
+    The target update directive makes the corresponding list items in the device
+    data environment consistent with their original list items, according to the
+    specified motion clauses. The target update construct is a stand-alone
+    directive.
+
+    The optional $if_expr parameter specifies a boolean result of a
+    conditional check. If this value is 1 or is not provided then the target
+    region runs on a device, if it is 0 then the target region is executed
+    on the host device.
+
+    The optional $device parameter specifies the device number for the
+    target region.
+
+    The optional $nowait eliminates the implicit barrier so the parent
+    task can make progress even if the target task is not yet completed.
+
+    TODO: depend clause
+  }];
+
+  let arguments = (ins Optional<I1>:$if_expr,
+                       Optional<AnyInteger>:$device,
+                       UnitAttr:$nowait,
+                       Variadic<AnyType>:$motion_operands);
----------------
TIFitis wrote:

```suggestion
                       Variadic<OpenMP_PointerLikeType>:$motion_operands);
```
Can you check if changing this to `OpenMP_PointerLikeType` works?

Also, could you please change the field type for the other `$map_operands` to `OpenMP_PointerLikeType` as well? I think they are leftover as `AnyType` from older patches which have since been partially reverted.

Thanks :)

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


More information about the Mlir-commits mailing list