@@ -36,9 +36,10 @@ class QuantizedTypeConverter : public TypeConverter {
36
36
static Type convertQuantizedType (QuantizedType quantizedType) {
37
37
return quantizedType.getStorageType ();
38
38
}
39
-
39
+
40
40
static Type convertTensorType (TensorType tensorType) {
41
- if (auto quantizedType = dyn_cast<QuantizedType>(tensorType.getElementType ()))
41
+ if (auto quantizedType =
42
+ dyn_cast<QuantizedType>(tensorType.getElementType ()))
42
43
return tensorType.clone (convertQuantizedType (quantizedType));
43
44
return tensorType;
44
45
}
@@ -50,7 +51,6 @@ class QuantizedTypeConverter : public TypeConverter {
50
51
}
51
52
52
53
public:
53
-
54
54
explicit QuantizedTypeConverter () {
55
55
addConversion ([](Type type) { return type; });
56
56
addConversion (convertQuantizedType);
@@ -63,7 +63,8 @@ class QuantizedTypeConverter : public TypeConverter {
63
63
};
64
64
65
65
// Conversion pass
66
- class StripFuncQuantTypes : public impl ::StripFuncQuantTypesBase<StripFuncQuantTypes> {
66
+ class StripFuncQuantTypes
67
+ : public impl::StripFuncQuantTypesBase<StripFuncQuantTypes> {
67
68
68
69
// Return whether a type is considered legal when occurring in the header of
69
70
// a function or as an operand to a 'return' op.
@@ -74,11 +75,10 @@ class StripFuncQuantTypes : public impl::StripFuncQuantTypesBase<StripFuncQuantT
74
75
}
75
76
76
77
public:
77
-
78
78
void runOnOperation () override {
79
-
79
+
80
80
auto moduleOp = cast<ModuleOp>(getOperation ());
81
- auto * context = &getContext ();
81
+ auto * context = &getContext ();
82
82
83
83
QuantizedTypeConverter typeConverter;
84
84
ConversionTarget target (*context);
@@ -111,4 +111,3 @@ class StripFuncQuantTypes : public impl::StripFuncQuantTypesBase<StripFuncQuantT
111
111
112
112
} // namespace quant
113
113
} // namespace mlir
114
-
0 commit comments