@@ -563,7 +563,7 @@ static std::optional<int64_t> idivCheck(const int64_t lhs, const int64_t rhs) {
563563static Type getStorageElementTypeOrSelf (Type type) {
564564 auto srcType = getElementTypeOrSelf (type);
565565 if (auto quantType = llvm::dyn_cast<mlir::quant::QuantizedType>(srcType))
566- srcType = quantType. getStorageType ( );
566+ srcType = getStorageElementTypeFromQuantized (quantType );
567567 return srcType;
568568}
569569
@@ -631,16 +631,16 @@ static LogicalResult verifyConvOp(T op) {
631631 bool resultIsFloat = llvm::isa<FloatType>(resultEType);
632632
633633 if (auto quantType = llvm::dyn_cast<mlir::quant::QuantizedType>(inputEType))
634- inputEType = quantType. getStorageType ( );
634+ inputEType = getStorageElementTypeFromQuantized (quantType );
635635
636636 if (auto quantType = llvm::dyn_cast<mlir::quant::QuantizedType>(weightEType))
637- weightEType = quantType. getStorageType ( );
637+ weightEType = getStorageElementTypeFromQuantized (quantType );
638638
639639 if (auto quantType = llvm::dyn_cast<mlir::quant::QuantizedType>(biasEType))
640- biasEType = quantType. getStorageType ( );
640+ biasEType = getStorageElementTypeFromQuantized (quantType );
641641
642642 if (auto quantType = llvm::dyn_cast<mlir::quant::QuantizedType>(resultEType))
643- resultEType = quantType. getStorageType ( );
643+ resultEType = getStorageElementTypeFromQuantized (quantType );
644644
645645 if (biasIsFloat && resultIsFloat && (biasEType != resultEType)) {
646646 // for now, only enforce bias element type == result element type for
@@ -709,7 +709,7 @@ LogicalResult tosa::ConstOp::verify() {
709709
710710 if (auto result = llvm::dyn_cast<mlir::quant::QuantizedType>(
711711 outputType.getElementType ())) {
712- if (result. getStorageType ( ) == attrType.getElementType ())
712+ if (getStorageElementTypeFromQuantized (result ) == attrType.getElementType ())
713713 return success ();
714714 }
715715
@@ -727,7 +727,7 @@ static LogicalResult verifyConvOpModes(T op) {
727727 llvm::cast<ShapedType>(op.getInput ().getType ()).getElementType ();
728728
729729 if (auto quantType = llvm::dyn_cast<mlir::quant::QuantizedType>(inputEType))
730- inputEType = quantType. getStorageType ( );
730+ inputEType = getStorageElementTypeFromQuantized (quantType );
731731
732732 auto accType = op.getAccType ();
733733 if (inputEType.isInteger (8 ) && !accType.isInteger (32 ))
@@ -752,7 +752,7 @@ static LogicalResult verifyConvOpModes(T op) {
752752 llvm::cast<ShapedType>(op.getResult ().getType ()).getElementType ();
753753
754754 if (auto quantType = llvm::dyn_cast<mlir::quant::QuantizedType>(resultEType))
755- resultEType = quantType. getStorageType ( );
755+ resultEType = getStorageElementTypeFromQuantized (quantType );
756756
757757 return success ();
758758}
@@ -1179,13 +1179,13 @@ LogicalResult tosa::ClampOp::verify() {
11791179 llvm::cast<ShapedType>(getInput ().getType ()).getElementType ();
11801180 if (auto quantType =
11811181 llvm::dyn_cast<mlir::quant::UniformQuantizedType>(inputETy)) {
1182- inputETy = quantType. getStorageType ( );
1182+ inputETy = getStorageElementTypeFromQuantized (quantType );
11831183 }
11841184 mlir::Type outputETy =
11851185 llvm::cast<ShapedType>(getOutput ().getType ()).getElementType ();
11861186 if (auto quantType =
11871187 llvm::dyn_cast<mlir::quant::UniformQuantizedType>(outputETy)) {
1188- outputETy = quantType. getStorageType ( );
1188+ outputETy = getStorageElementTypeFromQuantized (quantType );
11891189 }
11901190 if (inputETy != outputETy)
11911191 return emitOpError (" input/output element types are incompatible." );
0 commit comments