[Mlir-commits] [mlir] f0b8025 - [mlir][Quant][NFC] Apply clang-format to `StripFuncQuantTypes.cpp` (#116535)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Sun Nov 17 00:45:07 PST 2024
Author: Matthias Springer
Date: 2024-11-17T17:45:04+09:00
New Revision: f0b8025ca27f722777dcf3fe8b9e367d18bb2eb1
URL: https://github.com/llvm/llvm-project/commit/f0b8025ca27f722777dcf3fe8b9e367d18bb2eb1
DIFF: https://github.com/llvm/llvm-project/commit/f0b8025ca27f722777dcf3fe8b9e367d18bb2eb1.diff
LOG: [mlir][Quant][NFC] Apply clang-format to `StripFuncQuantTypes.cpp` (#116535)
Added:
Modified:
mlir/lib/Dialect/Quant/Transforms/StripFuncQuantTypes.cpp
Removed:
################################################################################
diff --git a/mlir/lib/Dialect/Quant/Transforms/StripFuncQuantTypes.cpp b/mlir/lib/Dialect/Quant/Transforms/StripFuncQuantTypes.cpp
index 8996eff61a39c0..61912722662830 100644
--- a/mlir/lib/Dialect/Quant/Transforms/StripFuncQuantTypes.cpp
+++ b/mlir/lib/Dialect/Quant/Transforms/StripFuncQuantTypes.cpp
@@ -36,9 +36,10 @@ class QuantizedTypeConverter : public TypeConverter {
static Type convertQuantizedType(QuantizedType quantizedType) {
return quantizedType.getStorageType();
}
-
+
static Type convertTensorType(TensorType tensorType) {
- if (auto quantizedType = dyn_cast<QuantizedType>(tensorType.getElementType()))
+ if (auto quantizedType =
+ dyn_cast<QuantizedType>(tensorType.getElementType()))
return tensorType.clone(convertQuantizedType(quantizedType));
return tensorType;
}
@@ -50,7 +51,6 @@ class QuantizedTypeConverter : public TypeConverter {
}
public:
-
explicit QuantizedTypeConverter() {
addConversion([](Type type) { return type; });
addConversion(convertQuantizedType);
@@ -63,7 +63,8 @@ class QuantizedTypeConverter : public TypeConverter {
};
// Conversion pass
-class StripFuncQuantTypes : public impl::StripFuncQuantTypesBase<StripFuncQuantTypes> {
+class StripFuncQuantTypes
+ : public impl::StripFuncQuantTypesBase<StripFuncQuantTypes> {
// Return whether a type is considered legal when occurring in the header of
// a function or as an operand to a 'return' op.
@@ -74,11 +75,10 @@ class StripFuncQuantTypes : public impl::StripFuncQuantTypesBase<StripFuncQuantT
}
public:
-
void runOnOperation() override {
-
+
auto moduleOp = cast<ModuleOp>(getOperation());
- auto* context = &getContext();
+ auto *context = &getContext();
QuantizedTypeConverter typeConverter;
ConversionTarget target(*context);
@@ -111,4 +111,3 @@ class StripFuncQuantTypes : public impl::StripFuncQuantTypesBase<StripFuncQuantT
} // namespace quant
} // namespace mlir
-
More information about the Mlir-commits
mailing list