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

Kareem Ergawy llvmlistbot at llvm.org
Wed Dec 13 20:51:16 PST 2023


================
@@ -915,6 +925,33 @@ static LogicalResult verifyMapClause(Operation *op, OperandRange mapOperands) {
       if (isa<ExitDataOp>(op) && to)
         return emitError(op->getLoc(),
                          "from, release and delete map types are permitted");
+
+      if (isa<UpdateDataOp>(op)) {
+        if (del) {
+          return emitError(op->getLoc(),
+                           "at least one of to or from map types must be "
+                           "specified, other map types are not permitted");
+        }
+
+        if (to & from) {
----------------
ergawy wrote:

> Did you mean to use && instead of & here?

My eyes are playing tricks on me, I used `&` to be consistent with the other checks in the same function; I thought other checks in the function use the same as well. For `bool`s both are equivalent. Anyway, changed it to `&&`.

> Regardless, I think we want to check for negation of exclusive or here so it should be if(to == from) then emit error.

Wouldn't it be better to have separate error messages for each situation? This is the main reason I separated them.

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


More information about the Mlir-commits mailing list