[Mlir-commits] [mlir] [MLIR][omp] Add omp.workshare op (PR #101443)

Kiran Chandramohan llvmlistbot at llvm.org
Fri Aug 2 02:30:39 PDT 2024


================
@@ -1683,6 +1683,19 @@ LogicalResult SingleOp::verify() {
                                   getCopyprivateSyms());
 }
 
+//===----------------------------------------------------------------------===//
+// WorkshareOp
+//===----------------------------------------------------------------------===//
+
+void WorkshareOp::build(OpBuilder &builder, OperationState &state,
+                        const WorkshareOperands &clauses) {
+  WorkshareOp::build(builder, state, clauses.nowait);
+}
+
+LogicalResult WorkshareOp::verify() {
+  return (*this)->getRegion(0).getBlocks().size() == 1 ? success() : failure();
----------------
kiranchandramohan wrote:

If you want to enforce the restriction of a single block then using `SingleBlock` trait is the recommended way.


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


More information about the Mlir-commits mailing list