17 changes: 12 additions & 5 deletions mlir/lib/Conversion/StandardToLLVM/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,20 @@ add_mlir_conversion_library(MLIRStandardToLLVM

ADDITIONAL_HEADER_DIRS
${MLIR_MAIN_INCLUDE_DIR}/mlir/Conversion/StandardToLLVM
)
add_dependencies(
MLIRStandardToLLVM

LINK_LIBS
MLIRIR
MLIRLLVMIR
MLIRPass
MLIRStandardOps
MLIRTransforms
LLVMCore
LLVMSupport
)
)
target_link_libraries(
MLIRStandardToLLVM

MLIRLLVMIR
MLIRTransforms
LLVMCore
LLVMSupport
)
9 changes: 4 additions & 5 deletions mlir/lib/Conversion/StandardToSPIRV/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,17 @@ add_mlir_conversion_library(MLIRStandardToSPIRVTransforms
ADDITIONAL_HEADER_DIRS
${MLIR_MAIN_INCLUDE_DIR}/mlir/Dialect/SPIRV
${MLIR_MAIN_INCLUDE_DIR}/mlir/IR
)

DEPENDS
MLIRStandardToSPIRVIncGen
add_dependencies(MLIRStandardToSPIRVTransforms
MLIRStandardToSPIRVIncGen)

LINK_LIBS
target_link_libraries(MLIRStandardToSPIRVTransforms
MLIRIR
MLIRPass
MLIRSPIRV
MLIRSupport
MLIRTransforms
MLIRTransformUtils
MLIRSPIRV
MLIRStandardOps
LLVMSupport
)
13 changes: 6 additions & 7 deletions mlir/lib/Conversion/VectorToLLVM/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,15 @@ add_mlir_conversion_library(MLIRVectorToLLVM

ADDITIONAL_HEADER_DIRS
${MLIR_MAIN_INCLUDE_DIR}/mlir/Conversion/VectorToLLVM

LINK_LIBS
MLIRIR
)
set(LIBS
MLIRLLVMIR
MLIRPass
MLIRStandardOps
MLIRStandardToLLVM
MLIRVectorOps
MLIRTransforms
MLIRTransformUtils
LLVMCore
LLVMSupport
)
)

add_dependencies(MLIRVectorToLLVM ${LIBS})
target_link_libraries(MLIRVectorToLLVM ${LIBS})
13 changes: 5 additions & 8 deletions mlir/lib/Conversion/VectorToLoops/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,14 @@ add_mlir_conversion_library(MLIRVectorToLoops

ADDITIONAL_HEADER_DIRS
${MLIR_MAIN_INCLUDE_DIR}/mlir/Conversion/VectorToLoops

LINK_LIBS
MLIRAffineOps
)
set(LIBS
MLIREDSC
MLIRIR
MLIRLLVMIR
MLIRLoopOps
MLIRStandardOps
MLIRTransforms
MLIRTransformUtils
MLIRVectorOps
LLVMCore
LLVMSupport
)

add_dependencies(MLIRVectorToLoops ${LIBS})
target_link_libraries(MLIRVectorToLoops ${LIBS})
10 changes: 7 additions & 3 deletions mlir/lib/Dialect/AffineOps/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,18 @@ add_mlir_dialect_library(MLIRAffineOps

ADDITIONAL_HEADER_DIRS
${MLIR_MAIN_INCLUDE_DIR}/mlir/Dialect/AffineOps
)
add_dependencies(MLIRAffineOps

DEPENDS
MLIRAffineOpsIncGen
MLIREDSC
MLIRIR
MLIRLoopLikeInterfaceIncGen
MLIRStandardOps
)
target_link_libraries(MLIRAffineOps

LINK_LIBS
MLIREDSC
MLIRIR
MLIRStandardOps
LLVMSupport
)
5 changes: 1 addition & 4 deletions mlir/lib/Dialect/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,5 @@ add_llvm_library(MLIRDialect

ADDITIONAL_HEADER_DIRS
${MLIR_MAIN_INCLUDE_DIR}/mlir/Dialect

LINK_LIBS
MLIRIR
LLVMSupport
)
target_link_libraries(MLIRDialect MLIRIR)
16 changes: 9 additions & 7 deletions mlir/lib/Dialect/FxpMathOps/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,19 @@ add_mlir_dialect_library(MLIRFxpMathOps

ADDITIONAL_HEADER_DIRS
${MLIR_MAIN_INCLUDE_DIR}/mlir/Dialect/FxpMathOps
)

DEPENDS
MLIRFxpMathOpsIncGen

