[Mlir-commits] [flang] [mlir] [mlir][OpenMP] Separate OutlinableInterface from taskloop LoopWrapper (PR #188068)
Sergio Afonso
llvmlistbot at llvm.org
Wed Apr 1 08:35:44 PDT 2026
================
@@ -3311,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;
----------------
skatrak wrote:
Nit: I think we can `return cast<TaskloopOp>(*llvm::find_if(...))` here. The verifier makes sure that there's one `TaskloopOp` in the region, so this will always find it.
https://github.com/llvm/llvm-project/pull/188068
More information about the Mlir-commits
mailing list