[Mlir-commits] [mlir] 14124c3 - [mlir][NFC] Split MlirQuant into proper IR/Utils/Transforms libraries
River Riddle
llvmlistbot at llvm.org
Thu Feb 3 10:55:20 PST 2022
Author: River Riddle
Date: 2022-02-03T10:54:52-08:00
New Revision: 14124c30253600043eec74651faabccb06ac5627
URL: https://github.com/llvm/llvm-project/commit/14124c30253600043eec74651faabccb06ac5627
DIFF: https://github.com/llvm/llvm-project/commit/14124c30253600043eec74651faabccb06ac5627.diff
LOG: [mlir][NFC] Split MlirQuant into proper IR/Utils/Transforms libraries
This matches the structure of other dialects, and also removes
unnecessary dependencies from the core dialect lib.
Added:
mlir/lib/Dialect/Quant/IR/CMakeLists.txt
mlir/lib/Dialect/Quant/Transforms/CMakeLists.txt
mlir/lib/Dialect/Quant/Utils/CMakeLists.txt
Modified:
mlir/lib/Dialect/Quant/CMakeLists.txt
mlir/lib/Dialect/Tosa/CMakeLists.txt
mlir/lib/Dialect/Tosa/Transforms/CMakeLists.txt
mlir/test/lib/Dialect/Tosa/CMakeLists.txt
mlir/unittests/Dialect/Quant/CMakeLists.txt
Removed:
################################################################################
diff --git a/mlir/lib/Dialect/Quant/CMakeLists.txt b/mlir/lib/Dialect/Quant/CMakeLists.txt
index 5c447dcbc2e26..31167e6af908b 100644
--- a/mlir/lib/Dialect/Quant/CMakeLists.txt
+++ b/mlir/lib/Dialect/Quant/CMakeLists.txt
@@ -1,26 +1,3 @@
-add_mlir_dialect_library(MLIRQuant
- IR/QuantOps.cpp
- IR/QuantTypes.cpp
- IR/TypeDetail.h
- IR/TypeParser.cpp
- Transforms/ConvertConst.cpp
- Transforms/ConvertSimQuant.cpp
- Utils/QuantizeUtils.cpp
- Utils/UniformSupport.cpp
- Utils/FakeQuantSupport.cpp
-
- ADDITIONAL_HEADER_DIRS
- ${MLIR_MAIN_INCLUDE_DIR}/mlir/Dialect/QuantOps
-
- DEPENDS
- MLIRQuantOpsIncGen
- MLIRQuantPassIncGen
-
- LINK_LIBS PUBLIC
- MLIRArithmetic
- MLIRIR
- MLIRPass
- MLIRSideEffectInterfaces
- MLIRSupport
- MLIRTransformUtils
- )
+add_subdirectory(IR)
+add_subdirectory(Transforms)
+add_subdirectory(Utils)
diff --git a/mlir/lib/Dialect/Quant/IR/CMakeLists.txt b/mlir/lib/Dialect/Quant/IR/CMakeLists.txt
new file mode 100644
index 0000000000000..6115c51fa178f
--- /dev/null
+++ b/mlir/lib/Dialect/Quant/IR/CMakeLists.txt
@@ -0,0 +1,17 @@
+add_mlir_dialect_library(MLIRQuant
+ QuantOps.cpp
+ QuantTypes.cpp
+ TypeDetail.h
+ TypeParser.cpp
+
+ ADDITIONAL_HEADER_DIRS
+ ${MLIR_MAIN_INCLUDE_DIR}/mlir/Dialect/QuantOps/IR
+
+ DEPENDS
+ MLIRQuantOpsIncGen
+
+ LINK_LIBS PUBLIC
+ MLIRIR
+ MLIRSideEffectInterfaces
+ MLIRSupport
+ )
diff --git a/mlir/lib/Dialect/Quant/Transforms/CMakeLists.txt b/mlir/lib/Dialect/Quant/Transforms/CMakeLists.txt
new file mode 100644
index 0000000000000..0515e52fa0bdd
--- /dev/null
+++ b/mlir/lib/Dialect/Quant/Transforms/CMakeLists.txt
@@ -0,0 +1,19 @@
+add_mlir_dialect_library(MLIRQuantTransforms
+ ConvertConst.cpp
+ ConvertSimQuant.cpp
+
+ ADDITIONAL_HEADER_DIRS
+ ${MLIR_MAIN_INCLUDE_DIR}/mlir/Dialect/QuantOps/Transforms
+
+ DEPENDS
+ MLIRQuantPassIncGen
+
+ LINK_LIBS PUBLIC
+ MLIRArithmetic
+ MLIRIR
+ MLIRQuant
+ MLIRQuantUtils
+ MLIRPass
+ MLIRSupport
+ MLIRTransformUtils
+ )
diff --git a/mlir/lib/Dialect/Quant/Utils/CMakeLists.txt b/mlir/lib/Dialect/Quant/Utils/CMakeLists.txt
new file mode 100644
index 0000000000000..4efee44b884fd
--- /dev/null
+++ b/mlir/lib/Dialect/Quant/Utils/CMakeLists.txt
@@ -0,0 +1,13 @@
+add_mlir_dialect_library(MLIRQuantUtils
+ QuantizeUtils.cpp
+ UniformSupport.cpp
+ FakeQuantSupport.cpp
+
+ ADDITIONAL_HEADER_DIRS
+ ${MLIR_MAIN_INCLUDE_DIR}/mlir/Dialect/QuantOps/Utils
+
+ LINK_LIBS PUBLIC
+ MLIRIR
+ MLIRQuant
+ MLIRSupport
+ )
diff --git a/mlir/lib/Dialect/Tosa/CMakeLists.txt b/mlir/lib/Dialect/Tosa/CMakeLists.txt
index e2c30d8c41886..dab11399f6677 100644
--- a/mlir/lib/Dialect/Tosa/CMakeLists.txt
+++ b/mlir/lib/Dialect/Tosa/CMakeLists.txt
@@ -17,6 +17,7 @@ add_mlir_dialect_library(MLIRTosa
MLIRCallInterfaces
MLIRControlFlowInterfaces
MLIRQuant
+ MLIRQuantUtils
MLIRSideEffectInterfaces
MLIRTensor
MLIRViewLikeInterface
diff --git a/mlir/lib/Dialect/Tosa/Transforms/CMakeLists.txt b/mlir/lib/Dialect/Tosa/Transforms/CMakeLists.txt
index aa4d62f82b027..8b10f9da183d0 100644
--- a/mlir/lib/Dialect/Tosa/Transforms/CMakeLists.txt
+++ b/mlir/lib/Dialect/Tosa/Transforms/CMakeLists.txt
@@ -16,4 +16,5 @@ add_mlir_dialect_library(MLIRTosaTransforms
MLIRPass
MLIRTosa
MLIRStandard
+ MLIRTransformUtils
)
diff --git a/mlir/test/lib/Dialect/Tosa/CMakeLists.txt b/mlir/test/lib/Dialect/Tosa/CMakeLists.txt
index 8d8a074189574..c2f90df00d5d9 100644
--- a/mlir/test/lib/Dialect/Tosa/CMakeLists.txt
+++ b/mlir/test/lib/Dialect/Tosa/CMakeLists.txt
@@ -12,4 +12,5 @@ add_mlir_dialect_library(MLIRTosaTestPasses
LINK_LIBS PUBLIC
MLIRPass
MLIRTosa
+ MLIRTransformUtils
)
diff --git a/mlir/unittests/Dialect/Quant/CMakeLists.txt b/mlir/unittests/Dialect/Quant/CMakeLists.txt
index 6341ca326447c..756b31e8cb8db 100644
--- a/mlir/unittests/Dialect/Quant/CMakeLists.txt
+++ b/mlir/unittests/Dialect/Quant/CMakeLists.txt
@@ -3,4 +3,6 @@ add_mlir_unittest(MLIRQuantTests
)
target_link_libraries(MLIRQuantTests
PRIVATE
- MLIRQuant)
+ MLIRQuant
+ MLIRQuantUtils
+ )
More information about the Mlir-commits
mailing list