@@ -51,7 +51,7 @@ QuantizedType::verifyInvariants(function_ref<InFlightDiagnostic()> emitError,
5151 (flags & QuantizationFlags::Signed) == QuantizationFlags::Signed;
5252
5353 // Integral storage type width checks
54- if (storageType. isa <IntegerType>()) {
54+ if (mlir:: isa<IntegerType>(storageType )) {
5555 unsigned integralWidth =
5656 llvm::dyn_cast<IntegerType>(storageType).getWidth ();
5757
@@ -60,7 +60,7 @@ QuantizedType::verifyInvariants(function_ref<InFlightDiagnostic()> emitError,
6060 }
6161
6262 int64_t defaultMin, defaultMax;
63- if (storageType. isa <IntegerType>()) {
63+ if (mlir:: isa<IntegerType>(storageType )) {
6464 const auto width = llvm::dyn_cast<IntegerType>(storageType).getWidth ();
6565 defaultMin = QuantizedType::getDefaultMinimumForInteger (isSigned, width);
6666 defaultMax = QuantizedType::getDefaultMaximumForInteger (isSigned, width);
@@ -74,8 +74,9 @@ QuantizedType::verifyInvariants(function_ref<InFlightDiagnostic()> emitError,
7474 defaultMin = QuantizedType::getDefaultMinimumForF4E2M1FN ();
7575 defaultMax = QuantizedType::getDefaultMaximumForF4E2M1FN ();
7676 } else {
77- return emitError () << " illegal storage type, supported types are: integral "
78- " types, Float8E4M3FNType, Float8E5M2Type and Float4E2M1FNType " ;
77+ return emitError ()
78+ << " illegal storage type, supported types are: integral "
79+ " types, Float8E4M3FNType, Float8E5M2Type and Float4E2M1FNType " ;
7980 }
8081
8182 // Verify storageTypeMin and storageTypeMax.
@@ -572,20 +573,25 @@ LogicalResult QuantileQuantizedType::verifyInvariants(
572573 }
573574
574575 unsigned typeWidth{};
575- if (storageType. isa <IntegerType>()) {
576+ if (mlir:: isa<IntegerType>(storageType )) {
576577 typeWidth = llvm::dyn_cast<IntegerType>(storageType).getWidth ();
577- } else if (mlir::isa<Float8E5M2Type, Float8E4M3FNType, Float4E2M1FNType>(storageType)) {
578- // Float8E5M2Type, Float8E4M3FNType and Float4E2M1FNType derive from FloatType.
578+ } else if (mlir::isa<Float8E5M2Type, Float8E4M3FNType, Float4E2M1FNType>(
579+ storageType)) {
580+ // Float8E5M2Type, Float8E4M3FNType and Float4E2M1FNType derive from
581+ // FloatType.
579582 typeWidth = llvm::dyn_cast<FloatType>(storageType).getWidth ();
580583 } else {
581- return emitError () << " illegal storage type, supported types are: integral "
582- " types, Float8E4M3FNType, Float8E5M2Type and Float4E2M1FNType " ;
584+ return emitError ()
585+ << " illegal storage type, supported types are: integral "
586+ " types, Float8E4M3FNType, Float8E5M2Type and Float4E2M1FNType " ;
583587 }
584588
585589 const size_t storageTypeRange = storageTypeMax - storageTypeMin + 1 ;
586590 const size_t typeWidthSize = 1 << typeWidth;
587591 const size_t expectedSize =
588- (storageTypeRange < typeWidthSize) && !mlir::isa<FloatType>(storageType) ? storageTypeRange : typeWidthSize;
592+ (storageTypeRange < typeWidthSize) && !mlir::isa<FloatType>(storageType)
593+ ? storageTypeRange
594+ : typeWidthSize;
589595
590596 const auto quantileArraySize = quantiles.size ();
591597 if (quantileArraySize != expectedSize) {
@@ -657,20 +663,25 @@ LogicalResult QuantileQuantizedPerAxisType::verifyInvariants(
657663 }
658664
659665 unsigned typeWidth{};
660- if (storageType. isa <IntegerType>()) {
666+ if (mlir:: isa<IntegerType>(storageType )) {
661667 typeWidth = llvm::dyn_cast<IntegerType>(storageType).getWidth ();
662- } else if (mlir::isa<Float8E5M2Type, Float8E4M3FNType, Float4E2M1FNType>(storageType)) {
663- // Float8E5M2Type, Float8E4M3FNType and Float4E2M1FNType derive from FloatType.
668+ } else if (mlir::isa<Float8E5M2Type, Float8E4M3FNType, Float4E2M1FNType>(
669+ storageType)) {
670+ // Float8E5M2Type, Float8E4M3FNType and Float4E2M1FNType derive from
671+ // FloatType.
664672 typeWidth = llvm::dyn_cast<FloatType>(storageType).getWidth ();
665673 } else {
666- return emitError () << " illegal storage type, supported types are: integral "
667- " types, Float8E4M3FNType, Float8E5M2Type and Float4E2M1FNType " ;
674+ return emitError ()
675+ << " illegal storage type, supported types are: integral "
676+ " types, Float8E4M3FNType, Float8E5M2Type and Float4E2M1FNType " ;
668677 }
669678
670679 const size_t storageTypeRange = storageTypeMax - storageTypeMin + 1 ;
671680 const size_t typeWidthSize = 1 << typeWidth;
672681 const size_t expectedSize =
673- (storageTypeRange < typeWidthSize) && !mlir::isa<FloatType>(storageType) ? storageTypeRange : typeWidthSize;
682+ (storageTypeRange < typeWidthSize) && !mlir::isa<FloatType>(storageType)
683+ ? storageTypeRange
684+ : typeWidthSize;
674685
675686 const auto quantileArraySize = quantiles.size ();
676687 if (quantileArraySize != expectedSize) {
0 commit comments