Skip to content

Commit ae50df9

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 b8f1228 commit ae50df9

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
@@ -474,7 +474,7 @@ def LinalgStructuredInterface
474474
int64_t resultIndex =
475475
opOperand->getOperandNumber() - $_op.getNumDpsInputs();
476476
assert(resultIndex >= 0 &&
477-
resultIndex < this->getOperation()->getNumResults());
477+
resultIndex < $_op.getNumDpsInits());
478478
Operation *yieldOp = getBlock()->getTerminator();
479479
return &yieldOp->getOpOperand(resultIndex);
480480
}]

0 commit comments

Comments
 (0)