[Mlir-commits] [mlir] [mlir][tosa] Change Rescale zero points to be inputs (PR #130340)

Luke Hutton llvmlistbot at llvm.org
Mon Mar 10 03:25:16 PDT 2025


================
@@ -254,6 +254,27 @@ static Type getStorageElementTypeOrSelf(Type type) {
   return elementType;
 }
 
+static LogicalResult verifyRescaleValueAndZpTypes(Operation *op, Value val,
+                                                  Value valZp, StringRef name) {
+  Type eType = getStorageElementTypeOrSelf(val.getType());
+  Type eZpType = getStorageElementTypeOrSelf(valZp.getType());
+
+  bool bothInts =
+      mlir::isa<IntegerType>(eType) && mlir::isa<IntegerType>(eZpType);
+  bool bothFloats =
----------------
lhutton1 wrote:

Do we need checks for float if rescale has already been checked to have integer only types (e.g. https://github.com/llvm/llvm-project/pull/130340/files#diff-90956ba24a2a97cc56a9a3659c7e46e56f1bd791a869246c6a758f9c93f1434fR2750)? Perhaps we can convert to an assert? 

https://github.com/llvm/llvm-project/pull/130340


More information about the Mlir-commits mailing list