[flang-commits] [flang] [mlir] [MLIR][OpenMP] Support for dispatch construct with clauses nocontext & novariants (PR #215877)

Abid Qadeer via flang-commits flang-commits at lists.llvm.org
Wed Sep 9 07:17:54 PDT 2026


================
@@ -572,6 +572,17 @@ static LogicalResult checkImplementationStatus(Operation &op) {
         checkTaskReductionByref(op, result);
       })
       .Case([&](omp::TaskwaitOp op) { checkNowait(op, result); })
+      .Case([&](omp::DispatchOp op) {
+        // In OpenMP 5.0/5.1 `dispatch` creates an implicit task and `nowait`
+        // controls whether that task is included; in OpenMP 5.2 `nowait` has no
+        // effect on `dispatch`. The pre-5.2 asynchronous-task behavior is not
+        // yet implemented, so diagnose `nowait` for those versions; for 5.2 and
+        // later it is a legal no-op and is accepted.
+        int64_t version = omp::getOpenMPVersionAttribute(
+            op->getParentOfType<ModuleOp>(), /*fallback=*/50);
----------------
abidh wrote:

As I said in previous comment, the fallback version should be 51 as the construct was not present in 5.0.

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


More information about the flang-commits mailing list