Skip to content

Commit d4e889f

Browse files
GMNGeoffreystellaraccident
authored andcommitted
Remove Ops suffix from dialect library names
Dialects include more than just ops, so this suffix is outdated. Follows discussion in https://llvm.discourse.group/t/rfc-canonical-file-paths-to-dialects/621 Reviewed By: stellaraccident Differential Revision: https://reviews.llvm.org/D88530
1 parent 3c45a06 commit d4e889f

File tree

36 files changed

+82
-91
lines changed

36 files changed

+82
-91
lines changed

flang/lib/Lower/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ add_flang_library(FortranLower
3030
MLIRAffineToStandard
3131
MLIRLLVMIR
3232
MLIRSCFToStandard
33-
MLIRStandardOps
33+
MLIRStandard
3434

3535
LINK_COMPONENTS
3636
Support

mlir/docs/Tutorials/CreatingADialect.md

Lines changed: 21 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ typically described in TableGen file using the [DDR
2626
format](DeclarativeRewrites.md).
2727

2828
Note that dialect names should not generally be suffixed with “Ops”,
29-
although some files pertaining to the operations of a dialect (e.g.
29+
although some files pertaining only to the operations of a dialect (e.g.
3030
FooOps.cpp) might be.
3131

3232
## CMake best practices
@@ -38,17 +38,16 @@ tablegen in a file FooOps.td. This file forms the core of a dialect and
3838
is declared using add_mlir_dialect().
3939

4040
```cmake
41-
4241
add_mlir_dialect(FooOps foo)
4342
add_mlir_doc(FooOps -gen-dialect-doc FooDialect Dialects/)
44-
4543
```
4644

4745
This generates the correct rules to run mlir-tblgen, along with a
4846
'MLIRFooOpsIncGen' target which can be used to declare dependencies.
4947

5048
Dialect transformations are typically declared in a file FooTransforms.td.
5149
Targets for TableGen are described in typical llvm fashion.
50+
5251
```cmake
5352
set(LLVM_TARGET_DEFINITIONS FooTransforms.td)
5453
mlir_tablegen(FooTransforms.h.inc -gen-rewriters)
@@ -67,20 +66,18 @@ other dialect libraries. Typically this dependence is declared using
6766
target_link_libraries() and the PUBLIC keyword. For instance:
6867

6968
```cmake
70-
71-
add_mlir_dialect_library(FooOps
72-
DEPENDS
73-
MLIRFooOpsIncGen
74-
MLIRFooTransformsIncGen
75-
76-
LINK_COMPONENTS
77-
Core
78-
79-
LINK_LIBS PUBLIC
80-
BarOps
81-
<some-other-library>
82-
)
83-
69+
add_mlir_dialect_library(MLIRFoo
70+
DEPENDS
71+
MLIRFooOpsIncGen
72+
MLIRFooTransformsIncGen
73+
74+
LINK_COMPONENTS
75+
Core
76+
77+
LINK_LIBS PUBLIC
78+
MLIRBar
79+
<some-other-library>
80+
)
8481
```
8582

8683
add_mlir_dialect_library() is a thin wrapper around add_llvm_library()
@@ -90,9 +87,7 @@ access to all dialects. This list is also linked into libMLIR.so.
9087
The list can be retrieved from the MLIR_DIALECT_LIBS global property:
9188

9289
```cmake
93-
9490
get_property(dialect_libs GLOBAL PROPERTY MLIR_DIALECT_LIBS)
95-
9691
```
9792

9893
Note that although the Bar dialect also uses TableGen to declare its
@@ -139,18 +134,16 @@ dialects (e.g. MLIRStandard). Typically this dependence is specified
139134
using target_link_libraries() and the PUBLIC keyword. For instance:
140135

141136
```cmake
142-
143137
add_mlir_conversion_library(MLIRBarToFoo
144-
BarToFoo.cpp
138+
BarToFoo.cpp
145139
146-
ADDITIONAL_HEADER_DIRS
147-
${MLIR_MAIN_INCLUDE_DIR}/mlir/Conversion/BarToFoo
148-
149-
LINK_LIBS PUBLIC
150-
BarOps
151-
FooOps
152-
)
140+
ADDITIONAL_HEADER_DIRS
141+
${MLIR_MAIN_INCLUDE_DIR}/mlir/Conversion/BarToFoo
153142
143+
LINK_LIBS PUBLIC
144+
MLIRBar
145+
MLIRFoo
146+
)
154147
```
155148

156149
add_mlir_conversion_library() is a thin wrapper around
@@ -161,9 +154,7 @@ is also linked in libMLIR.so. The list can be retrieved from the
161154
MLIR_CONVERSION_LIBS global property:
162155

163156
```cmake
164-
165157
get_property(dialect_libs GLOBAL PROPERTY MLIR_CONVERSION_LIBS)
166-
167158
```
168159

169160
Note that it is only necessary to specify a PUBLIC dependence against

mlir/lib/Analysis/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ add_mlir_library(MLIRAnalysis
2121
mlir-headers
2222

2323
LINK_LIBS PUBLIC
24-
MLIRAffineOps
24+
MLIRAffine
2525
MLIRCallInterfaces
2626
MLIRControlFlowInterfaces
2727
MLIRInferTypeOpInterface
@@ -43,7 +43,7 @@ add_mlir_library(MLIRLoopAnalysis
4343
mlir-headers
4444

4545
LINK_LIBS PUBLIC
46-
MLIRAffineOps
46+
MLIRAffine
4747
MLIRCallInterfaces
4848
MLIRControlFlowInterfaces
4949
MLIRInferTypeOpInterface

mlir/lib/CAPI/Standard/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ add_mlir_library(MLIRCAPIStandard
77

88
LINK_LIBS PUBLIC
99
MLIRCAPIIR
10-
MLIRStandardOps
10+
MLIRStandard
1111
)

mlir/lib/Conversion/AffineToStandard/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ add_mlir_conversion_library(MLIRAffineToStandard
1111
Core
1212

1313
LINK_LIBS PUBLIC
14-
MLIRAffineOps
14+
MLIRAffine
1515
MLIRSCF
1616
MLIRPass
17-
MLIRStandardOps
17+
MLIRStandard
1818
MLIRTransforms
1919
MLIRIR
2020
)

mlir/lib/Conversion/GPUToSPIRV/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ add_mlir_conversion_library(MLIRGPUToSPIRVTransforms
1616
MLIRPass
1717
MLIRSCFToSPIRV
1818
MLIRSPIRV
19-
MLIRStandardOps
19+
MLIRStandard
2020
MLIRStandardToSPIRVTransforms
2121
MLIRSupport
2222
MLIRTransforms

mlir/lib/Conversion/GPUToVulkan/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ add_mlir_conversion_library(MLIRGPUToVulkanTransforms
1212
MLIRPass
1313
MLIRSPIRV
1414
MLIRSPIRVSerialization
15-
MLIRStandardOps
15+
MLIRStandard
1616
MLIRSupport
1717
MLIRTransforms
1818
MLIRTranslation

mlir/lib/Conversion/LinalgToLLVM/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ add_mlir_conversion_library(MLIRLinalgToLLVM
1515
MLIRAffineToStandard
1616
MLIREDSC
1717
MLIRIR
18-
MLIRLinalgOps
18+
MLIRLinalg
1919
MLIRLLVMIR
2020
MLIRSCFToStandard
2121
MLIRStandardToLLVM

mlir/lib/Conversion/LinalgToSPIRV/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ add_mlir_conversion_library(MLIRLinalgToSPIRVTransforms
1111

1212
LINK_LIBS PUBLIC
1313
MLIRIR
14-
MLIRLinalgOps
14+
MLIRLinalg
1515
MLIRLinalgUtils
1616
MLIRPass
1717
MLIRSPIRV

mlir/lib/Conversion/LinalgToStandard/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ add_mlir_conversion_library(MLIRLinalgToStandard
1313
LINK_LIBS PUBLIC
1414
MLIREDSC
1515
MLIRIR
16-
MLIRLinalgOps
16+
MLIRLinalg
1717
MLIRPass
1818
MLIRSCF
1919
MLIRTransforms

0 commit comments

Comments
 (0)