[Mlir-commits] [flang] [mlir] [mlir][OpenMP] Separate OutlinableInterface from taskloop LoopWrapper (PR #188068)
Kaviya Rajendiran
llvmlistbot at llvm.org
Tue Mar 24 10:49:50 PDT 2026
================
@@ -3232,6 +3232,32 @@ LogicalResult TaskgroupOp::verify() {
getTaskReductionByref());
}
+//===----------------------------------------------------------------------===//
+// TaskloopContextOp
+//===----------------------------------------------------------------------===//
+
+TaskloopOp TaskloopContextOp::getLoopOp() {
+ for (mlir::Operation &op : getRegion().front())
+ if (auto taskloopOp = dyn_cast<TaskloopOp>(&op))
+ return taskloopOp;
+ return nullptr;
+}
+
+LogicalResult TaskloopContextOp::verifyRegions() {
+ Region ®ion = getRegion();
+ if (region.empty())
+ return emitOpError() << "expected non-empty region";
+
----------------
kaviya2510 wrote:
```mlir
module {
func.func @parallel_taskloop(%lb : i32, %ub : i32, %step : i32) {
omp.taskloop.context {
omp.parallel {
omp.taskloop {
omp.loop_nest (%iv) : i32 = (%lb) to (%ub) inclusive step (%step) {
omp.yield
}
}
omp.terminator
}
omp.terminator
}
return
}
}
error: unexpected error: 'omp.taskloop.context' op expected exactly one TaskloopOp in the region, but 0 were found
omp.taskloop.context {
```
The error message for above testcase is misleading. Could you add a verifier check indicating that omp.taskloop.context expects an omp.taskloop region?
https://github.com/llvm/llvm-project/pull/188068
More information about the Mlir-commits
mailing list