Skip to content

Commit 14124c3

Browse files
committed
[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.
1 parent 32288d3 commit 14124c3

File tree

8 files changed

+58
-27
lines changed

8 files changed

+58
-27
lines changed

mlir/lib/Dialect/Quant/CMakeLists.txt

Lines changed: 3 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,3 @@
1-
add_mlir_dialect_library(MLIRQuant
2-
IR/QuantOps.cpp
3-
IR/QuantTypes.cpp
4-
IR/TypeDetail.h
5-
IR/TypeParser.cpp
6-
Transforms/ConvertConst.cpp
7-
Transforms/ConvertSimQuant.cpp
8-
Utils/QuantizeUtils.cpp
9-
Utils/UniformSupport.cpp
10-
Utils/FakeQuantSupport.cpp
11-
12-
ADDITIONAL_HEADER_DIRS
13-
${MLIR_MAIN_INCLUDE_DIR}/mlir/Dialect/QuantOps
14-
15-
DEPENDS
16-
MLIRQuantOpsIncGen
17-
MLIRQuantPassIncGen
18-
19-
LINK_LIBS PUBLIC
20-
MLIRArithmetic
21-
MLIRIR
22-
MLIRPass
23-
MLIRSideEffectInterfaces
24-
MLIRSupport
25-
MLIRTransformUtils
26-
)
1+
add_subdirectory(IR)
2+
add_subdirectory(Transforms)
3+
add_subdirectory(Utils)
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
add_mlir_dialect_library(MLIRQuant
2+
QuantOps.cpp
3+
QuantTypes.cpp
4+
TypeDetail.h
5+
TypeParser.cpp
6+
7+
ADDITIONAL_HEADER_DIRS
8+
${MLIR_MAIN_INCLUDE_DIR}/mlir/Dialect/QuantOps/IR
9+
10+
DEPENDS
11+
MLIRQuantOpsIncGen
12+
13+
LINK_LIBS PUBLIC
14+
MLIRIR
15+
MLIRSideEffectInterfaces
16+
MLIRSupport
17+
)
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
add_mlir_dialect_library(MLIRQuantTransforms
2+
ConvertConst.cpp
3+
ConvertSimQuant.cpp
4+
5+
ADDITIONAL_HEADER_DIRS
6+
${MLIR_MAIN_INCLUDE_DIR}/mlir/Dialect/QuantOps/Transforms
7+
8+
DEPENDS
9+
MLIRQuantPassIncGen
10+
11+
LINK_LIBS PUBLIC
12+
MLIRArithmetic
13+
MLIRIR
14+
MLIRQuant
15+
MLIRQuantUtils
16+
MLIRPass
17+
MLIRSupport
18+
MLIRTransformUtils
19+
)
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
add_mlir_dialect_library(MLIRQuantUtils
2+
QuantizeUtils.cpp
3+
UniformSupport.cpp
4+
FakeQuantSupport.cpp
5+
6+
ADDITIONAL_HEADER_DIRS
7+
${MLIR_MAIN_INCLUDE_DIR}/mlir/Dialect/QuantOps/Utils
8+
9+
LINK_LIBS PUBLIC
10+
MLIRIR
11+
MLIRQuant
12+
MLIRSupport
13+
)

mlir/lib/Dialect/Tosa/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ add_mlir_dialect_library(MLIRTosa
1717
MLIRCallInterfaces
1818
MLIRControlFlowInterfaces
1919
MLIRQuant
20+
MLIRQuantUtils
2021
MLIRSideEffectInterfaces
2122
MLIRTensor
2223
MLIRViewLikeInterface

mlir/lib/Dialect/Tosa/Transforms/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,5 @@ add_mlir_dialect_library(MLIRTosaTransforms
1616
MLIRPass
1717
MLIRTosa
1818
MLIRStandard
19+
MLIRTransformUtils
1920
)

mlir/test/lib/Dialect/Tosa/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,5 @@ add_mlir_dialect_library(MLIRTosaTestPasses
1212
LINK_LIBS PUBLIC
1313
MLIRPass
1414
MLIRTosa
15+
MLIRTransformUtils
1516
)

mlir/unittests/Dialect/Quant/CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,6 @@ add_mlir_unittest(MLIRQuantTests
33
)
44
target_link_libraries(MLIRQuantTests
55
PRIVATE
6-
MLIRQuant)
6+
MLIRQuant
7+
MLIRQuantUtils
8+
)

0 commit comments

Comments
 (0)