[all-commits] [llvm/llvm-project] d7cbef: [MLIR] Fixes for shared library dependencies.

stephenneuendorffer via All-commits all-commits at lists.llvm.org
Tue Feb 4 08:56:41 PST 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: d7cbef2714c98f91eb1556ed414aa9e6719bbac3
      https://github.com/llvm/llvm-project/commit/d7cbef2714c98f91eb1556ed414aa9e6719bbac3
  Author: Stephen Neuendorffer <stephen.neuendorffer at xilinx.com>
  Date:   2020-02-04 (Tue, 04 Feb 2020)

  Changed paths:
    M mlir/cmake/modules/AddMLIR.cmake
    M mlir/lib/Analysis/CMakeLists.txt
    M mlir/lib/Conversion/AffineToStandard/CMakeLists.txt
    M mlir/lib/Conversion/GPUToNVVM/CMakeLists.txt
    M mlir/lib/Conversion/GPUToROCDL/CMakeLists.txt
    M mlir/lib/Conversion/LinalgToLLVM/CMakeLists.txt
    M mlir/lib/Conversion/LinalgToSPIRV/CMakeLists.txt
    M mlir/lib/Conversion/LoopsToGPU/CMakeLists.txt
    M mlir/lib/Conversion/VectorToLLVM/CMakeLists.txt
    M mlir/lib/Conversion/VectorToLoops/CMakeLists.txt
    M mlir/lib/Dialect/FxpMathOps/CMakeLists.txt
    M mlir/lib/Dialect/GPU/CMakeLists.txt
    M mlir/lib/Dialect/LLVMIR/CMakeLists.txt
    M mlir/lib/Dialect/Linalg/IR/CMakeLists.txt
    M mlir/lib/Dialect/LoopOps/CMakeLists.txt
    M mlir/lib/Dialect/OpenMP/CMakeLists.txt
    M mlir/lib/Dialect/QuantOps/CMakeLists.txt
    M mlir/lib/Dialect/SPIRV/Serialization/CMakeLists.txt
    M mlir/lib/Dialect/VectorOps/CMakeLists.txt
    M mlir/lib/EDSC/CMakeLists.txt
    M mlir/lib/ExecutionEngine/CMakeLists.txt
    M mlir/lib/Quantizer/CMakeLists.txt
    M mlir/lib/Support/CMakeLists.txt
    M mlir/test/Dialect/SPIRV/CMakeLists.txt
    M mlir/test/lib/IR/CMakeLists.txt
    M mlir/test/lib/TestDialect/CMakeLists.txt
    M mlir/test/lib/Transforms/CMakeLists.txt
    M mlir/tools/mlir-opt/CMakeLists.txt

  Log Message:
  -----------
  [MLIR] Fixes for shared library dependencies.

Summary:

This patch is a step towards enabling BUILD_SHARED_LIBS=on, which
builds most libraries as DLLs instead of statically linked libraries.
The main effect of this is that incremental build times are greatly
reduced, since usually only one library need be relinked in response
to isolated code changes.

The bulk of this patch is fixing incorrect usage of cmake, where library
dependencies are listed under add_dependencies rather than under
target_link_libraries or under the LINK_LIBS tag.  Correct usage should be
like this:

add_dependencies(MLIRfoo MLIRfooIncGen)
target_link_libraries(MLIRfoo MLIRlib1 MLIRlib2)

A separate issue is that in cmake, dependencies between static libraries
are automatically included in dependencies.  In the above example, if MLIBlib1
depends on MLIRlib2, then it is sufficient to have only MLIRlib1 in the
target_link_libraries.  When compiling with shared libraries, it is necessary
to have both MLIRlib1 and MLIRlib2 specified if MLIRfoo uses symbols from both.

Reviewers: mravishankar, antiagainst, nicolasvasilache, vchuravy, inouehrs, mehdi_amini, jdoerfert

Reviewed By: nicolasvasilache, mehdi_amini

Subscribers: Joonsoo, merge_guards_bot, jholewinski, mgorny, mehdi_amini, rriddle, jpienaar, burmako, shauheen, antiagainst, csigg, arpith-jacob, mgester, lucyrfox, herhut, aartbik, liufengdb, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D73653




More information about the All-commits mailing list