Skip to content

Commit

Permalink
Fixing missing libs for debug build (#1656)
Browse files Browse the repository at this point in the history
Change e748e71 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 e748e71 reverted
Debug build time: 75sec
Debug executable size:
* opt - 953MB
* translate - 679MB

Release build time: 73 sec
Release executable size:
* opt 873MB
* translate 634MB
  • Loading branch information
mtopalovicTT authored Dec 21, 2024
1 parent 52528e9 commit 109d917
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions lib/Dialect/TTIR/Pipelines/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 109d917

Please sign in to comment.