Skip to content

Commit

Permalink
CMake: Remove unnecessary dependencies on LLVM/MLIR (llvm#110362)
Browse files Browse the repository at this point in the history
There are some spurious libraries which can be removed.

I'm trying to bundle MLIR/LLVM library dependencies for our own
libraries. We're utilizing cmake function to recursively collect
MLIR/LLVM related dependencies. However, we identified certain library
dependencies as redundant and safe for removal.
  • Loading branch information
Adnios authored and VitaNuo committed Oct 2, 2024
1 parent 7caa5fa commit c8303ec
Show file tree
Hide file tree
Showing 21 changed files with 1 addition and 50 deletions.
1 change: 0 additions & 1 deletion llvm/lib/MC/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ add_llvm_component_library(LLVMMC
Support
TargetParser
BinaryFormat
DebugInfoCodeView

DEPENDS
intrinsics_gen
Expand Down
1 change: 0 additions & 1 deletion mlir/lib/Conversion/ConvertToLLVM/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ add_mlir_conversion_library(MLIRConvertToLLVMPass
MLIRConversionPassIncGen

LINK_LIBS PUBLIC
MLIRConvertToLLVMInterface
MLIRIR
MLIRLLVMCommonConversion
MLIRLLVMDialect
Expand Down
2 changes: 0 additions & 2 deletions mlir/lib/Conversion/VectorToLLVM/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ add_mlir_conversion_library(MLIRVectorToLLVMPass
LINK_LIBS PUBLIC
MLIRVectorToLLVM

MLIRArmNeonDialect
MLIRArmSMEDialect
MLIRArmSVEDialect
MLIRArmSVETransforms
MLIRAMXDialect
Expand Down
1 change: 0 additions & 1 deletion mlir/lib/Dialect/Affine/Transforms/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ add_mlir_dialect_library(MLIRAffineTransforms
MLIRIR
MLIRMemRefDialect
MLIRPass
MLIRSCFUtils
MLIRSideEffectInterfaces
MLIRTensorDialect
MLIRTransformUtils
Expand Down
2 changes: 0 additions & 2 deletions mlir/lib/Dialect/Arith/Transforms/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ add_mlir_dialect_library(MLIRArithTransforms
LINK_LIBS PUBLIC
MLIRAnalysis
MLIRArithDialect
MLIRBufferizationDialect
MLIRBufferizationTransforms
MLIRFuncDialect
MLIRFuncTransforms
MLIRInferIntRangeInterface
Expand Down
2 changes: 0 additions & 2 deletions mlir/lib/Dialect/Func/Transforms/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ add_mlir_dialect_library(MLIRFuncTransforms
MLIRFuncTransformsIncGen

LINK_LIBS PUBLIC
MLIRBufferizationDialect
MLIRBufferizationTransforms
MLIRFuncDialect
MLIRIR
MLIRMemRefDialect
Expand Down
2 changes: 0 additions & 2 deletions mlir/lib/Dialect/GPU/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,7 @@ add_mlir_dialect_library(MLIRGPUTransforms
MLIRPass
MLIRSCFDialect
MLIRSideEffectInterfaces
MLIRSPIRVTarget
MLIRSupport
MLIRROCDLTarget
MLIRTransformUtils
MLIRVectorDialect
)
Expand Down
2 changes: 0 additions & 2 deletions mlir/lib/Dialect/Linalg/IR/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,12 @@ add_mlir_dialect_library(MLIRLinalgDialect
MLIRInferTypeOpInterface
MLIRIR
MLIRParser
MLIRShardingInterface
MLIRSideEffectInterfaces
MLIRSparseTensorDialect
MLIRSCFDialect
MLIRMathDialect
MLIRMemRefDialect
MLIRTensorDialect
MLIRTilingInterface
MLIRValueBoundsOpInterface
MLIRViewLikeInterface
)
8 changes: 0 additions & 8 deletions mlir/lib/Dialect/Linalg/Transforms/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,11 @@ add_mlir_dialect_library(MLIRLinalgTransforms

LINK_LIBS PUBLIC
MLIRAffineDialect
MLIRAffineTransforms
MLIRAffineUtils
MLIRAnalysis
MLIRArithDialect
MLIRArithTransforms
MLIRArithUtils
MLIRBufferizationDialect
MLIRBufferizationTransforms
MLIRComplexDialect
MLIRDestinationStyleOpInterface
MLIRDialectUtils
Expand All @@ -66,20 +63,15 @@ add_mlir_dialect_library(MLIRLinalgTransforms
MLIRIR
MLIRMemRefDialect
MLIRMemRefTransforms
MLIRMeshDialect
MLIRMeshTransforms
MLIRLinalgDialect
MLIRLinalgUtils
MLIRSCFDialect
MLIRSCFTransforms
MLIRSCFUtils
MLIRPass
MLIRShardingInterface
MLIRSubsetOpInterface
MLIRSparseTensorDialect
MLIRTensorDialect
MLIRTensorTilingInterfaceImpl
MLIRTensorTransforms
MLIRTransforms
MLIRTransformUtils
MLIRValueBoundsOpInterface
Expand Down
3 changes: 0 additions & 3 deletions mlir/lib/Dialect/MemRef/Transforms/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,10 @@ add_mlir_dialect_library(MLIRMemRefTransforms
MLIRMemRefPassIncGen

LINK_LIBS PUBLIC
MLIRAffineDialect
MLIRAffineTransforms
MLIRAffineUtils
MLIRArithDialect
MLIRArithTransforms
MLIRBufferizationDialect
MLIRBufferizationTransforms
MLIRDialectUtils
MLIRFuncDialect
MLIRGPUDialect
Expand Down
2 changes: 0 additions & 2 deletions mlir/lib/Dialect/Mesh/Transforms/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ add_mlir_dialect_library(MLIRMeshTransforms
MLIRIR
MLIRMeshDialect
MLIRPass
MLIRShardingInterface
MLIRSupport
MLIRTensorDialect
MLIRTosaShardingInterfaceImpl
)
4 changes: 0 additions & 4 deletions mlir/lib/Dialect/SCF/Transforms/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ add_mlir_dialect_library(MLIRSCFTransforms
MLIRAffineDialect
MLIRAffineAnalysis
MLIRArithDialect
MLIRBufferizationDialect
MLIRBufferizationTransforms
MLIRDestinationStyleOpInterface
MLIRDialectUtils
MLIRIR
Expand All @@ -40,9 +38,7 @@ add_mlir_dialect_library(MLIRSCFTransforms
MLIRSCFUtils
MLIRSideEffectInterfaces
MLIRSupport
MLIRTensorDialect
MLIRTensorTransforms
MLIRTilingInterface
MLIRTransforms
MLIRTransformUtils
)
4 changes: 0 additions & 4 deletions mlir/lib/Dialect/Tensor/Transforms/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,9 @@ add_mlir_dialect_library(MLIRTensorTransforms

LINK_LIBS PUBLIC
MLIRAffineDialect
MLIRAffineTransforms
MLIRAffineUtils
MLIRArithDialect
MLIRArithUtils
MLIRBufferizationDialect
MLIRBufferizationTransforms
MLIRDialectUtils
MLIRIR
MLIRLinalgDialect
Expand All @@ -35,7 +32,6 @@ add_mlir_dialect_library(MLIRTensorTransforms
MLIRSubsetOpInterface
MLIRTensorDialect
MLIRTensorUtils
MLIRTilingInterface
MLIRTransforms
MLIRVectorDialect
MLIRVectorUtils
Expand Down
3 changes: 0 additions & 3 deletions mlir/lib/Dialect/Tosa/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ add_mlir_dialect_library(MLIRTosaDialect
MLIRDialect
MLIRCallInterfaces
MLIRControlFlowInterfaces
MLIRQuantDialect
MLIRQuantUtils
MLIRSideEffectInterfaces
MLIRTensorDialect
Expand All @@ -35,10 +34,8 @@ add_mlir_dialect_library(MLIRTosaShardingInterfaceImpl

LINK_LIBS PUBLIC
MLIRIR
MLIRMeshDialect
MLIRShardingInterface
MLIRSupport
MLIRTosaDialect
)

add_subdirectory(Transforms)
2 changes: 0 additions & 2 deletions mlir/lib/Dialect/Vector/Transforms/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ add_mlir_dialect_library(MLIRVectorTransforms
MLIRAffineAnalysis
MLIRAffineUtils
MLIRArithDialect
MLIRBufferizationDialect
MLIRBufferizationTransforms
MLIRDialectUtils
MLIRGPUDialect
MLIRIR
Expand Down
1 change: 0 additions & 1 deletion mlir/lib/Target/LLVM/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,6 @@ add_mlir_dialect_library(MLIRROCDLTarget
MLIRSupport
MLIRGPUDialect
MLIRTargetLLVM
MLIRROCDLToLLVMIRTranslation
)

if(MLIR_ENABLE_ROCM_CONVERSIONS)
Expand Down
2 changes: 0 additions & 2 deletions mlir/lib/Target/LLVMIR/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ add_mlir_translation_library(MLIRTargetLLVMIRExport
MLIRDLTIDialect
MLIRLLVMDialect
MLIRLLVMIRTransforms
MLIRTranslateLib
MLIRTransformUtils
)

Expand Down Expand Up @@ -79,7 +78,6 @@ add_mlir_translation_library(MLIRTargetLLVMIRImport
LINK_LIBS PUBLIC
MLIRDLTIDialect
MLIRLLVMDialect
MLIRTranslateLib
)

add_mlir_translation_library(MLIRFromLLVMIRTranslationRegistration
Expand Down
4 changes: 0 additions & 4 deletions mlir/lib/Target/SPIRV/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ add_mlir_translation_library(MLIRSPIRVBinaryUtils

LINK_LIBS PUBLIC
MLIRIR
MLIRSPIRVDialect
MLIRSupport
)

Expand All @@ -21,11 +20,9 @@ add_mlir_translation_library(MLIRSPIRVTranslateRegistration

LINK_LIBS PUBLIC
MLIRIR
MLIRSPIRVDialect
MLIRSPIRVSerialization
MLIRSPIRVDeserialization
MLIRSupport
MLIRTranslateLib
)

add_mlir_dialect_library(MLIRSPIRVTarget
Expand All @@ -34,7 +31,6 @@ add_mlir_dialect_library(MLIRSPIRVTarget
LINK_LIBS PUBLIC
MLIRIR
MLIRGPUDialect
MLIRSPIRVDialect
MLIRSPIRVSerialization
MLIRSupport
)
3 changes: 0 additions & 3 deletions mlir/lib/Target/SPIRV/Serialization/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,7 @@ add_mlir_translation_library(MLIRSPIRVSerialization

LINK_LIBS PUBLIC
MLIRIR
MLIRSPIRVDialect
MLIRSPIRVBinaryUtils
MLIRSupport
MLIRTranslateLib
)


1 change: 0 additions & 1 deletion mlir/lib/Transforms/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ add_mlir_library(MLIRTransforms

LINK_LIBS PUBLIC
MLIRAnalysis
MLIRCopyOpInterface
MLIRFunctionInterfaces
MLIRLoopLikeInterface
MLIRMemorySlotInterfaces
Expand Down
1 change: 1 addition & 0 deletions mlir/unittests/Target/LLVM/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ target_link_libraries(MLIRTargetLLVMTests
MLIRNVVMToLLVMIRTranslation
MLIRROCDLToLLVMIRTranslation
MLIRGPUToLLVMIRTranslation
MLIRParser
${llvm_libs}
)

Expand Down

0 comments on commit c8303ec

Please sign in to comment.