LINK_LIBS
target_link_libraries(MLIRFxpMathOps
MLIRQuantOps
MLIRIR
MLIRPass
MLIRSupport
MLIRStandardOps
MLIRTransforms
MLIRTransformUtils
LLVMSupport
)
add_dependencies(MLIRFxpMathOps
MLIRFxpMathOpsIncGen
MLIRQuantOps
MLIRIR
MLIRPass
MLIRSupport
MLIRStandardOps)
17 changes: 11 additions & 6 deletions mlir/lib/Dialect/GPU/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,17 @@ add_mlir_dialect_library(MLIRGPU

ADDITIONAL_HEADER_DIRS
${MLIR_MAIN_INCLUDE_DIR}/mlir/Dialect/GPU

DEPENDS
)
add_dependencies(MLIRGPU
MLIRGPUOpsIncGen

LINK_LIBS
MLIREDSC
MLIRIR
MLIRLLVMIR
MLIRLoopOps
MLIRSupport
MLIRTransformUtils
LLVMSupport)
target_link_libraries(MLIRGPU
MLIREDSC
MLIRIR
MLIRLLVMIR
Expand All @@ -20,5 +26,4 @@ add_mlir_dialect_library(MLIRGPU
MLIRStandardOps
MLIRSupport
MLIRTransformUtils
LLVMSupport
)
LLVMSupport)
38 changes: 6 additions & 32 deletions mlir/lib/Dialect/LLVMIR/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,50 +3,24 @@ add_mlir_dialect_library(MLIRLLVMIR

ADDITIONAL_HEADER_DIRS
${MLIR_MAIN_INCLUDE_DIR}/mlir/Dialect/LLVMIR

DEPENDS
MLIRLLVMOpsIncGen
MLIRLLVMConversionsIncGen

LINK_LIBS
LLVMAsmParser
LLVMCore
LLVMSupport
MLIRIR
MLIRSupport
)
add_dependencies(MLIRLLVMIR MLIRLLVMOpsIncGen MLIRLLVMConversionsIncGen LLVMAsmParser LLVMCore LLVMSupport)
target_link_libraries(MLIRLLVMIR LLVMAsmParser LLVMCore LLVMSupport MLIRIR)

add_mlir_dialect_library(MLIRNVVMIR
IR/NVVMDialect.cpp

ADDITIONAL_HEADER_DIRS
${MLIR_MAIN_INCLUDE_DIR}/mlir/Dialect/LLVMIR

DEPENDS
MLIRNVVMOpsIncGen
MLIRNVVMConversionsIncGen

LINK_LIBS
LLVMAsmParser
MLIRIR
MLIRLLVMIR
LLVMSupport
LLVMCore
)
add_dependencies(MLIRNVVMIR MLIRNVVMOpsIncGen MLIRNVVMConversionsIncGen LLVMAsmParser LLVMCore LLVMSupport)
target_link_libraries(MLIRNVVMIR LLVMAsmParser MLIRIR MLIRLLVMIR LLVMSupport LLVMCore)

add_mlir_dialect_library(MLIRROCDLIR
IR/ROCDLDialect.cpp

ADDITIONAL_HEADER_DIRS
${MLIR_MAIN_INCLUDE_DIR}/mlir/Dialect/LLVMIR

DEPENDS
MLIRROCDLOpsIncGen
MLIRROCDLConversionsIncGen

LINK_LIBS
LLVMAsmParser
LLVMCore
LLVMSupport
MLIRIR
)
add_dependencies(MLIRROCDLIR MLIRROCDLOpsIncGen MLIRROCDLConversionsIncGen LLVMAsmParser LLVMCore LLVMSupport)
target_link_libraries(MLIRROCDLIR LLVMAsmParser LLVMCore LLVMSupport MLIRIR)
17 changes: 10 additions & 7 deletions mlir/lib/Dialect/Linalg/Analysis/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
set(LIBS

MLIRLinalgOps
MLIRStandardOps
)


add_mlir_dialect_library(MLIRLinalgAnalysis
DependenceAnalysis.cpp

ADDITIONAL_HEADER_DIRS
${MLIR_MAIN_INCLUDE_DIR}/mlir/Dialect/Linalg

DEPENDS
intrinsics_gen

LINK_LIBS
MLIRIR
MLIRLinalgOps
MLIRStandardOps
LLVMSupport
)

