From 109d917dda7f369266f3449c086eff242037485f Mon Sep 17 00:00:00 2001 From: Milan Topalovic <163355844+mtopalovicTT@users.noreply.github.com> Date: Sat, 21 Dec 2024 11:45:38 +0100 Subject: [PATCH] Fixing missing libs for debug build (#1656) Change e748e713afe6556b988f3fcf2797a34e6a151759 introduced Debug build brake. Debug build fails with: ``` /usr/bin/ld: /usr/bin/ld: DWARF error: invalid or unhandled FORM value: 0x23 lib/libMLIRTTIRPipelines.a(TTIRPipelines.cpp.o): in function `mlir::tt::ttir::createLinalgToLLVMPipeline(mlir::OpPassManager&, mlir::tt::ttir::LinalgToLLVMPipelineOptions const&)': TTIRPipelines.cpp:(.text+0x50): undefined reference to `mlir::createConvertElementwiseToLinalgPass()' /usr/bin/ld: TTIRPipelines.cpp:(.text+0x7d): undefined reference to `mlir::createConvertTensorToLinalgPass()' /usr/bin/ld: TTIRPipelines.cpp:(.text+0x118): undefined reference to `mlir::bufferization::buildBufferDeallocationPipeline(mlir::OpPassManager&, mlir::bufferization::BufferDeallocationPipelineOptions const&)' /usr/bin/ld: TTIRPipelines.cpp:(.text+0x12f): undefined reference to `mlir::createBufferizationToMemRefPass()' /usr/bin/ld: TTIRPipelines.cpp:(.text+0x165): undefined reference to `mlir::createConvertLinalgToLoopsPass()' /usr/bin/ld: TTIRPipelines.cpp:(.text+0x19b): undefined reference to `mlir::memref::createExpandStridedMetadataPass()' /usr/bin/ld: TTIRPipelines.cpp:(.text+0x1d1): undefined reference to `mlir::createConvertSCFToCFPass()' /usr/bin/ld: TTIRPipelines.cpp:(.text+0x207): undefined reference to `mlir::createConvertControlFlowToLLVMPass()' /usr/bin/ld: TTIRPipelines.cpp:(.text+0x23d): undefined reference to `mlir::createArithToLLVMConversionPass()' /usr/bin/ld: TTIRPipelines.cpp:(.text+0x273): undefined reference to `mlir::createConvertFuncToLLVMPass()' /usr/bin/ld: TTIRPipelines.cpp:(.text+0x2a9): undefined reference to `mlir::createFinalizeMemRefToLLVMConversionPass()' /usr/bin/ld: TTIRPipelines.cpp:(.text+0x2df): undefined reference to `mlir::createReconcileUnrealizedCastsPass()' clang++-17: error: linker command failed with exit code 1 (use -v to see invocation) ``` This PR adds missing libs. I've checked build times and executable sizes with added libs. There is couple of seconds added to build time. Size of binary increase is negligible. Regardless there is no other way we have to include these libs. ## With this change Debug build time: 72 sec Debug executable size: * opt - 961MB * translate - 679MB Release build time: 81 sec Release executable size: * opt - 881MB * translate - 634MB ## With e748e713afe6556b988f3fcf2797a34e6a151759 reverted Debug build time: 75sec Debug executable size: * opt - 953MB * translate - 679MB Release build time: 73 sec Release executable size: * opt 873MB * translate 634MB --- lib/Dialect/TTIR/Pipelines/CMakeLists.txt | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lib/Dialect/TTIR/Pipelines/CMakeLists.txt b/lib/Dialect/TTIR/Pipelines/CMakeLists.txt index 9c7f7bb77..26598eea2 100644 --- a/lib/Dialect/TTIR/Pipelines/CMakeLists.txt +++ b/lib/Dialect/TTIR/Pipelines/CMakeLists.txt @@ -6,6 +6,17 @@ add_mlir_dialect_library(MLIRTTIRPipelines ${MLIR_MAIN_INCLUDE_DIR}/mlir/Conversion/ArithToLLVM LINK_LIBS PUBLIC + MLIRLinalgTransforms + MLIRArithToLLVM + MLIRBufferizationPipelines + MLIRBufferizationToMemRef + MLIRControlFlowToLLVM + MLIRFuncToLLVM + MLIRMemRefToLLVM + MLIRMemRefTransforms + MLIRReconcileUnrealizedCasts + MLIRSCFToControlFlow + MLIRTensorToLinalg MLIRTTIRDialect MLIRPass MLIRTransforms