diff --git a/mlir/docs/Tutorials/CreatingADialect.md b/mlir/docs/Tutorials/CreatingADialect.md --- a/mlir/docs/Tutorials/CreatingADialect.md +++ b/mlir/docs/Tutorials/CreatingADialect.md @@ -26,7 +26,7 @@ format](DeclarativeRewrites.md). Note that dialect names should not generally be suffixed with “Ops”, -although some files pertaining to the operations of a dialect (e.g. +although some files pertaining only to the operations of a dialect (e.g. FooOps.cpp) might be. ## CMake best practices @@ -38,10 +38,8 @@ is declared using add_mlir_dialect(). ```cmake - add_mlir_dialect(FooOps foo) add_mlir_doc(FooOps -gen-dialect-doc FooDialect Dialects/) - ``` This generates the correct rules to run mlir-tblgen, along with a @@ -49,6 +47,7 @@ Dialect transformations are typically declared in a file FooTransforms.td. Targets for TableGen are described in typical llvm fashion. + ```cmake set(LLVM_TARGET_DEFINITIONS FooTransforms.td) mlir_tablegen(FooTransforms.h.inc -gen-rewriters) @@ -67,20 +66,18 @@ target_link_libraries() and the PUBLIC keyword. For instance: ```cmake - -add_mlir_dialect_library(FooOps - DEPENDS - MLIRFooOpsIncGen - MLIRFooTransformsIncGen - - LINK_COMPONENTS - Core - - LINK_LIBS PUBLIC - BarOps - - ) - +add_mlir_dialect_library(MLIRFoo + DEPENDS + MLIRFooOpsIncGen + MLIRFooTransformsIncGen + + LINK_COMPONENTS + Core + + LINK_LIBS PUBLIC + MLIRBar + + ) ``` add_mlir_dialect_library() is a thin wrapper around add_llvm_library() @@ -90,9 +87,7 @@ The list can be retrieved from the MLIR_DIALECT_LIBS global property: ```cmake - get_property(dialect_libs GLOBAL PROPERTY MLIR_DIALECT_LIBS) - ``` Note that although the Bar dialect also uses TableGen to declare its @@ -139,18 +134,16 @@ using target_link_libraries() and the PUBLIC keyword. For instance: ```cmake - add_mlir_conversion_library(MLIRBarToFoo - BarToFoo.cpp + BarToFoo.cpp - ADDITIONAL_HEADER_DIRS - ${MLIR_MAIN_INCLUDE_DIR}/mlir/Conversion/BarToFoo - - LINK_LIBS PUBLIC - BarOps - FooOps - ) + ADDITIONAL_HEADER_DIRS + ${MLIR_MAIN_INCLUDE_DIR}/mlir/Conversion/BarToFoo + LINK_LIBS PUBLIC + MLIRBar + MLIRFoo + ) ``` add_mlir_conversion_library() is a thin wrapper around @@ -161,9 +154,7 @@ MLIR_CONVERSION_LIBS global property: ```cmake - get_property(dialect_libs GLOBAL PROPERTY MLIR_CONVERSION_LIBS) - ``` Note that it is only necessary to specify a PUBLIC dependence against diff --git a/mlir/lib/Analysis/CMakeLists.txt b/mlir/lib/Analysis/CMakeLists.txt --- a/mlir/lib/Analysis/CMakeLists.txt +++ b/mlir/lib/Analysis/CMakeLists.txt @@ -21,7 +21,7 @@ mlir-headers LINK_LIBS PUBLIC - MLIRAffineOps + MLIRAffine MLIRCallInterfaces MLIRControlFlowInterfaces MLIRInferTypeOpInterface @@ -43,7 +43,7 @@ mlir-headers LINK_LIBS PUBLIC - MLIRAffineOps + MLIRAffine MLIRCallInterfaces MLIRControlFlowInterfaces MLIRInferTypeOpInterface diff --git a/mlir/lib/Conversion/AffineToStandard/CMakeLists.txt b/mlir/lib/Conversion/AffineToStandard/CMakeLists.txt --- a/mlir/lib/Conversion/AffineToStandard/CMakeLists.txt +++ b/mlir/lib/Conversion/AffineToStandard/CMakeLists.txt @@ -11,10 +11,10 @@ Core LINK_LIBS PUBLIC - MLIRAffineOps + MLIRAffine MLIRSCF MLIRPass - MLIRStandardOps + MLIRStandard MLIRTransforms MLIRIR ) diff --git a/mlir/lib/Conversion/GPUToSPIRV/CMakeLists.txt b/mlir/lib/Conversion/GPUToSPIRV/CMakeLists.txt --- a/mlir/lib/Conversion/GPUToSPIRV/CMakeLists.txt +++ b/mlir/lib/Conversion/GPUToSPIRV/CMakeLists.txt @@ -16,7 +16,7 @@ MLIRPass MLIRSCFToSPIRV MLIRSPIRV - MLIRStandardOps + MLIRStandard MLIRStandardToSPIRVTransforms MLIRSupport MLIRTransforms diff --git a/mlir/lib/Conversion/GPUToVulkan/CMakeLists.txt b/mlir/lib/Conversion/GPUToVulkan/CMakeLists.txt --- a/mlir/lib/Conversion/GPUToVulkan/CMakeLists.txt +++ b/mlir/lib/Conversion/GPUToVulkan/CMakeLists.txt @@ -12,7 +12,7 @@ MLIRPass MLIRSPIRV MLIRSPIRVSerialization - MLIRStandardOps + MLIRStandard MLIRSupport MLIRTransforms MLIRTranslation diff --git a/mlir/lib/Conversion/LinalgToLLVM/CMakeLists.txt b/mlir/lib/Conversion/LinalgToLLVM/CMakeLists.txt --- a/mlir/lib/Conversion/LinalgToLLVM/CMakeLists.txt +++ b/mlir/lib/Conversion/LinalgToLLVM/CMakeLists.txt @@ -15,7 +15,7 @@ MLIRAffineToStandard MLIREDSC MLIRIR - MLIRLinalgOps + MLIRLinalg MLIRLLVMIR MLIRSCFToStandard MLIRStandardToLLVM diff --git a/mlir/lib/Conversion/LinalgToSPIRV/CMakeLists.txt b/mlir/lib/Conversion/LinalgToSPIRV/CMakeLists.txt --- a/mlir/lib/Conversion/LinalgToSPIRV/CMakeLists.txt +++ b/mlir/lib/Conversion/LinalgToSPIRV/CMakeLists.txt @@ -11,7 +11,7 @@ LINK_LIBS PUBLIC MLIRIR - MLIRLinalgOps + MLIRLinalg MLIRLinalgUtils MLIRPass MLIRSPIRV diff --git a/mlir/lib/Conversion/LinalgToStandard/CMakeLists.txt b/mlir/lib/Conversion/LinalgToStandard/CMakeLists.txt --- a/mlir/lib/Conversion/LinalgToStandard/CMakeLists.txt +++ b/mlir/lib/Conversion/LinalgToStandard/CMakeLists.txt @@ -13,7 +13,7 @@ LINK_LIBS PUBLIC MLIREDSC MLIRIR - MLIRLinalgOps + MLIRLinalg MLIRPass MLIRSCF MLIRTransforms diff --git a/mlir/lib/Conversion/SCFToGPU/CMakeLists.txt b/mlir/lib/Conversion/SCFToGPU/CMakeLists.txt --- a/mlir/lib/Conversion/SCFToGPU/CMakeLists.txt +++ b/mlir/lib/Conversion/SCFToGPU/CMakeLists.txt @@ -9,13 +9,13 @@ MLIRConversionPassIncGen LINK_LIBS PUBLIC - MLIRAffineOps + MLIRAffine MLIRAffineToStandard MLIRGPU MLIRIR - MLIRLinalgOps + MLIRLinalg MLIRPass - MLIRStandardOps + MLIRStandard MLIRSupport MLIRTransforms ) diff --git a/mlir/lib/Conversion/SCFToSPIRV/CMakeLists.txt b/mlir/lib/Conversion/SCFToSPIRV/CMakeLists.txt --- a/mlir/lib/Conversion/SCFToSPIRV/CMakeLists.txt +++ b/mlir/lib/Conversion/SCFToSPIRV/CMakeLists.txt @@ -8,13 +8,13 @@ MLIRConversionPassIncGen LINK_LIBS PUBLIC - MLIRAffineOps + MLIRAffine MLIRAffineToStandard MLIRSPIRV MLIRIR - MLIRLinalgOps + MLIRLinalg MLIRPass - MLIRStandardOps + MLIRStandard MLIRSupport MLIRTransforms ) diff --git a/mlir/lib/Conversion/StandardToSPIRV/CMakeLists.txt b/mlir/lib/Conversion/StandardToSPIRV/CMakeLists.txt --- a/mlir/lib/Conversion/StandardToSPIRV/CMakeLists.txt +++ b/mlir/lib/Conversion/StandardToSPIRV/CMakeLists.txt @@ -17,5 +17,5 @@ MLIRSupport MLIRTransformUtils MLIRSPIRV - MLIRStandardOps + MLIRStandard ) diff --git a/mlir/lib/Dialect/Affine/EDSC/CMakeLists.txt b/mlir/lib/Dialect/Affine/EDSC/CMakeLists.txt --- a/mlir/lib/Dialect/Affine/EDSC/CMakeLists.txt +++ b/mlir/lib/Dialect/Affine/EDSC/CMakeLists.txt @@ -8,10 +8,10 @@ MLIRAffineOpsIncGen LINK_LIBS PUBLIC - MLIRAffineOps + MLIRAffine MLIREDSC MLIRIR MLIRLoopLikeInterface MLIRSideEffectInterfaces - MLIRStandardOps + MLIRStandard ) diff --git a/mlir/lib/Dialect/Affine/IR/CMakeLists.txt b/mlir/lib/Dialect/Affine/IR/CMakeLists.txt --- a/mlir/lib/Dialect/Affine/IR/CMakeLists.txt +++ b/mlir/lib/Dialect/Affine/IR/CMakeLists.txt @@ -1,4 +1,4 @@ -add_mlir_dialect_library(MLIRAffineOps +add_mlir_dialect_library(MLIRAffine AffineMemoryOpInterfaces.cpp AffineOps.cpp AffineValueMap.cpp @@ -15,5 +15,5 @@ MLIRIR MLIRLoopLikeInterface MLIRSideEffectInterfaces - MLIRStandardOps + MLIRStandard ) diff --git a/mlir/lib/Dialect/Affine/Transforms/CMakeLists.txt b/mlir/lib/Dialect/Affine/Transforms/CMakeLists.txt --- a/mlir/lib/Dialect/Affine/Transforms/CMakeLists.txt +++ b/mlir/lib/Dialect/Affine/Transforms/CMakeLists.txt @@ -18,13 +18,13 @@ MLIRLoopLikeInterfaceIncGen LINK_LIBS PUBLIC - MLIRAffineOps + MLIRAffine MLIRAffineUtils MLIREDSC MLIRIR MLIRPass MLIRSideEffectInterfaces - MLIRStandardOps + MLIRStandard MLIRTransformUtils MLIRVector MLIRVectorToLLVM diff --git a/mlir/lib/Dialect/Affine/Utils/CMakeLists.txt b/mlir/lib/Dialect/Affine/Utils/CMakeLists.txt --- a/mlir/lib/Dialect/Affine/Utils/CMakeLists.txt +++ b/mlir/lib/Dialect/Affine/Utils/CMakeLists.txt @@ -5,6 +5,6 @@ ${MLIR_MAIN_INCLUDE_DIR}/mlir/Dialect/Affine LINK_LIBS PUBLIC - MLIRAffineOps + MLIRAffine MLIRTransformUtils ) diff --git a/mlir/lib/Dialect/GPU/CMakeLists.txt b/mlir/lib/Dialect/GPU/CMakeLists.txt --- a/mlir/lib/Dialect/GPU/CMakeLists.txt +++ b/mlir/lib/Dialect/GPU/CMakeLists.txt @@ -21,7 +21,7 @@ MLIRSCF MLIRPass MLIRSideEffectInterfaces - MLIRStandardOps + MLIRStandard MLIRSupport MLIRTransformUtils ) diff --git a/mlir/lib/Dialect/Linalg/Analysis/CMakeLists.txt b/mlir/lib/Dialect/Linalg/Analysis/CMakeLists.txt --- a/mlir/lib/Dialect/Linalg/Analysis/CMakeLists.txt +++ b/mlir/lib/Dialect/Linalg/Analysis/CMakeLists.txt @@ -1,11 +1,11 @@ add_mlir_dialect_library(MLIRLinalgAnalysis DependenceAnalysis.cpp - + ADDITIONAL_HEADER_DIRS ${MLIR_MAIN_INCLUDE_DIR}/mlir/Dialect/Linalg LINK_LIBS PUBLIC MLIRIR - MLIRLinalgOps - MLIRStandardOps + MLIRLinalg + MLIRStandard ) diff --git a/mlir/lib/Dialect/Linalg/EDSC/CMakeLists.txt b/mlir/lib/Dialect/Linalg/EDSC/CMakeLists.txt --- a/mlir/lib/Dialect/Linalg/EDSC/CMakeLists.txt +++ b/mlir/lib/Dialect/Linalg/EDSC/CMakeLists.txt @@ -7,9 +7,9 @@ LINK_LIBS PUBLIC MLIREDSC MLIRIR - MLIRAffineOps + MLIRAffine MLIRAffineEDSC - MLIRLinalgOps + MLIRLinalg MLIRSCF - MLIRStandardOps + MLIRStandard ) diff --git a/mlir/lib/Dialect/Linalg/IR/CMakeLists.txt b/mlir/lib/Dialect/Linalg/IR/CMakeLists.txt --- a/mlir/lib/Dialect/Linalg/IR/CMakeLists.txt +++ b/mlir/lib/Dialect/Linalg/IR/CMakeLists.txt @@ -1,4 +1,4 @@ -add_mlir_dialect_library(MLIRLinalgOps +add_mlir_dialect_library(MLIRLinalg LinalgOps.cpp LinalgTypes.cpp @@ -14,5 +14,5 @@ MLIRIR MLIRSideEffectInterfaces MLIRViewLikeInterface - MLIRStandardOps + MLIRStandard ) diff --git a/mlir/lib/Dialect/Linalg/Transforms/CMakeLists.txt b/mlir/lib/Dialect/Linalg/Transforms/CMakeLists.txt --- a/mlir/lib/Dialect/Linalg/Transforms/CMakeLists.txt +++ b/mlir/lib/Dialect/Linalg/Transforms/CMakeLists.txt @@ -17,18 +17,18 @@ MLIRLinalgPassIncGen LINK_LIBS PUBLIC - MLIRAffineOps + MLIRAffine MLIRAnalysis MLIREDSC MLIRIR MLIRLinalgAnalysis MLIRLinalgEDSC - MLIRLinalgOps + MLIRLinalg MLIRLinalgUtils MLIRSCF MLIRSCFTransforms MLIRPass - MLIRStandardOps + MLIRStandard MLIRStandardToLLVM MLIRTransformUtils MLIRVector diff --git a/mlir/lib/Dialect/Linalg/Utils/CMakeLists.txt b/mlir/lib/Dialect/Linalg/Utils/CMakeLists.txt --- a/mlir/lib/Dialect/Linalg/Utils/CMakeLists.txt +++ b/mlir/lib/Dialect/Linalg/Utils/CMakeLists.txt @@ -5,13 +5,13 @@ ${MLIR_MAIN_INCLUDE_DIR}/mlir/Dialect/Linalg LINK_LIBS PUBLIC - MLIRAffineOps + MLIRAffine MLIREDSC MLIRIR MLIRLinalgEDSC - MLIRLinalgOps + MLIRLinalg MLIRSCF MLIRPass - MLIRStandardOps + MLIRStandard MLIRTransformUtils ) diff --git a/mlir/lib/Dialect/Quant/CMakeLists.txt b/mlir/lib/Dialect/Quant/CMakeLists.txt --- a/mlir/lib/Dialect/Quant/CMakeLists.txt +++ b/mlir/lib/Dialect/Quant/CMakeLists.txt @@ -21,6 +21,6 @@ MLIRPass MLIRSideEffectInterfaces MLIRSupport - MLIRStandardOps + MLIRStandard MLIRTransformUtils ) diff --git a/mlir/lib/Dialect/SCF/CMakeLists.txt b/mlir/lib/Dialect/SCF/CMakeLists.txt --- a/mlir/lib/Dialect/SCF/CMakeLists.txt +++ b/mlir/lib/Dialect/SCF/CMakeLists.txt @@ -13,7 +13,7 @@ MLIRIR MLIRLoopLikeInterface MLIRSideEffectInterfaces - MLIRStandardOps + MLIRStandard ) add_subdirectory(Transforms) diff --git a/mlir/lib/Dialect/SCF/Transforms/CMakeLists.txt b/mlir/lib/Dialect/SCF/Transforms/CMakeLists.txt --- a/mlir/lib/Dialect/SCF/Transforms/CMakeLists.txt +++ b/mlir/lib/Dialect/SCF/Transforms/CMakeLists.txt @@ -11,11 +11,11 @@ MLIRSCFPassIncGen LINK_LIBS PUBLIC - MLIRAffineOps + MLIRAffine MLIRIR MLIRPass MLIRSCF - MLIRStandardOps + MLIRStandard MLIRSupport MLIRTransformUtils ) diff --git a/mlir/lib/Dialect/Shape/IR/CMakeLists.txt b/mlir/lib/Dialect/Shape/IR/CMakeLists.txt --- a/mlir/lib/Dialect/Shape/IR/CMakeLists.txt +++ b/mlir/lib/Dialect/Shape/IR/CMakeLists.txt @@ -17,5 +17,5 @@ MLIRInferTypeOpInterface MLIRIR MLIRSideEffectInterfaces - MLIRStandardOps + MLIRStandard ) diff --git a/mlir/lib/Dialect/StandardOps/CMakeLists.txt b/mlir/lib/Dialect/StandardOps/CMakeLists.txt --- a/mlir/lib/Dialect/StandardOps/CMakeLists.txt +++ b/mlir/lib/Dialect/StandardOps/CMakeLists.txt @@ -1,4 +1,4 @@ -add_mlir_dialect_library(MLIRStandardOps +add_mlir_dialect_library(MLIRStandard IR/Ops.cpp EDSC/Builders.cpp EDSC/Intrinsics.cpp diff --git a/mlir/lib/Dialect/StandardOps/Transforms/CMakeLists.txt b/mlir/lib/Dialect/StandardOps/Transforms/CMakeLists.txt --- a/mlir/lib/Dialect/StandardOps/Transforms/CMakeLists.txt +++ b/mlir/lib/Dialect/StandardOps/Transforms/CMakeLists.txt @@ -12,6 +12,6 @@ LINK_LIBS PUBLIC MLIRIR MLIRPass - MLIRStandardOps + MLIRStandard MLIRTransforms ) diff --git a/mlir/lib/Dialect/Vector/CMakeLists.txt b/mlir/lib/Dialect/Vector/CMakeLists.txt --- a/mlir/lib/Dialect/Vector/CMakeLists.txt +++ b/mlir/lib/Dialect/Vector/CMakeLists.txt @@ -14,9 +14,9 @@ MLIRAffineEDSC MLIREDSC MLIRIR - MLIRStandardOps - MLIRAffineOps - MLIRLinalgOps + MLIRStandard + MLIRAffine + MLIRLinalg MLIRSCF MLIRLoopAnalysis MLIRSideEffectInterfaces diff --git a/mlir/lib/ExecutionEngine/CMakeLists.txt b/mlir/lib/ExecutionEngine/CMakeLists.txt --- a/mlir/lib/ExecutionEngine/CMakeLists.txt +++ b/mlir/lib/ExecutionEngine/CMakeLists.txt @@ -60,7 +60,7 @@ MLIRExecutionEngine MLIRIR MLIRParser - MLIRStandardOps + MLIRStandard MLIRTargetLLVMIR MLIRTransforms MLIRStandardToLLVM diff --git a/mlir/lib/Transforms/CMakeLists.txt b/mlir/lib/Transforms/CMakeLists.txt --- a/mlir/lib/Transforms/CMakeLists.txt +++ b/mlir/lib/Transforms/CMakeLists.txt @@ -30,10 +30,10 @@ MLIRTransformsPassIncGen LINK_LIBS PUBLIC - MLIRAffineOps + MLIRAffine MLIRAnalysis MLIRCopyOpInterface - MLIRLinalgOps + MLIRLinalg MLIRLoopLikeInterface MLIRSCF MLIRPass diff --git a/mlir/lib/Transforms/Utils/CMakeLists.txt b/mlir/lib/Transforms/Utils/CMakeLists.txt --- a/mlir/lib/Transforms/Utils/CMakeLists.txt +++ b/mlir/lib/Transforms/Utils/CMakeLists.txt @@ -14,10 +14,10 @@ MLIRStandardOpsIncGen LINK_LIBS PUBLIC - MLIRAffineOps + MLIRAffine MLIRAnalysis MLIRLoopAnalysis MLIRSCF MLIRPass - MLIRStandardOps + MLIRStandard ) diff --git a/mlir/test/EDSC/CMakeLists.txt b/mlir/test/EDSC/CMakeLists.txt --- a/mlir/test/EDSC/CMakeLists.txt +++ b/mlir/test/EDSC/CMakeLists.txt @@ -10,14 +10,14 @@ target_link_libraries(mlir-edsc-builder-api-test PRIVATE - MLIRAffineOps + MLIRAffine MLIRAffineEDSC MLIREDSC MLIRIR + MLIRLinalg MLIRLinalgEDSC - MLIRLinalgOps MLIRSCF - MLIRStandardOps + MLIRStandard MLIRTransforms MLIRVector ) diff --git a/mlir/test/lib/Dialect/Test/CMakeLists.txt b/mlir/test/lib/Dialect/Test/CMakeLists.txt --- a/mlir/test/lib/Dialect/Test/CMakeLists.txt +++ b/mlir/test/lib/Dialect/Test/CMakeLists.txt @@ -38,7 +38,7 @@ MLIRInferTypeOpInterface MLIRLinalgTransforms MLIRPass - MLIRStandardOps + MLIRStandard MLIRStandardOpsTransforms MLIRTransformUtils MLIRTransforms diff --git a/mlir/test/lib/Transforms/CMakeLists.txt b/mlir/test/lib/Transforms/CMakeLists.txt --- a/mlir/test/lib/Transforms/CMakeLists.txt +++ b/mlir/test/lib/Transforms/CMakeLists.txt @@ -38,12 +38,12 @@ MLIRStandardOpsIncGen LINK_LIBS PUBLIC - MLIRAffineOps + MLIRAffine MLIRAnalysis MLIREDSC MLIRGPU MLIRGPUToGPURuntimeTransforms - MLIRLinalgOps + MLIRLinalg MLIRLinalgTransforms MLIRNVVMIR MLIRSCF