add_dependencies(MLIRLinalgAnalysis ${LIBS})
target_link_libraries(MLIRLinalgAnalysis ${LIBS})
23 changes: 13 additions & 10 deletions mlir/lib/Dialect/Linalg/EDSC/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
add_mlir_dialect_library(MLIRLinalgEDSC
Builders.cpp

ADDITIONAL_HEADER_DIRS
${MLIR_MAIN_INCLUDE_DIR}/mlir/Dialect/Linalg
set(LIBS

DEPENDS
intrinsics_gen

LINK_LIBS
MLIREDSC
MLIRIR
MLIRAffineOps
MLIRLinalgOps
MLIRLoopOps
MLIRStandardOps
LLVMSupport
)

add_mlir_dialect_library(MLIRLinalgEDSC
Builders.cpp

ADDITIONAL_HEADER_DIRS
${MLIR_MAIN_INCLUDE_DIR}/mlir/Dialect/Linalg
DEPENDS
intrinsics_gen
)

add_dependencies(MLIRLinalgEDSC ${LIBS})
target_link_libraries(MLIRLinalgEDSC ${LIBS})
17 changes: 10 additions & 7 deletions mlir/lib/Dialect/Linalg/IR/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,21 +1,24 @@
set(LIBS

MLIRIR
MLIRStandardOps
)

add_mlir_dialect_library(MLIRLinalgOps
LinalgOps.cpp
LinalgTypes.cpp

ADDITIONAL_HEADER_DIRS
${MLIR_MAIN_INCLUDE_DIR}/mlir/Dialect/Linalg

DEPENDS
intrinsics_gen

LINK_LIBS
MLIRIR
MLIRStandardOps
MLIRSupport
LLVMSupport
)

add_dependencies(MLIRLinalgOps

${LIBS}
MLIRLinalgOpsIncGen
MLIRLinalgStructuredOpsIncGen
MLIRLinalgStructuredOpsInterfaceIncGen
)
target_link_libraries(MLIRLinalgOps ${LIBS})
36 changes: 21 additions & 15 deletions mlir/lib/Dialect/Linalg/Transforms/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,18 +1,5 @@
add_mlir_dialect_library(MLIRLinalgTransforms
Fusion.cpp
LinalgTransforms.cpp
LinalgToLoops.cpp
Promotion.cpp
Tiling.cpp
set(LIBS

ADDITIONAL_HEADER_DIRS
${MLIR_MAIN_INCLUDE_DIR}/mlir/Dialect/Linalg

DEPENDS
intrinsics_gen
MLIRLinalgTransformPatternsIncGen

LINK_LIBS
MLIRAffineOps
MLIRAnalysis
MLIREDSC
Expand All @@ -27,5 +14,24 @@ add_mlir_dialect_library(MLIRLinalgTransforms
MLIRStandardToLLVM
MLIRTransformUtils
MLIRVectorOps
LLVMSupport
)

add_mlir_dialect_library(MLIRLinalgTransforms
Fusion.cpp
LinalgTransforms.cpp
LinalgToLoops.cpp
Promotion.cpp
Tiling.cpp

ADDITIONAL_HEADER_DIRS
${MLIR_MAIN_INCLUDE_DIR}/mlir/Dialect/Linalg
DEPENDS
intrinsics_gen
)

add_dependencies(MLIRLinalgTransforms

${LIBS}
MLIRLinalgTransformPatternsIncGen
)
target_link_libraries(MLIRLinalgTransforms ${LIBS})
25 changes: 14 additions & 11 deletions mlir/lib/Dialect/Linalg/Utils/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,20 +1,23 @@
add_mlir_dialect_library(MLIRLinalgUtils
Utils.cpp

ADDITIONAL_HEADER_DIRS
${MLIR_MAIN_INCLUDE_DIR}/mlir/Dialect/Linalg
set(LIBS

DEPENDS
intrinsics_gen

LINK_LIBS
MLIRAffineOps
MLIREDSC
MLIRIR
MLIRLinalgOps
MLIRLoopOps
MLIRPass
MLIRStandardOps
MLIRTransformUtils
LLVMSupport
)

add_mlir_dialect_library(MLIRLinalgUtils

Utils.cpp

ADDITIONAL_HEADER_DIRS
${MLIR_MAIN_INCLUDE_DIR}/mlir/Dialect/Linalg
DEPENDS
intrinsics_gen
)

add_dependencies(MLIRLinalgUtils ${LIBS})
target_link_libraries(MLIRLinalgUtils ${LIBS})
9 changes: 7 additions & 2 deletions mlir/lib/Dialect/LoopOps/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,17 @@ add_mlir_dialect_library(MLIRLoopOps

ADDITIONAL_HEADER_DIRS
${MLIR_MAIN_INCLUDE_DIR}/mlir/LoopOps
)
add_dependencies(MLIRLoopOps

DEPENDS
MLIREDSC
MLIRLoopLikeInterfaceIncGen
MLIRLoopOpsIncGen
MLIRStandardOps
LLVMSupport
)
target_link_libraries(MLIRLoopOps

LINK_LIBS
MLIREDSC
MLIRIR
MLIRStandardOps
Expand Down
11 changes: 3 additions & 8 deletions mlir/lib/Dialect/OpenMP/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,7 @@ add_mlir_dialect_library(MLIROpenMP

ADDITIONAL_HEADER_DIRS
${MLIR_MAIN_INCLUDE_DIR}/mlir/Dialect/OpenMP

DEPENDS
MLIROpenMPOpsIncGen

LINK_LIBS
MLIRIR
LLVMCore
LLVMSupport
)

add_dependencies(MLIROpenMP MLIROpenMPOpsIncGen)
target_link_libraries(MLIROpenMP MLIRIR)
13 changes: 8 additions & 5 deletions mlir/lib/Dialect/QuantOps/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,18 @@ add_mlir_dialect_library(MLIRQuantOps

ADDITIONAL_HEADER_DIRS
${MLIR_MAIN_INCLUDE_DIR}/mlir/Dialect/QuantOps
)
add_dependencies(MLIRQuantOps
MLIRIR
MLIRPass
MLIRQuantOpsIncGen
MLIRSupport
MLIRStandardOps)

DEPENDS
MLIRQuantOpsIncGen

LINK_LIBS
target_link_libraries(MLIRQuantOps
MLIRIR
MLIRPass
MLIRSupport
MLIRStandardOps
MLIRTransformUtils
LLVMSupport
)
9 changes: 3 additions & 6 deletions mlir/lib/Dialect/SDBM/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ add_mlir_dialect_library(MLIRSDBM

ADDITIONAL_HEADER_DIRS
${MLIR_MAIN_INCLUDE_DIR}/mlir/Dialect/SDBM

LINK_LIBS
MLIRIR
MLIRSupport
LLVMSupport
)
)
add_dependencies(MLIRSDBM MLIRIR)
target_link_libraries(MLIRSDBM MLIRIR)
12 changes: 5 additions & 7 deletions mlir/lib/Dialect/SPIRV/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,24 +13,22 @@ add_mlir_dialect_library(MLIRSPIRV

ADDITIONAL_HEADER_DIRS
${MLIR_MAIN_INCLUDE_DIR}/mlir/Dialect/SPIRV
)

DEPENDS
add_dependencies(MLIRSPIRV
MLIRSPIRVAvailabilityIncGen
MLIRSPIRVCanonicalizationIncGen
MLIRSPIRVEnumAvailabilityIncGen
MLIRSPIRVEnumsIncGen
MLIRSPIRVOpsIncGen
MLIRSPIRVOpUtilsGen
MLIRSPIRVTargetAndABIIncGen
MLIRSPIRVTargetAndABIIncGen)

LINK_LIBS
target_link_libraries(MLIRSPIRV
MLIRIR
MLIRParser
MLIRStandardOps
MLIRSupport
MLIRTransforms
LLVMSupport
)
MLIRTransforms)

add_subdirectory(Serialization)
add_subdirectory(Transforms)
12 changes: 5 additions & 7 deletions mlir/lib/Dialect/SPIRV/Serialization/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,13 @@ add_mlir_dialect_library(MLIRSPIRVSerialization

ADDITIONAL_HEADER_DIRS
${MLIR_MAIN_INCLUDE_DIR}/mlir/Dialect/SPIRV
)

DEPENDS
MLIRSPIRVSerializationGen
add_dependencies(MLIRSPIRVSerialization
MLIRSPIRVSerializationGen)

LINK_LIBS
target_link_libraries(MLIRSPIRVSerialization
MLIRIR
MLIRParser
MLIRSPIRV
MLIRSupport
MLIRTranslation
LLVMSupport
)
MLIRTranslation)
8 changes: 2 additions & 6 deletions mlir/lib/Dialect/SPIRV/Transforms/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,9 @@ add_mlir_dialect_library(MLIRSPIRVTransforms

ADDITIONAL_HEADER_DIRS
${MLIR_MAIN_INCLUDE_DIR}/mlir/Dialect/SPIRV
)

LINK_LIBS
MLIRIR
target_link_libraries(MLIRSPIRVTransforms
MLIRPass
MLIRSPIRV
MLIRStandardOps
MLIRTransforms
MLIRTransformUtils
LLVMSupport
)
11 changes: 7 additions & 4 deletions mlir/lib/Dialect/StandardOps/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,18 @@ add_mlir_dialect_library(MLIRStandardOps

ADDITIONAL_HEADER_DIRS
${MLIR_MAIN_INCLUDE_DIR}/mlir/Dialect/StandardOps
)
add_dependencies(MLIRStandardOps

DEPENDS
MLIRCallOpInterfacesIncGen
MLIREDSC
MLIRIR
MLIRStandardOpsIncGen
LLVMSupport
)
target_link_libraries(MLIRStandardOps

LINK_LIBS
MLIREDSC
MLIRIR
MLIRSupport
LLVMCore
LLVMSupport
)
15 changes: 4 additions & 11 deletions mlir/lib/Dialect/VectorOps/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,9 @@ add_mlir_dialect_library(MLIRVectorOps

ADDITIONAL_HEADER_DIRS
${MLIR_MAIN_INCLUDE_DIR}/mlir/Dialect/VectorOps
)

DEPENDS
MLIRVectorOpsIncGen
MLIRVectorTransformPatternsIncGen
add_dependencies(MLIRVectorOps MLIRVectorOpsIncGen)
add_dependencies(MLIRVectorOps MLIRVectorTransformPatternsIncGen)

LINK_LIBS
MLIRIR
MLIRStandardOps
MLIRAffineOps
MLIRLoopOps
MLIRLoopAnalysis
LLVMSupport
)
target_link_libraries(MLIRVectorOps MLIRIR MLIRStandardOps MLIRAffineOps MLIRLoopOps MLIRLoopAnalysis)
12 changes: 7 additions & 5 deletions mlir/lib/EDSC/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,24 @@ add_llvm_library(MLIREDSC

ADDITIONAL_HEADER_DIRS
${MLIR_MAIN_INCLUDE_DIR}/mlir/EDSC
)
target_link_libraries(MLIREDSC
PUBLIC

LINK_LIBS
MLIRIR
MLIRSupport
LLVMSupport
)

add_llvm_library(MLIREDSCInterface
CoreAPIs.cpp

ADDITIONAL_HEADER_DIRS
${MLIR_MAIN_INCLUDE_DIR}/mlir/EDSC

LINK_LIBS
)
add_dependencies(MLIREDSCInterface MLIRIR)
target_link_libraries(MLIREDSCInterface
PUBLIC
MLIRIR
MLIRSupport
MLIRParser
LLVMSupport
)
10 changes: 4 additions & 6 deletions mlir/lib/ExecutionEngine/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,13 @@ add_llvm_library(MLIRExecutionEngine

ADDITIONAL_HEADER_DIRS
${MLIR_MAIN_INCLUDE_DIR}/mlir/ExecutionEngine
)
target_link_libraries(MLIRExecutionEngine

LINK_LIBS
MLIRIR
MLIRLLVMIR
MLIRSupport
MLIRTargetLLVMIR
LLVMBitReader
LLVMBitWriter
LLVMCore
LLVMExecutionEngine
LLVMObject
LLVMOrcJIT
Expand All @@ -34,8 +32,8 @@ add_llvm_library(MLIRExecutionEngine
LLVMTarget
LLVMVectorize
LLVMTransformUtils
${outlibs}
)

${outlibs})

add_llvm_library(mlir_c_runner_utils SHARED CRunnerUtils.cpp)
target_compile_definitions(mlir_c_runner_utils PRIVATE mlir_c_runner_utils_EXPORTS)
Expand Down
11 changes: 2 additions & 9 deletions mlir/lib/IR/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,6 @@ add_llvm_library(MLIRIR

ADDITIONAL_HEADER_DIRS
${MLIR_MAIN_INCLUDE_DIR}/mlir/IR

DEPENDS
MLIRCallOpInterfacesIncGen
MLIROpAsmInterfacesIncGen

LINK_LIBS
MLIRSupport
LLVMSupport
${LLVM_PTHREAD_LIB}
)
add_dependencies(MLIRIR MLIRCallOpInterfacesIncGen MLIROpAsmInterfacesIncGen MLIRSupport LLVMSupport)
target_link_libraries(MLIRIR MLIRSupport LLVMSupport)
7 changes: 2 additions & 5 deletions mlir/lib/Parser/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ add_llvm_library(MLIRParser

ADDITIONAL_HEADER_DIRS
${MLIR_MAIN_INCLUDE_DIR}/mlir/Parser

LINK_LIBS
MLIRIR
MLIRAnalysis
LLVMSupport
)
add_dependencies(MLIRParser MLIRIR MLIRAnalysis)
target_link_libraries(MLIRParser MLIRIR MLIRAnalysis)
9 changes: 2 additions & 7 deletions mlir/lib/Pass/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,6 @@ add_llvm_library(MLIRPass

ADDITIONAL_HEADER_DIRS
${MLIR_MAIN_INCLUDE_DIR}/mlir/Pass

LINK_LIBS
MLIRAnalysis
MLIRIR
MLIRSupport
LLVMIRReader
LLVMSupport
)
add_dependencies(MLIRPass MLIRAnalysis MLIRIR LLVMSupport)
target_link_libraries(MLIRPass MLIRAnalysis MLIRIR LLVMSupport)
30 changes: 18 additions & 12 deletions mlir/lib/Quantizer/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,14 @@ add_llvm_library(MLIRQuantizerSupport
Support/UniformSolvers.cpp

ADDITIONAL_HEADER_DIRS
)

LINK_LIBS
add_dependencies(MLIRQuantizerSupport
MLIRIR
MLIRQuantOps
MLIRSupport
MLIRStandardOps)
target_link_libraries(MLIRQuantizerSupport
MLIRIR
MLIRQuantOps
MLIRSupport
Expand All @@ -23,18 +29,16 @@ add_llvm_library(MLIRQuantizerFxpMathConfig
Configurations/FxpMathConfig.cpp

ADDITIONAL_HEADER_DIRS
)

DEPENDS
MLIRFxpMathOpsIncGen

LINK_LIBS
add_dependencies(MLIRQuantizerFxpMathConfig
MLIRFxpMathOpsIncGen
MLIRQuantizerSupport)
target_link_libraries(MLIRQuantizerFxpMathConfig
MLIRIR
MLIRFxpMathOps
MLIRQuantOps
MLIRQuantizerSupport
MLIRStandardOps
MLIRSupport
LLVMSupport
)

# Transforms.
Expand All @@ -44,14 +48,16 @@ add_llvm_library(MLIRQuantizerTransforms
Transforms/RemoveInstrumentationPass.cpp

ADDITIONAL_HEADER_DIRS

LINK_LIBS
)
add_dependencies(MLIRQuantizerTransforms
MLIRQuantizerFxpMathConfig
MLIRQuantizerSupport
MLIRPass)
target_link_libraries(MLIRQuantizerTransforms
MLIRIR
MLIRQuantizerFxpMathConfig
MLIRQuantizerSupport
MLIRQuantOps
MLIRPass
MLIRTransforms
MLIRTransformUtils
LLVMSupport
)
31 changes: 8 additions & 23 deletions mlir/lib/Support/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,57 +14,42 @@ add_llvm_library(MLIRSupport

ADDITIONAL_HEADER_DIRS
${MLIR_MAIN_INCLUDE_DIR}/mlir/Support

LINK_LIBS
LLVMSupport
${LLVM_PTHREAD_LIB}
)
target_link_libraries(MLIRSupport LLVMSupport ${LLVM_PTHREAD_LIB})

add_llvm_library(MLIROptLib
MlirOptMain.cpp

ADDITIONAL_HEADER_DIRS
${MLIR_MAIN_INCLUDE_DIR}/mlir/Support

LINK_LIBS
MLIRIR
)
target_link_libraries(MLIROptLib
MLIRPass
MLIRParser
MLIRSupport
LLVMSupport
MLIRSupport
)

add_llvm_library(MLIRTranslateClParser
TranslateClParser.cpp

ADDITIONAL_HEADER_DIRS
${MLIR_MAIN_INCLUDE_DIR}/mlir/Support

LINK_LIBS
LLVMSupport
MLIRAnalysis
MLIRIR
MLIRTranslation
MLIRParser
)
target_link_libraries(MLIRTranslateClParser LLVMSupport MLIRIR MLIRTranslation MLIRParser)

add_llvm_library(MLIRJitRunner
JitRunner.cpp

LINK_LIBS
)
target_link_libraries(MLIRJitRunner PRIVATE
MLIRExecutionEngine
MLIRIR
MLIRLLVMIR
MLIRParser
MLIRStandardOps
MLIRTargetLLVMIR
MLIRTransforms
MLIRStandardToLLVM
MLIRSupport
LLVMCore
LLVMOrcJIT
LLVMSupport
LLVMX86CodeGen
LLVMX86Desc
LLVMX86Info
)
)
5 changes: 1 addition & 4 deletions mlir/lib/TableGen/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,5 @@ add_llvm_library(LLVMMLIRTableGen

ADDITIONAL_HEADER_DIRS
${MLIR_MAIN_INCLUDE_DIR}/mlir/TableGen

LINK_LIBS
LLVMSupport
LLVMTableGen
)
target_link_libraries(LLVMMLIRTableGen LLVMSupport LLVMTableGen)
43 changes: 8 additions & 35 deletions mlir/lib/Target/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,74 +4,47 @@ add_llvm_library(MLIRTargetLLVMIRModuleTranslation

ADDITIONAL_HEADER_DIRS
${MLIR_MAIN_INCLUDE_DIR}/mlir/Target/LLVMIR

DEPENDS
intrinsics_gen

LINK_LIBS
MLIRLLVMIR
LLVMCore
LLVMIRReader
LLVMSupport
LLVMTransformUtils
MLIRIR
MLIRSupport
MLIRTranslation
)

target_link_libraries(MLIRTargetLLVMIRModuleTranslation
MLIRLLVMIR LLVMCore LLVMIRReader LLVMSupport LLVMTransformUtils
MLIRTranslation)
add_llvm_library(MLIRTargetLLVMIR
LLVMIR/ConvertFromLLVMIR.cpp
LLVMIR/ConvertToLLVMIR.cpp

ADDITIONAL_HEADER_DIRS
${MLIR_MAIN_INCLUDE_DIR}/mlir/Target/LLVMIR

LINK_LIBS
MLIRIR
MLIRLLVMIR
MLIRSupport
MLIRTargetLLVMIRModuleTranslation
MLIRTranslation
LLVMCore
LLVMIRReader
LLVMSupport
)
target_link_libraries(MLIRTargetLLVMIR MLIRTargetLLVMIRModuleTranslation)
add_llvm_library(MLIRTargetNVVMIR
LLVMIR/ConvertToNVVMIR.cpp

ADDITIONAL_HEADER_DIRS
${MLIR_MAIN_INCLUDE_DIR}/mlir/Target/LLVMIR

DEPENDS
intrinsics_gen

LINK_LIBS
)
target_link_libraries(MLIRTargetNVVMIR
MLIRGPU
MLIRIR
MLIRLLVMIR
MLIRNVVMIR
MLIRTargetLLVMIRModuleTranslation
MLIRTranslation
LLVMCore
LLVMSupport
)

add_llvm_library(MLIRTargetROCDLIR
LLVMIR/ConvertToROCDLIR.cpp

ADDITIONAL_HEADER_DIRS
${MLIR_MAIN_INCLUDE_DIR}/mlir/Target/LLVMIR

DEPENDS
intrinsics_gen

LINK_LIBS
)
target_link_libraries(MLIRTargetROCDLIR
MLIRGPU
MLIRIR
MLIRLLVMIR
MLIRROCDLIR
MLIRTargetLLVMIRModuleTranslation
MLIRTranslation
LLVMCore
LLVMSupport
)
13 changes: 4 additions & 9 deletions mlir/lib/Transforms/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,16 @@ add_llvm_library(MLIRTransforms

ADDITIONAL_HEADER_DIRS
${MLIR_MAIN_INCLUDE_DIR}/mlir/Transforms
)

DEPENDS
add_dependencies(MLIRTransforms
MLIRLoopLikeInterfaceIncGen
MLIRStandardOpsIncGen

LINK_LIBS
MLIRStandardOpsIncGen)
target_link_libraries(MLIRTransforms
MLIRAffineOps
MLIRAnalysis
MLIRIR
MLIRLoopOps
MLIRLoopAnalysis
MLIRPass
MLIRSupport
MLIRStandardOps
MLIRTransformUtils
MLIRVectorOps
LLVMSupport
)
9 changes: 3 additions & 6 deletions mlir/lib/Transforms/Utils/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,14 @@ add_llvm_library(MLIRTransformUtils

ADDITIONAL_HEADER_DIRS
${MLIR_MAIN_INCLUDE_DIR}/mlir/Transforms
)

DEPENDS
MLIRStandardOpsIncGen

LINK_LIBS
add_dependencies(MLIRTransformUtils MLIRStandardOpsIncGen)
target_link_libraries(MLIRTransformUtils
MLIRAffineOps
MLIRAnalysis
MLIRIR
MLIRLoopAnalysis
MLIRLoopOps
MLIRPass
MLIRStandardOps
LLVMSupport
)
6 changes: 2 additions & 4 deletions mlir/lib/Translation/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,5 @@ add_llvm_library(MLIRTranslation

ADDITIONAL_HEADER_DIRS
${MLIR_MAIN_INCLUDE_DIR}/mlir/Translation

LINK_LIBS
LLVMSupport
)
)
target_link_libraries(MLIRTranslation LLVMSupport)
1 change: 0 additions & 1 deletion mlir/test/EDSC/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ target_link_libraries(mlir-edsc-builder-api-test
MLIRStandardOps
MLIRTransforms
MLIRVectorOps
MLIRTransformUtils
LLVMCore
LLVMSupport
)
Expand Down
6 changes: 2 additions & 4 deletions mlir/test/lib/Dialect/SPIRV/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,11 @@ add_llvm_library(MLIRSPIRVTestPasses
ADDITIONAL_HEADER_DIRS
${MLIR_MAIN_INCLUDE_DIR}/mlir/Dialect/SPIRV
${MLIR_MAIN_INCLUDE_DIR}/mlir/IR
)

