[Mlir-commits] [mlir] Adding masked operation to OpenMP Dialect (PR #96022)

Sergio Afonso llvmlistbot at llvm.org
Wed Jun 26 04:58:34 PDT 2024


================
@@ -2149,4 +2149,25 @@ def DeclareReductionOp : OpenMP_Op<"declare_reduction", [Symbol,
   let hasRegionVerifier = 1;
 }
 
+//===----------------------------------------------------------------------===//
+// [Spec 5.2] 10.5 masked Construct
+//===----------------------------------------------------------------------===//
+def MaskedOp : OpenMP_Op<"masked"> {
+  let summary = "masked construct";
+  let description = [{
+    Masked construct allows to specify a structured block to be executed by a subset of 
+    threads of the current team. Filter clause allows to select the threads expected to
+    execute the region
+  }];
+
+  let arguments = (ins Optional<I32>:$filteredThreadId);
----------------
skatrak wrote:

Nit: I think it's better to relax the type requirement, since the spec only states that it should be an integer type.
```suggestion
  let arguments = (ins Optional<IntLikeType>:$filteredThreadId);
```

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


More information about the Mlir-commits mailing list