Skip to content

Commit 76d2834

Browse files
committed
[mlir][linalg]-Fix wrong assertion in the getMatchingYieldValue interface
In order to have a consistent implementation for getMatchingYieldValue for linalg generic with buffer/tensor semantics, we should assert the opOperand index based on the numDpsInits and not numOfResults which may be zero in the buffer semantics.
1 parent c2d665b commit 76d2834

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mlir/include/mlir/Dialect/Linalg/IR/LinalgInterfaces.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,7 @@ def LinalgStructuredInterface
486486
int64_t resultIndex =
487487
opOperand->getOperandNumber() - $_op.getNumDpsInputs();
488488
assert(resultIndex >= 0 &&
489-
resultIndex < this->getOperation()->getNumResults());
489+
resultIndex < $_op.getNumDpsInits());
490490
Operation *yieldOp = getBlock()->getTerminator();
491491
return &yieldOp->getOpOperand(resultIndex);
492492
}]

0 commit comments

Comments
 (0)