diff --git a/llvm/cmake/modules/AddLLVM.cmake b/llvm/cmake/modules/AddLLVM.cmake --- a/llvm/cmake/modules/AddLLVM.cmake +++ b/llvm/cmake/modules/AddLLVM.cmake @@ -692,12 +692,14 @@ macro(add_llvm_library name) cmake_parse_arguments(ARG - "SHARED;BUILDTREE_ONLY;MODULE;INSTALL_WITH_TOOLCHAIN" + "SHARED;STATIC;BUILDTREE_ONLY;MODULE;INSTALL_WITH_TOOLCHAIN" "" "" ${ARGN}) if(ARG_MODULE) llvm_add_library(${name} MODULE ${ARG_UNPARSED_ARGUMENTS}) + elseif(ARG_STATIC) + llvm_add_library(${name} STATIC ${ARG_UNPARSED_ARGUMENTS}) elseif( BUILD_SHARED_LIBS OR ARG_SHARED ) llvm_add_library(${name} SHARED ${ARG_UNPARSED_ARGUMENTS}) else() diff --git a/llvm/examples/LLJITExamples/LLJITDumpObjects/CMakeLists.txt b/llvm/examples/LLJITExamples/LLJITDumpObjects/CMakeLists.txt --- a/llvm/examples/LLJITExamples/LLJITDumpObjects/CMakeLists.txt +++ b/llvm/examples/LLJITExamples/LLJITDumpObjects/CMakeLists.txt @@ -2,6 +2,7 @@ Core ExecutionEngine IRReader + JITLink OrcJIT Support nativecodegen diff --git a/mlir/include/mlir/IR/OpDefinition.h b/mlir/include/mlir/IR/OpDefinition.h --- a/mlir/include/mlir/IR/OpDefinition.h +++ b/mlir/include/mlir/IR/OpDefinition.h @@ -21,6 +21,7 @@ #include "mlir/IR/Operation.h" #include +#include "llvm/Support/Debug.h" namespace mlir { class Builder; @@ -979,8 +980,9 @@ /// Return true if this "op class" can match against the specified operation. static bool classof(Operation *op) { - if (auto *abstractOp = op->getAbstractOperation()) - return &classof == abstractOp->classof; + if (auto *abstractOp = op->getAbstractOperation()) { + if(&classof == abstractOp->classof) return true; + } return op->getName().getStringRef() == ConcreteType::getOperationName(); } 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 @@ -1,4 +1,4 @@ -add_llvm_library(MLIRAnalysis STATIC +add_llvm_component_library(MLIRAnalysis STATIC AffineAnalysis.cpp AffineStructures.cpp CallGraph.cpp 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 @@ -1,4 +1,4 @@ -add_llvm_library(MLIRAffineToStandard +add_llvm_component_library(MLIRAffineToStandard AffineToStandard.cpp ADDITIONAL_HEADER_DIRS @@ -17,7 +17,10 @@ MLIRAffineToStandard MLIRAffineOps + MLIRLoopOps + MLIRPass MLIRStandardOps + MLIRTransforms MLIRIR LLVMCore LLVMSupport diff --git a/mlir/lib/Conversion/GPUToCUDA/CMakeLists.txt b/mlir/lib/Conversion/GPUToCUDA/CMakeLists.txt --- a/mlir/lib/Conversion/GPUToCUDA/CMakeLists.txt +++ b/mlir/lib/Conversion/GPUToCUDA/CMakeLists.txt @@ -1,7 +1,7 @@ if(MLIR_CUDA_CONVERSIONS_ENABLED) llvm_map_components_to_libnames(nvptx "NVPTX") - add_llvm_library(MLIRGPUtoCUDATransforms + add_llvm_component_library(MLIRGPUtoCUDATransforms ConvertKernelFuncToCubin.cpp ConvertLaunchFuncToCudaCalls.cpp ) diff --git a/mlir/lib/Conversion/GPUToNVVM/CMakeLists.txt b/mlir/lib/Conversion/GPUToNVVM/CMakeLists.txt --- a/mlir/lib/Conversion/GPUToNVVM/CMakeLists.txt +++ b/mlir/lib/Conversion/GPUToNVVM/CMakeLists.txt @@ -2,7 +2,7 @@ mlir_tablegen(GPUToNVVM.cpp.inc -gen-rewriters) add_public_tablegen_target(MLIRGPUToNVVMIncGen) -add_llvm_library(MLIRGPUtoNVVMTransforms +add_llvm_component_library(MLIRGPUtoNVVMTransforms LowerGpuOpsToNVVMOps.cpp ) @@ -15,4 +15,6 @@ MLIRLLVMIR MLIRNVVMIR MLIRPass + MLIRStandardToLLVM + MLIRTransformUtils ) diff --git a/mlir/lib/Conversion/GPUToROCDL/CMakeLists.txt b/mlir/lib/Conversion/GPUToROCDL/CMakeLists.txt --- a/mlir/lib/Conversion/GPUToROCDL/CMakeLists.txt +++ b/mlir/lib/Conversion/GPUToROCDL/CMakeLists.txt @@ -1,4 +1,4 @@ -add_llvm_library(MLIRGPUtoROCDLTransforms +add_llvm_component_library(MLIRGPUtoROCDLTransforms LowerGpuOpsToROCDLOps.cpp ) target_link_libraries(MLIRGPUtoROCDLTransforms @@ -7,4 +7,5 @@ MLIRLLVMIR MLIRROCDLIR MLIRPass + MLIRStandardToLLVM ) 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 @@ -1,4 +1,4 @@ -add_llvm_library(MLIRGPUtoSPIRVTransforms +add_llvm_component_library(MLIRGPUtoSPIRVTransforms ConvertGPUToSPIRV.cpp ConvertGPUToSPIRVPass.cpp ) 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 @@ -1,12 +1,17 @@ -add_llvm_library(MLIRLinalgToLLVM +add_llvm_component_library(MLIRLinalgToLLVM LinalgToLLVM.cpp ADDITIONAL_HEADER_DIRS ${MLIR_MAIN_INCLUDE_DIR}/mlir/Conversion/LinalgToLLVM ) set(LIBS + MLIRAffineToStandard + MLIREDSC + MLIRIR MLIRLinalg MLIRLLVMIR + MLIRStandardToLLVM + MLIRVectorToLLVM MLIRTransforms LLVMCore LLVMSupport diff --git a/mlir/lib/Conversion/LoopToStandard/CMakeLists.txt b/mlir/lib/Conversion/LoopToStandard/CMakeLists.txt --- a/mlir/lib/Conversion/LoopToStandard/CMakeLists.txt +++ b/mlir/lib/Conversion/LoopToStandard/CMakeLists.txt @@ -1,4 +1,4 @@ -add_llvm_library(MLIRLoopToStandard +add_llvm_component_library(MLIRLoopToStandard ConvertLoopToStandard.cpp ADDITIONAL_HEADER_DIRS diff --git a/mlir/lib/Conversion/LoopsToGPU/CMakeLists.txt b/mlir/lib/Conversion/LoopsToGPU/CMakeLists.txt --- a/mlir/lib/Conversion/LoopsToGPU/CMakeLists.txt +++ b/mlir/lib/Conversion/LoopsToGPU/CMakeLists.txt @@ -1,5 +1,6 @@ set(LIBS MLIRAffineOps + MLIRAffineToStandard MLIRGPU MLIRIR MLIRLinalg @@ -10,7 +11,7 @@ LLVMSupport ) -add_llvm_library(MLIRLoopsToGPU +add_llvm_component_library(MLIRLoopsToGPU LoopsToGPU.cpp LoopsToGPUPass.cpp diff --git a/mlir/lib/Conversion/StandardToLLVM/CMakeLists.txt b/mlir/lib/Conversion/StandardToLLVM/CMakeLists.txt --- a/mlir/lib/Conversion/StandardToLLVM/CMakeLists.txt +++ b/mlir/lib/Conversion/StandardToLLVM/CMakeLists.txt @@ -1,4 +1,4 @@ -add_llvm_library(MLIRStandardToLLVM +add_llvm_component_library(MLIRStandardToLLVM ConvertStandardToLLVM.cpp ADDITIONAL_HEADER_DIRS 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 @@ -2,7 +2,7 @@ mlir_tablegen(StandardToSPIRV.cpp.inc -gen-rewriters) add_public_tablegen_target(MLIRStandardToSPIRVIncGen) -add_llvm_library(MLIRStandardToSPIRVTransforms +add_llvm_component_library(MLIRStandardToSPIRVTransforms ConvertStandardToSPIRV.cpp ConvertStandardToSPIRVPass.cpp LegalizeStandardForSPIRV.cpp diff --git a/mlir/lib/Conversion/VectorToLLVM/CMakeLists.txt b/mlir/lib/Conversion/VectorToLLVM/CMakeLists.txt --- a/mlir/lib/Conversion/VectorToLLVM/CMakeLists.txt +++ b/mlir/lib/Conversion/VectorToLLVM/CMakeLists.txt @@ -1,4 +1,4 @@ -add_llvm_library(MLIRVectorToLLVM +add_llvm_component_library(MLIRVectorToLLVM ConvertVectorToLLVM.cpp ADDITIONAL_HEADER_DIRS @@ -6,6 +6,7 @@ ) set(LIBS MLIRLLVMIR + MLIRStandardToLLVM MLIRTransforms LLVMCore LLVMSupport diff --git a/mlir/lib/Conversion/VectorToLoops/CMakeLists.txt b/mlir/lib/Conversion/VectorToLoops/CMakeLists.txt --- a/mlir/lib/Conversion/VectorToLoops/CMakeLists.txt +++ b/mlir/lib/Conversion/VectorToLoops/CMakeLists.txt @@ -1,10 +1,11 @@ -add_llvm_library(MLIRVectorToLoops +add_llvm_component_library(MLIRVectorToLoops ConvertVectorToLoops.cpp ADDITIONAL_HEADER_DIRS ${MLIR_MAIN_INCLUDE_DIR}/mlir/Conversion/VectorToLoops ) set(LIBS + MLIREDSC MLIRLLVMIR MLIRTransforms LLVMCore diff --git a/mlir/lib/Dialect/AffineOps/CMakeLists.txt b/mlir/lib/Dialect/AffineOps/CMakeLists.txt --- a/mlir/lib/Dialect/AffineOps/CMakeLists.txt +++ b/mlir/lib/Dialect/AffineOps/CMakeLists.txt @@ -1,4 +1,4 @@ -add_llvm_library(MLIRAffineOps +add_llvm_component_library(MLIRAffineOps AffineOps.cpp DialectRegistration.cpp diff --git a/mlir/lib/Dialect/CMakeLists.txt b/mlir/lib/Dialect/CMakeLists.txt --- a/mlir/lib/Dialect/CMakeLists.txt +++ b/mlir/lib/Dialect/CMakeLists.txt @@ -10,7 +10,7 @@ add_subdirectory(StandardOps) add_subdirectory(VectorOps) -add_llvm_library(MLIRDialect +add_llvm_component_library(MLIRDialect Traits.cpp ADDITIONAL_HEADER_DIRS diff --git a/mlir/lib/Dialect/FxpMathOps/CMakeLists.txt b/mlir/lib/Dialect/FxpMathOps/CMakeLists.txt --- a/mlir/lib/Dialect/FxpMathOps/CMakeLists.txt +++ b/mlir/lib/Dialect/FxpMathOps/CMakeLists.txt @@ -1,15 +1,17 @@ -add_llvm_library(MLIRFxpMathOps +add_llvm_component_library(MLIRFxpMathOps IR/FxpMathOps.cpp IR/DialectRegistration.cpp Transforms/LowerUniformRealMath.cpp ADDITIONAL_HEADER_DIRS ${MLIR_MAIN_INCLUDE_DIR}/mlir/Dialect/FxpMathOps + + LINK_LIBS + MLIRQuantOps + MLIRIR + MLIRPass + MLIRSupport + MLIRStandardOps ) add_dependencies(MLIRFxpMathOps - MLIRFxpMathOpsIncGen - MLIRQuantOps - MLIRIR - MLIRPass - MLIRSupport - MLIRStandardOps) + MLIRFxpMathOpsIncGen) 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 @@ -1,4 +1,4 @@ -add_llvm_library(MLIRGPU +add_llvm_component_library(MLIRGPU IR/GPUDialect.cpp IR/DialectRegistration.cpp Transforms/KernelOutlining.cpp @@ -9,18 +9,14 @@ ) add_dependencies(MLIRGPU MLIRGPUOpsIncGen - MLIREDSC - MLIRIR - MLIRLLVMIR - MLIRLoopOps - MLIRSupport - MLIRTransformUtils - LLVMSupport) + ) target_link_libraries(MLIRGPU MLIREDSC MLIRIR MLIRLLVMIR MLIRLoopOps + MLIRPass + MLIRStandardOps MLIRSupport MLIRTransformUtils LLVMSupport) diff --git a/mlir/lib/Dialect/LLVMIR/CMakeLists.txt b/mlir/lib/Dialect/LLVMIR/CMakeLists.txt --- a/mlir/lib/Dialect/LLVMIR/CMakeLists.txt +++ b/mlir/lib/Dialect/LLVMIR/CMakeLists.txt @@ -1,4 +1,4 @@ -add_llvm_library(MLIRLLVMIR +add_llvm_component_library(MLIRLLVMIR IR/LLVMDialect.cpp ADDITIONAL_HEADER_DIRS @@ -7,16 +7,16 @@ add_dependencies(MLIRLLVMIR MLIRLLVMOpsIncGen MLIRLLVMConversionsIncGen LLVMAsmParser LLVMCore LLVMSupport) target_link_libraries(MLIRLLVMIR LLVMAsmParser LLVMCore LLVMSupport MLIRIR) -add_llvm_library(MLIRNVVMIR +add_llvm_component_library(MLIRNVVMIR IR/NVVMDialect.cpp ADDITIONAL_HEADER_DIRS ${MLIR_MAIN_INCLUDE_DIR}/mlir/Dialect/LLVMIR ) add_dependencies(MLIRNVVMIR MLIRNVVMOpsIncGen MLIRNVVMConversionsIncGen LLVMAsmParser LLVMCore LLVMSupport) -target_link_libraries(MLIRNVVMIR LLVMAsmParser LLVMCore LLVMSupport MLIRIR) +target_link_libraries(MLIRNVVMIR LLVMAsmParser MLIRIR MLIRLLVMIR LLVMSupport LLVMCore) -add_llvm_library(MLIRROCDLIR +add_llvm_component_library(MLIRROCDLIR IR/ROCDLDialect.cpp ADDITIONAL_HEADER_DIRS diff --git a/mlir/lib/Dialect/Linalg/CMakeLists.txt b/mlir/lib/Dialect/Linalg/CMakeLists.txt --- a/mlir/lib/Dialect/Linalg/CMakeLists.txt +++ b/mlir/lib/Dialect/Linalg/CMakeLists.txt @@ -1,4 +1,4 @@ -add_llvm_library(MLIRLinalg +add_llvm_component_library(MLIRLinalg LinalgRegistration.cpp Analysis/DependenceAnalysis.cpp EDSC/Builders.cpp @@ -15,17 +15,19 @@ ${MLIR_MAIN_INCLUDE_DIR}/mlir/Dialect/Linalg DEPENDS intrinsics_gen - ) - -add_dependencies(MLIRLinalg + LINK_LIBS MLIRAffineOps MLIRAnalysis MLIREDSC - MLIRLinalgOpsIncGen - MLIRLinalgStructuredOpsIncGen - MLIRLinalgTransformPatternsIncGen MLIRStandardOps MLIRStandardToLLVM MLIRVectorOps ) + +add_dependencies(MLIRLinalg + + MLIRLinalgOpsIncGen + MLIRLinalgStructuredOpsIncGen + MLIRLinalgTransformPatternsIncGen + ) diff --git a/mlir/lib/Dialect/LoopOps/CMakeLists.txt b/mlir/lib/Dialect/LoopOps/CMakeLists.txt --- a/mlir/lib/Dialect/LoopOps/CMakeLists.txt +++ b/mlir/lib/Dialect/LoopOps/CMakeLists.txt @@ -1,9 +1,9 @@ file(GLOB globbed *.c *.cpp) -add_llvm_library(MLIRLoopOps +add_llvm_component_library(MLIRLoopOps ${globbed} ADDITIONAL_HEADER_DIRS ${MLIR_MAIN_INCLUDE_DIR}/mlir/LoopOps ) -add_dependencies(MLIRLoopOps MLIRLoopLikeInterfaceIncGen MLIRLoopOpsIncGen MLIRStandardOps LLVMSupport) -target_link_libraries(MLIRLoopOps LLVMSupport) +add_dependencies(MLIRLoopOps MLIRLoopLikeInterfaceIncGen MLIRLoopOpsIncGen) +target_link_libraries(MLIRLoopOps MLIRStandardOps LLVMSupport MLIRIR) diff --git a/mlir/lib/Dialect/QuantOps/CMakeLists.txt b/mlir/lib/Dialect/QuantOps/CMakeLists.txt --- a/mlir/lib/Dialect/QuantOps/CMakeLists.txt +++ b/mlir/lib/Dialect/QuantOps/CMakeLists.txt @@ -1,4 +1,4 @@ -add_llvm_library(MLIRQuantOps +add_llvm_component_library(MLIRQuantOps IR/DialectRegistration.cpp IR/QuantOps.cpp IR/QuantTypes.cpp @@ -13,9 +13,14 @@ ADDITIONAL_HEADER_DIRS ${MLIR_MAIN_INCLUDE_DIR}/mlir/Dialect/QuantOps ) -add_dependencies(MLIRQuantOps - MLIRIR - MLIRPass - MLIRQuantOpsIncGen - MLIRSupport - MLIRStandardOps) +add_dependencies( + MLIRQuantOps + MLIRQuantOpsIncGen + ) +target_link_libraries(MLIRQuantOps + MLIRIR + MLIRPass + MLIRSupport + MLIRStandardOps + MLIRTransformUtils + ) diff --git a/mlir/lib/Dialect/SDBM/CMakeLists.txt b/mlir/lib/Dialect/SDBM/CMakeLists.txt --- a/mlir/lib/Dialect/SDBM/CMakeLists.txt +++ b/mlir/lib/Dialect/SDBM/CMakeLists.txt @@ -1,4 +1,4 @@ -add_llvm_library(MLIRSDBM +add_llvm_component_library(MLIRSDBM SDBM.cpp SDBMExpr.cpp SDBMDialect.cpp diff --git a/mlir/lib/Dialect/SPIRV/CMakeLists.txt b/mlir/lib/Dialect/SPIRV/CMakeLists.txt --- a/mlir/lib/Dialect/SPIRV/CMakeLists.txt +++ b/mlir/lib/Dialect/SPIRV/CMakeLists.txt @@ -2,7 +2,7 @@ mlir_tablegen(SPIRVCanonicalization.inc -gen-rewriters) add_public_tablegen_target(MLIRSPIRVCanonicalizationIncGen) -add_llvm_library(MLIRSPIRV +add_llvm_component_library(MLIRSPIRV DialectRegistration.cpp LayoutUtils.cpp SPIRVDialect.cpp diff --git a/mlir/lib/Dialect/SPIRV/Serialization/CMakeLists.txt b/mlir/lib/Dialect/SPIRV/Serialization/CMakeLists.txt --- a/mlir/lib/Dialect/SPIRV/Serialization/CMakeLists.txt +++ b/mlir/lib/Dialect/SPIRV/Serialization/CMakeLists.txt @@ -1,4 +1,4 @@ -add_llvm_library(MLIRSPIRVSerialization +add_llvm_component_library(MLIRSPIRVSerialization Deserializer.cpp Serializer.cpp SPIRVBinaryUtils.cpp @@ -14,4 +14,5 @@ target_link_libraries(MLIRSPIRVSerialization MLIRIR MLIRSPIRV - MLIRSupport) + MLIRSupport + MLIRTranslation) diff --git a/mlir/lib/Dialect/SPIRV/Transforms/CMakeLists.txt b/mlir/lib/Dialect/SPIRV/Transforms/CMakeLists.txt --- a/mlir/lib/Dialect/SPIRV/Transforms/CMakeLists.txt +++ b/mlir/lib/Dialect/SPIRV/Transforms/CMakeLists.txt @@ -1,4 +1,4 @@ -add_llvm_library(MLIRSPIRVTransforms +add_llvm_component_library(MLIRSPIRVTransforms DecorateSPIRVCompositeTypeLayoutPass.cpp LowerABIAttributesPass.cpp 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,5 +1,5 @@ file(GLOB globbed *.c *.cpp) -add_llvm_library(MLIRStandardOps +add_llvm_component_library(MLIRStandardOps ${globbed} ADDITIONAL_HEADER_DIRS diff --git a/mlir/lib/Dialect/VectorOps/CMakeLists.txt b/mlir/lib/Dialect/VectorOps/CMakeLists.txt --- a/mlir/lib/Dialect/VectorOps/CMakeLists.txt +++ b/mlir/lib/Dialect/VectorOps/CMakeLists.txt @@ -1,4 +1,4 @@ -add_llvm_library(MLIRVectorOps +add_llvm_component_library(MLIRVectorOps STATIC DialectRegistration.cpp VectorOps.cpp VectorTransforms.cpp @@ -10,4 +10,4 @@ add_dependencies(MLIRVectorOps MLIRVectorOpsIncGen) add_dependencies(MLIRVectorOps MLIRVectorTransformPatternsIncGen) -target_link_libraries(MLIRVectorOps MLIRIR) +target_link_libraries(MLIRVectorOps MLIRAnalysis MLIRIR MLIRStandardOps) diff --git a/mlir/lib/EDSC/CMakeLists.txt b/mlir/lib/EDSC/CMakeLists.txt --- a/mlir/lib/EDSC/CMakeLists.txt +++ b/mlir/lib/EDSC/CMakeLists.txt @@ -5,7 +5,7 @@ Intrinsics.cpp ) -add_llvm_library(MLIREDSC +add_llvm_component_library(MLIREDSC Builders.cpp Helpers.cpp Intrinsics.cpp @@ -15,23 +15,25 @@ ) target_link_libraries(MLIREDSC PUBLIC - MLIRAffineOps - MLIRLoopOps - MLIRStandardOps - MLIRTransformUtils - MLIRVectorOps - ) + MLIRAffineOps + MLIRIR + MLIRLoopOps + MLIRStandardOps + MLIRSupport + MLIRTransformUtils + MLIRVectorOps + ) -add_llvm_library(MLIREDSCInterface +add_llvm_component_library(MLIREDSCInterface CoreAPIs.cpp ADDITIONAL_HEADER_DIRS ${MLIR_MAIN_INCLUDE_DIR}/mlir/EDSC ) add_dependencies(MLIREDSCInterface MLIRIR) -target_link_libraries(MLIREDSC +target_link_libraries(MLIREDSCInterface PUBLIC - MLIRIR - MLIRSupport - MLIRParser - ) + MLIRIR + MLIRSupport + MLIRParser + ) 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 @@ -1,5 +1,5 @@ llvm_map_components_to_libnames(outlibs "nativecodegen" "IPO") -add_llvm_library(MLIRExecutionEngine +add_llvm_component_library(MLIRExecutionEngine ExecutionEngine.cpp OptUtils.cpp @@ -14,7 +14,15 @@ LLVMBitWriter LLVMExecutionEngine LLVMOrcJIT + LLVMJITLink LLVMSupport + LLVMAnalysis + LLVMAggressiveInstCombine + LLVMInstCombine + LLVMMC + LLVMScalarOpts + LLVMTarget + LLVMVectorize LLVMTransformUtils ${outlibs}) diff --git a/mlir/lib/IR/CMakeLists.txt b/mlir/lib/IR/CMakeLists.txt --- a/mlir/lib/IR/CMakeLists.txt +++ b/mlir/lib/IR/CMakeLists.txt @@ -1,5 +1,5 @@ file(GLOB globbed *.c *.cpp) -add_llvm_library(MLIRIR +add_llvm_component_library(MLIRIR ${globbed} ADDITIONAL_HEADER_DIRS diff --git a/mlir/lib/Parser/CMakeLists.txt b/mlir/lib/Parser/CMakeLists.txt --- a/mlir/lib/Parser/CMakeLists.txt +++ b/mlir/lib/Parser/CMakeLists.txt @@ -1,4 +1,4 @@ -add_llvm_library(MLIRParser +add_llvm_component_library(MLIRParser Lexer.cpp Parser.cpp Token.cpp diff --git a/mlir/lib/Pass/CMakeLists.txt b/mlir/lib/Pass/CMakeLists.txt --- a/mlir/lib/Pass/CMakeLists.txt +++ b/mlir/lib/Pass/CMakeLists.txt @@ -1,5 +1,5 @@ file(GLOB globbed *.c *.cpp) -add_llvm_library(MLIRPass +add_llvm_component_library(MLIRPass ${globbed} ADDITIONAL_HEADER_DIRS diff --git a/mlir/lib/Quantizer/CMakeLists.txt b/mlir/lib/Quantizer/CMakeLists.txt --- a/mlir/lib/Quantizer/CMakeLists.txt +++ b/mlir/lib/Quantizer/CMakeLists.txt @@ -1,5 +1,5 @@ # Support. -add_llvm_library(MLIRQuantizerSupport +add_llvm_component_library(MLIRQuantizerSupport Support/Configuration.cpp Support/ConstraintAnalysisGraph.cpp Support/Metadata.cpp @@ -9,36 +9,43 @@ Support/UniformSolvers.cpp ADDITIONAL_HEADER_DIRS + + LINK_LIBS + MLIRIR + MLIRQuantOps + MLIRSupport + MLIRStandardOps + LLVMSupport ) -add_dependencies(MLIRQuantizerSupport - MLIRIR - MLIRQuantOps - MLIRSupport - MLIRStandardOps) # Configurations. -add_llvm_library(MLIRQuantizerFxpMathConfig +add_llvm_component_library(MLIRQuantizerFxpMathConfig Configurations/FxpMathConfig.cpp ADDITIONAL_HEADER_DIRS + + LINK_LIBS + MLIRIR + MLIRFxpMathOps + MLIRQuantOps + MLIRQuantizerSupport ) add_dependencies(MLIRQuantizerFxpMathConfig - MLIRFxpMathOpsIncGen - MLIRQuantizerSupport) + MLIRFxpMathOpsIncGen + ) # Transforms. -add_llvm_library(MLIRQuantizerTransforms +add_llvm_component_library(MLIRQuantizerTransforms Transforms/AddDefaultStatsTestPass.cpp Transforms/InferQuantizedTypesPass.cpp Transforms/RemoveInstrumentationPass.cpp ADDITIONAL_HEADER_DIRS ) -add_dependencies(MLIRQuantizerTransforms - MLIRQuantizerFxpMathConfig - MLIRQuantizerSupport - MLIRPass) target_link_libraries(MLIRQuantizerTransforms + MLIRIR MLIRQuantizerFxpMathConfig MLIRQuantizerSupport - MLIRPass) + MLIRQuantOps + MLIRPass + LLVMSupport) diff --git a/mlir/lib/Support/CMakeLists.txt b/mlir/lib/Support/CMakeLists.txt --- a/mlir/lib/Support/CMakeLists.txt +++ b/mlir/lib/Support/CMakeLists.txt @@ -7,7 +7,7 @@ TranslateClParser.cpp ) -add_llvm_library(MLIRSupport +add_llvm_component_library(MLIRSupport FileUtilities.cpp StorageUniquer.cpp ToolUtilities.cpp @@ -17,7 +17,7 @@ ) target_link_libraries(MLIRSupport LLVMSupport ${LLVM_PTHREAD_LIB}) -add_llvm_library(MLIROptMain +add_llvm_component_library(MLIROptMain BUILDTREE_ONLY MlirOptMain.cpp ADDITIONAL_HEADER_DIRS @@ -25,19 +25,20 @@ ) target_link_libraries(MLIROptMain MLIRPass + MLIRParser LLVMSupport MLIRSupport ) -add_llvm_library(MLIRTranslateClParser +add_llvm_component_library(MLIRTranslateClParser TranslateClParser.cpp ADDITIONAL_HEADER_DIRS ${MLIR_MAIN_INCLUDE_DIR}/mlir/Support ) -target_link_libraries(MLIRTranslateClParser LLVMSupport) +target_link_libraries(MLIRTranslateClParser LLVMSupport MLIRIR MLIRTranslation MLIRParser) -add_llvm_library(MLIRJitRunner +add_llvm_component_library(MLIRJitRunner BUILDTREE_ONLY JitRunner.cpp ) target_link_libraries(MLIRJitRunner PRIVATE diff --git a/mlir/lib/TableGen/CMakeLists.txt b/mlir/lib/TableGen/CMakeLists.txt --- a/mlir/lib/TableGen/CMakeLists.txt +++ b/mlir/lib/TableGen/CMakeLists.txt @@ -1,4 +1,4 @@ -add_llvm_library(LLVMMLIRTableGen +add_llvm_component_library(LLVMMLIRTableGen Argument.cpp Attribute.cpp Constraint.cpp diff --git a/mlir/lib/Target/CMakeLists.txt b/mlir/lib/Target/CMakeLists.txt --- a/mlir/lib/Target/CMakeLists.txt +++ b/mlir/lib/Target/CMakeLists.txt @@ -1,4 +1,4 @@ -add_llvm_library(MLIRTargetLLVMIRModuleTranslation +add_llvm_component_library(MLIRTargetLLVMIRModuleTranslation LLVMIR/ModuleTranslation.cpp ADDITIONAL_HEADER_DIRS @@ -9,7 +9,7 @@ target_link_libraries(MLIRTargetLLVMIRModuleTranslation MLIRLLVMIR LLVMCore LLVMIRReader LLVMSupport LLVMTransformUtils MLIRTranslation) -add_llvm_library(MLIRTargetLLVMIR +add_llvm_component_library(MLIRTargetLLVMIR LLVMIR/ConvertFromLLVMIR.cpp LLVMIR/ConvertToLLVMIR.cpp @@ -17,7 +17,7 @@ ${MLIR_MAIN_INCLUDE_DIR}/mlir/Target/LLVMIR ) target_link_libraries(MLIRTargetLLVMIR MLIRTargetLLVMIRModuleTranslation) -add_llvm_library(MLIRTargetNVVMIR +add_llvm_component_library(MLIRTargetNVVMIR LLVMIR/ConvertToNVVMIR.cpp ADDITIONAL_HEADER_DIRS @@ -32,7 +32,7 @@ MLIRNVVMIR MLIRTargetLLVMIRModuleTranslation ) -add_llvm_library(MLIRTargetROCDLIR +add_llvm_component_library(MLIRTargetROCDLIR LLVMIR/ConvertToROCDLIR.cpp ADDITIONAL_HEADER_DIRS 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 @@ -1,6 +1,6 @@ add_subdirectory(Utils) -add_llvm_library(MLIRTransforms +add_llvm_component_library(MLIRTransforms AffineDataCopyGeneration.cpp AffineLoopInvariantCodeMotion.cpp Canonicalizer.cpp 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 @@ -1,4 +1,4 @@ -add_llvm_library(MLIRTransformUtils +add_llvm_component_library(MLIRTransformUtils FoldUtils.cpp GreedyPatternRewriteDriver.cpp InliningUtils.cpp diff --git a/mlir/lib/Translation/CMakeLists.txt b/mlir/lib/Translation/CMakeLists.txt --- a/mlir/lib/Translation/CMakeLists.txt +++ b/mlir/lib/Translation/CMakeLists.txt @@ -1,4 +1,4 @@ -add_llvm_library(MLIRTranslation +add_llvm_component_library(MLIRTranslation Translation.cpp ADDITIONAL_HEADER_DIRS diff --git a/mlir/test/lib/IR/CMakeLists.txt b/mlir/test/lib/IR/CMakeLists.txt --- a/mlir/test/lib/IR/CMakeLists.txt +++ b/mlir/test/lib/IR/CMakeLists.txt @@ -4,12 +4,11 @@ TestSymbolUses.cpp ADDITIONAL_HEADER_DIRS + + LINK_LIBS MLIRPass ) include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../TestDialect) include_directories(${CMAKE_CURRENT_BINARY_DIR}/../TestDialect) add_dependencies(MLIRTestIR MLIRTestDialect -) -target_link_libraries(MLIRTestIR - MLIRPass ) diff --git a/mlir/test/lib/Pass/CMakeLists.txt b/mlir/test/lib/Pass/CMakeLists.txt --- a/mlir/test/lib/Pass/CMakeLists.txt +++ b/mlir/test/lib/Pass/CMakeLists.txt @@ -3,8 +3,8 @@ ADDITIONAL_HEADER_DIRS ${MLIR_MAIN_INCLUDE_DIR}/mlir/Pass - ) -target_link_libraries(MLIRTestPass + + LINK_LIBS MLIRIR MLIRPass ) diff --git a/mlir/test/lib/TestDialect/CMakeLists.txt b/mlir/test/lib/TestDialect/CMakeLists.txt --- a/mlir/test/lib/TestDialect/CMakeLists.txt +++ b/mlir/test/lib/TestDialect/CMakeLists.txt @@ -14,15 +14,17 @@ add_llvm_library(MLIRTestDialect TestDialect.cpp TestPatterns.cpp + + LINK_LIBS + MLIRDialect + MLIRIR + MLIRLinalg + MLIRPass + MLIRTransforms + MLIRTransformUtils + LLVMSupport ) add_dependencies(MLIRTestDialect MLIRTestOpsIncGen - MLIRIR - LLVMSupport MLIRTypeInferOpInterfaceIncGen ) -target_link_libraries(MLIRTestDialect - MLIRDialect - MLIRIR - LLVMSupport -) 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 @@ -16,21 +16,24 @@ ADDITIONAL_HEADER_DIRS ${MLIR_MAIN_INCLUDE_DIR}/mlir/Transforms - ) -include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../TestDialect) -include_directories(${CMAKE_CURRENT_BINARY_DIR}/../TestDialect) -include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../DeclarativeTransforms) -include_directories(${CMAKE_CURRENT_BINARY_DIR}/../DeclarativeTransforms) -add_dependencies(MLIRTestTransforms MLIRStandardOpsIncGen) -add_dependencies(MLIRTestTransforms MLIRTestLinalgTransformPatternsIncGen) -add_dependencies(MLIRTestTransforms MLIRTestVectorTransformPatternsIncGen) -target_link_libraries(MLIRTestTransforms + + LINK_LIBS MLIRAffineOps MLIRAnalysis MLIREDSC MLIRGPU MLIRLoopOps + MLIRLinalg MLIRPass MLIRTestDialect + MLIRTransformUtils + MLIRVectorToLoops MLIRVectorOps ) +include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../TestDialect) +include_directories(${CMAKE_CURRENT_BINARY_DIR}/../TestDialect) +include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../DeclarativeTransforms) +include_directories(${CMAKE_CURRENT_BINARY_DIR}/../DeclarativeTransforms) +add_dependencies(MLIRTestTransforms MLIRStandardOpsIncGen) +add_dependencies(MLIRTestTransforms MLIRTestLinalgTransformPatternsIncGen) +add_dependencies(MLIRTestTransforms MLIRTestVectorTransformPatternsIncGen) diff --git a/mlir/tools/mlir-opt/CMakeLists.txt b/mlir/tools/mlir-opt/CMakeLists.txt --- a/mlir/tools/mlir-opt/CMakeLists.txt +++ b/mlir/tools/mlir-opt/CMakeLists.txt @@ -5,15 +5,16 @@ set(LIB_LIBS MLIRAnalysis MLIRLLVMIR + MLIROptMain MLIRParser MLIRPass MLIRTransforms MLIRSupport ) -add_llvm_library(MLIRMlirOptLib +add_llvm_library(MLIRMlirOptLib BUILDTREE_ONLY mlir-opt.cpp + LINK_LIBS ${LIB_LIBS} ) -target_link_libraries(MLIRMlirOptLib ${LIB_LIBS}) set(LIBS MLIRAnalysis @@ -65,4 +66,4 @@ ) llvm_update_compile_flags(mlir-opt) whole_archive_link(mlir-opt ${LIBS}) -target_link_libraries(mlir-opt PRIVATE MLIRIR MLIRMlirOptLib ${LIBS} LLVMSupport) +target_link_libraries(mlir-opt PRIVATE MLIRIR MLIROptMain MLIRMlirOptLib ${LIBS} LLVMSupport)