[Mlir-commits] [mlir] [mlir][Quant][NFC] Apply clang-format to `StripFuncQuantTypes.cpp` (PR #116535)
Matthias Springer
llvmlistbot at llvm.org
Sun Nov 17 00:44:47 PST 2024
https://github.com/matthias-springer created https://github.com/llvm/llvm-project/pull/116535
None
>From 7f3c9799b5fb40d9df5c47a8328a70140674867c Mon Sep 17 00:00:00 2001
From: Matthias Springer <mspringer at nvidia.com>
Date: Sun, 17 Nov 2024 09:43:57 +0100
Subject: [PATCH] [mlir][Quant][NFC] Apply clang-format to
`StripFuncQuantTypes.cpp`
---
.../Quant/Transforms/StripFuncQuantTypes.cpp | 15 +++++++--------
1 file changed, 7 insertions(+), 8 deletions(-)
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