Skip to content

Commit

Permalink
Recursive inside dispatch region function
Browse files Browse the repository at this point in the history
  • Loading branch information
pjanevskiTT committed Sep 26, 2024
1 parent d7638b1 commit 4bea10c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/Dialect/TTKernel/IR/TTKernelOps.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,19 @@ namespace mlir::tt::ttkernel {
static bool insideDispatchOpRegion(mlir::Operation *op) {
mlir::Operation *parentOp = op->getParentOp();

if (dyn_cast_or_null<ttmetal::DispatchOp>(parentOp)) {
return true;
if (!parentOp) {
return false;
}

if (dyn_cast_or_null<scf::ForOp>(parentOp)) {
if (dyn_cast_or_null<ttmetal::DispatchOp>(parentOp)) {
return true;
}

if (dyn_cast_or_null<func::FuncOp>(parentOp) &&
dyn_cast_or_null<mlir::ModuleOp>(parentOp->getParentOp())) {
return true;
}
return false;
return insideDispatchOpRegion(parentOp);
}

::mlir::LogicalResult BuiltinOp::verify() {
Expand Down

0 comments on commit 4bea10c

Please sign in to comment.