[all-commits] [llvm/llvm-project] 4594d0: [MLIR] Move from add_dependencies() to DEPENDS

stephenneuendorffer via All-commits all-commits at lists.llvm.org
Fri Mar 6 13:25:25 PST 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 4594d0e943b641a3e4d18f8ab66413e59149ed0a
      https://github.com/llvm/llvm-project/commit/4594d0e943b641a3e4d18f8ab66413e59149ed0a
  Author: Stephen Neuendorffer <stephen.neuendorffer at xilinx.com>
  Date:   2020-03-06 (Fri, 06 Mar 2020)

  Changed paths:
    M mlir/examples/toy/Ch2/CMakeLists.txt
    M mlir/examples/toy/Ch3/CMakeLists.txt
    M mlir/examples/toy/Ch4/CMakeLists.txt
    M mlir/examples/toy/Ch5/CMakeLists.txt
    M mlir/examples/toy/Ch6/CMakeLists.txt
    M mlir/examples/toy/Ch7/CMakeLists.txt
    M mlir/lib/Analysis/CMakeLists.txt
    M mlir/lib/Conversion/GPUToNVVM/CMakeLists.txt
    M mlir/lib/Conversion/GPUToSPIRV/CMakeLists.txt
    M mlir/lib/Conversion/StandardToSPIRV/CMakeLists.txt
    M mlir/lib/Dialect/AffineOps/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/Transforms/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/CMakeLists.txt
    M mlir/lib/Dialect/SPIRV/Serialization/CMakeLists.txt
    M mlir/lib/Dialect/StandardOps/CMakeLists.txt
    M mlir/lib/Dialect/VectorOps/CMakeLists.txt
    M mlir/lib/IR/CMakeLists.txt
    M mlir/lib/Quantizer/CMakeLists.txt
    M mlir/lib/Transforms/CMakeLists.txt
    M mlir/lib/Transforms/Utils/CMakeLists.txt
    M mlir/test/lib/TestDialect/CMakeLists.txt
    M mlir/test/lib/Transforms/CMakeLists.txt
    M mlir/tools/mlir-cuda-runner/CMakeLists.txt

  Log Message:
  -----------
  [MLIR] Move from add_dependencies() to DEPENDS

add_llvm_library and add_llvm_executable may need to create new targets with
appropriate dependencies.  As a result, it is not sufficient in some
configurations (namely LLVM_BUILD_LLVM_DYLIB=on) to only call
add_dependencies().  Instead, the explicit TableGen dependencies must
be passed to add_llvm_library() or add_llvm_executable() using the DEPENDS
keyword.

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


  Commit: 7c64f6bf5286088c5373c43ecbaf6e59e4ebe10c
      https://github.com/llvm/llvm-project/commit/7c64f6bf5286088c5373c43ecbaf6e59e4ebe10c
  Author: Valentin Churavy <v.churavy at gmail.com>
  Date:   2020-03-06 (Fri, 06 Mar 2020)

  Changed paths:
    M mlir/CMakeLists.txt
    M mlir/cmake/modules/AddMLIR.cmake
    M mlir/lib/Analysis/CMakeLists.txt
    M mlir/lib/Dialect/CMakeLists.txt
    M mlir/lib/EDSC/CMakeLists.txt
    M mlir/lib/ExecutionEngine/CMakeLists.txt
    M mlir/lib/IR/CMakeLists.txt
    M mlir/lib/Parser/CMakeLists.txt
    M mlir/lib/Pass/CMakeLists.txt
    M mlir/lib/Quantizer/CMakeLists.txt
    M mlir/lib/Support/CMakeLists.txt
    M mlir/lib/Target/CMakeLists.txt
    M mlir/lib/Transforms/CMakeLists.txt
    M mlir/lib/Transforms/Utils/CMakeLists.txt
    M mlir/lib/Translation/CMakeLists.txt
    M mlir/tools/CMakeLists.txt
    M mlir/tools/mlir-opt/CMakeLists.txt
    A mlir/tools/mlir-shlib/CMakeLists.txt
    A mlir/tools/mlir-shlib/mlir-shlib.cpp

  Log Message:
  -----------
  [MLIR] Add support for libMLIR.so

Putting this up mainly for discussion on
how this should be done. I am interested in MLIR from
the Julia side and we currently have a strong preference
to dynamically linking against the LLVM shared library,
and would like to have a MLIR shared library.

This patch adds a new cmake function add_mlir_library()
which accumulates a list of targets to be compiled into
libMLIR.so.  Note that not all libraries make sense to
be compiled into libMLIR.so.  In particular, we want
to avoid libraries which primarily exist to support
certain tools (such as mlir-opt and mlir-cpu-runner).

Note that the resulting libMLIR.so depends on LLVM, but
does not contain any LLVM components.  As a result, it
is necessary to link with libLLVM.so to avoid linkage
errors. So, libMLIR.so requires LLVM_BUILD_LLVM_DYLIB=on

FYI, Currently it appears that LLVM_LINK_LLVM_DYLIB is broken
because mlir-tblgen is linked against libLLVM.so and
and independent LLVM components.

Previous version of this patch broke depencies on TableGen
targets.  This appears to be because it compiled all
libraries to OBJECT libraries (probably because cmake
is generating different target names).  Avoiding object
libraries results in correct dependencies.

(updated by Stephen Neuendorffer)

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


  Commit: 9f979d7ad5d107a9dc35bb8792a3192ee78aae1d
      https://github.com/llvm/llvm-project/commit/9f979d7ad5d107a9dc35bb8792a3192ee78aae1d
  Author: Stephen Neuendorffer <stephen.neuendorffer at xilinx.com>
  Date:   2020-03-06 (Fri, 06 Mar 2020)

  Changed paths:
    M mlir/examples/toy/Ch5/CMakeLists.txt
    M mlir/examples/toy/Ch6/CMakeLists.txt
    M mlir/lib/Analysis/CMakeLists.txt
    M mlir/lib/Conversion/GPUToCUDA/CMakeLists.txt
    M mlir/lib/Conversion/GPUToVulkan/CMakeLists.txt
    M mlir/lib/Dialect/CMakeLists.txt
    M mlir/lib/Dialect/LLVMIR/CMakeLists.txt
    M mlir/lib/Dialect/LoopOps/Transforms/CMakeLists.txt
    M mlir/lib/Dialect/StandardOps/CMakeLists.txt
    M mlir/lib/Dialect/VectorOps/CMakeLists.txt
    M mlir/test/SDBM/CMakeLists.txt
    M mlir/test/lib/TestDialect/CMakeLists.txt
    M mlir/tools/mlir-cpu-runner/CMakeLists.txt

  Log Message:
  -----------
  [MLIR] Fixes for BUILD_SHARED_LIBS=on

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


Compare: https://github.com/llvm/llvm-project/compare/6d894afdea43...9f979d7ad5d1


More information about the All-commits mailing list