LINK_LIBS
target_link_libraries(MLIRSPIRVTestPasses PRIVATE
MLIRIR
MLIRPass
MLIRSPIRV
MLIRSupport
MLIRTransforms
MLIRTransformUtils
LLVMSupport
)
12 changes: 6 additions & 6 deletions mlir/test/lib/IR/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ add_llvm_library(MLIRTestIR
TestSymbolUses.cpp

ADDITIONAL_HEADER_DIRS

LINK_LIBS
MLIRIR
MLIRPass
MLIRStandardOps
LLVMSupport
)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../TestDialect)
include_directories(${CMAKE_CURRENT_BINARY_DIR}/../TestDialect)
add_dependencies(MLIRTestIR
MLIRTestDialect
)
target_link_libraries(MLIRTestIR
MLIRPass
)
5 changes: 2 additions & 3 deletions mlir/test/lib/Pass/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@ add_llvm_library(MLIRTestPass

ADDITIONAL_HEADER_DIRS
${MLIR_MAIN_INCLUDE_DIR}/mlir/Pass

LINK_LIBS
)
target_link_libraries(MLIRTestPass
MLIRIR
MLIRPass
LLVMSupport
)
9 changes: 4 additions & 5 deletions mlir/test/lib/TestDialect/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,12 @@ add_public_tablegen_target(MLIRTestOpsIncGen)
add_llvm_library(MLIRTestDialect
TestDialect.cpp
TestPatterns.cpp

DEPENDS
)
add_dependencies(MLIRTestDialect
MLIRTestOpsIncGen
MLIRTypeInferOpInterfaceIncGen

LINK_LIBS
MLIRAnalysis
)
target_link_libraries(MLIRTestDialect
MLIRDialect
MLIRIR
MLIRLinalgTransforms
Expand Down
26 changes: 10 additions & 16 deletions mlir/test/lib/Transforms/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,33 +22,27 @@ add_llvm_library(MLIRTestTransforms

ADDITIONAL_HEADER_DIRS
${MLIR_MAIN_INCLUDE_DIR}/mlir/Transforms
)

DEPENDS
MLIRStandardOpsIncGen
MLIRTestLinalgTransformPatternsIncGen
MLIRTestVectorTransformPatternsIncGen

LINK_LIBS
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
MLIRAffineOps
MLIRAnalysis
MLIRLoopAnalysis
MLIREDSC
MLIRGPU
MLIRIR
MLIRLinalgOps
MLIRLinalgTransforms
MLIRLoopOps
MLIRGPU
MLIRPass
MLIRStandardOps
MLIRTestDialect
MLIRTransformUtils
MLIRVectorToLoops
MLIRVectorOps
LLVMSupport
)

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)
)
6 changes: 2 additions & 4 deletions mlir/test/mlir-cpu-runner/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@ set(LLVM_OPTIONAL_SOURCES
add_llvm_library(cblas SHARED cblas.cpp)
target_compile_definitions(cblas PRIVATE cblas_EXPORTS)

add_llvm_library(cblas_interface SHARED cblas_interface.cpp
LINK_LIBS
cblas
)
add_llvm_library(cblas_interface SHARED cblas_interface.cpp)
target_link_libraries(cblas_interface PRIVATE cblas)
target_compile_definitions(cblas_interface PRIVATE cblas_interface_EXPORTS)

14 changes: 6 additions & 8 deletions mlir/tools/mlir-cuda-runner/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ if(MLIR_CUDA_RUNNER_ENABLED)

add_llvm_library(cuda-runtime-wrappers SHARED
cuda-runtime-wrappers.cpp

LINK_LIBS
LLVMSupport
${CUDA_RUNTIME_LIBRARY}
)
target_include_directories(cuda-runtime-wrappers
PRIVATE ${CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES}
LLVMSupport
)
target_link_libraries(cuda-runtime-wrappers
LLVMSupport
${CUDA_RUNTIME_LIBRARY}
)

get_property(dialect_libs GLOBAL PROPERTY MLIR_DIALECT_LIBS)
get_property(conversion_libs GLOBAL PROPERTY MLIR_CONVERSION_LIBS)
Expand Down Expand Up @@ -68,10 +68,8 @@ if(MLIR_CUDA_RUNNER_ENABLED)

add_llvm_tool(mlir-cuda-runner
mlir-cuda-runner.cpp

DEPENDS
cuda-runtime-wrappers
)
)
add_dependencies(mlir-cuda-runner cuda-runtime-wrappers)
target_include_directories(mlir-cuda-runner
PRIVATE ${CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES}
)
Expand Down
7 changes: 3 additions & 4 deletions mlir/tools/mlir-opt/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,11 @@ set(LIB_LIBS
MLIRPass
MLIRTransforms
MLIRSupport
LLVMSupport
)
)
add_llvm_library(MLIRMlirOptMain
mlir-opt.cpp

LINK_LIBS
)
target_link_libraries(MLIRMlirOptMain
${LIB_LIBS}
)

Expand Down
5 changes: 1 addition & 4 deletions mlir/unittests/Dialect/SPIRV/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,8 @@ add_mlir_unittest(MLIRSPIRVTests
)
target_link_libraries(MLIRSPIRVTests
PRIVATE
MLIRIR
MLIRSPIRV
MLIRSPIRVSerialization
MLIRStandardOps
MLIRSupport)
MLIRSPIRVSerialization)

whole_archive_link(MLIRSPIRVTests MLIRSPIRV)

5 changes: 1 addition & 4 deletions mlir/unittests/Pass/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,4 @@ add_mlir_unittest(MLIRPassTests
)
target_link_libraries(MLIRPassTests
PRIVATE
MLIRIR
MLIRPass
MLIRStandardOps
MLIRSupport)
MLIRPass)
5 changes: 1 addition & 4 deletions mlir/unittests/SDBM/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@ add_mlir_unittest(MLIRSDBMTests
)
target_link_libraries(MLIRSDBMTests
PRIVATE
MLIRIR
MLIRSDBM
MLIRStandardOps
MLIRSupport
)
)
whole_archive_link(MLIRSDBMTests MLIRSDBM)