[Mlir-commits] [mlir] [mlir][tosa] Verify the output shape of tosa.mul and tosa.rescale (PR #193952)
Sayan Saha
llvmlistbot at llvm.org
Fri Apr 24 06:23:19 PDT 2026
================
@@ -662,6 +662,21 @@ static void printShapeToDiagnostic(InFlightDiagnostic &diag,
llvm::interleaveComma(shape, diag, printDim);
}
+static LogicalResult
+verifyOutputShapeCompatibleWithExpected(Operation *op, ShapedType outputType,
+ ArrayRef<int64_t> expectedShape,
+ StringRef outputName = "output") {
+ if (succeeded(verifyCompatibleShape(outputType.getShape(), expectedShape)))
+ return success();
+
+ InFlightDiagnostic diag = op->emitOpError("expected ");
+ diag << outputName << " shape ";
+ printShapeToDiagnostic(diag, outputType.getShape());
+ diag << " to be compatible with expected shape ";
----------------
sahas3 wrote:
nit
```suggestion
diag << " to be compatible with inferred shape ";
```
avoids the double `expected` in the error message
https://github.com/llvm/llvm-project/pull/193952
More information about the Mlir-commits
mailing list