diff options
Diffstat (limited to 'mlir/lib/Interfaces/DestinationStyleOpInterface.cpp')
| -rw-r--r-- | mlir/lib/Interfaces/DestinationStyleOpInterface.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/mlir/lib/Interfaces/DestinationStyleOpInterface.cpp b/mlir/lib/Interfaces/DestinationStyleOpInterface.cpp index 104b0fa4cb37..d89914e6585a 100644 --- a/mlir/lib/Interfaces/DestinationStyleOpInterface.cpp +++ b/mlir/lib/Interfaces/DestinationStyleOpInterface.cpp @@ -29,10 +29,15 @@ LogicalResult detail::verifyDestinationStyleOpInterface(Operation *op) { SmallVector<OpOperand *> outputBufferOperands, outputTensorOperands; for (OpOperand *operand : dstStyleOp.getOutputOperands()) { Type type = operand->get().getType(); - if (type.isa<MemRefType>()) + if (type.isa<MemRefType>()) { outputBufferOperands.push_back(operand); - if (type.isa<RankedTensorType>()) + } else if (type.isa<RankedTensorType>()) { outputTensorOperands.push_back(operand); + } else { + return op->emitOpError("expected that operand #") + << operand->getOperandNumber() + << " is a ranked tensor or a ranked memref"; + } } // Expect at least one output operand. |
