Skip to content

Commit

Permalink
Minor changes in Scheduler
Browse files Browse the repository at this point in the history
  • Loading branch information
fbajraktariTT committed Nov 5, 2024
1 parent c038025 commit b0d3798
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/Scheduler/Scheduler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,19 @@ bool isTTIROp(mlir::Operation *op) {
}

bool isTTShedulableOp(mlir::Operation *op) {
return isTTNNOp(op) || isTTIROp(op);
return (isTTNNOp(op) || isTTIROp(op)) && (not isa<func::ReturnOp>(op));
}

// Init the dependencies map of all ops which are TTIR ops
Scheduler::Scheduler(func::FuncOp *func) {
for (auto &op : func->getOps()) {
for (mlir::Operation &op : func->getOps()) {
if (isTTShedulableOp(&op)) {
dependencies[&op] = {};
unscheduledOps.insert(&op);
}
}

for (auto &op : func->getOps()) {
for (mlir::Operation &op : func->getOps()) {
// Skip non TTIR operations
// Skip operations which do not implement DestinationStyleOpInterface
if (!isTTShedulableOp(&op)) {
Expand All @@ -46,7 +46,7 @@ Scheduler::Scheduler(func::FuncOp *func) {
for (mlir::Operation *use : result.getUsers()) {
// Skip non TTIR operations
// Skip operations which set the result
if (isTTShedulableOp(use) && use->getResult(0) != result) {
if (isTTShedulableOp(use)) {
dependencies[use].push_back(&op);
}
}
Expand Down

0 comments on commit b0d3798

Please sign in to comment.