[Mlir-commits] [mlir] Adding masked operation to OpenMP Dialect (PR #96022)
Sergio Afonso
llvmlistbot at llvm.org
Wed Jul 3 05:01:54 PDT 2024
================
@@ -1577,4 +1577,23 @@ def DeclareReductionOp : OpenMP_Op<"declare_reduction", [IsolatedFromAbove,
let hasRegionVerifier = 1;
}
+//===----------------------------------------------------------------------===//
+// [Spec 5.2] 10.5 masked Construct
+//===----------------------------------------------------------------------===//
+def MaskedOp : OpenMP_Op<"masked", clauses = [
+ OpenMP_FilterClause
+ ], singleRegion = 1> {
+ 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.
+ }] # clausesDescription;
+
+ let regions = (region AnyRegion:$region);
+
+ let builders = [
+ OpBuilder<(ins CArg<"const MaskedClauseOps &">:$clauses)>
----------------
skatrak wrote:
We're currently missing the corresponding constructor definition in llvm-project/mlir/lib/Dialect/OpenMP/IR/OpenMPDialect.cpp, as well as updating the `MaskedClauseOps` definition in mlir/include/mlir/Dialect/OpenMP/OpenMPClauseOperands.h (you will have to create a new `FilterClauseOps` structure and just add it to the list of clauses for `MaskedClauseOps` in the same file).
https://github.com/llvm/llvm-project/pull/96022
More information about the Mlir-commits
mailing list