[all-commits] [llvm/llvm-project] 7a6c68: [MLIR] Move from using target_link_libraries to LI...

stephenneuendorffer via All-commits all-commits at lists.llvm.org
Sat Feb 29 10:53:40 PST 2020


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

  Changed paths:
    M mlir/examples/toy/Ch6/CMakeLists.txt
    M mlir/examples/toy/Ch7/CMakeLists.txt
    M mlir/lib/Analysis/CMakeLists.txt
    M mlir/lib/Conversion/AffineToStandard/CMakeLists.txt
    M mlir/lib/Conversion/GPUToCUDA/CMakeLists.txt
    M mlir/lib/Conversion/GPUToNVVM/CMakeLists.txt
    M mlir/lib/Conversion/GPUToROCDL/CMakeLists.txt
    M mlir/lib/Conversion/GPUToSPIRV/CMakeLists.txt
    M mlir/lib/Conversion/LinalgToLLVM/CMakeLists.txt
    M mlir/lib/Conversion/LinalgToSPIRV/CMakeLists.txt
    M mlir/lib/Conversion/LoopToStandard/CMakeLists.txt
    M mlir/lib/Conversion/LoopsToGPU/CMakeLists.txt
    M mlir/lib/Conversion/StandardToLLVM/CMakeLists.txt
    M mlir/lib/Conversion/StandardToSPIRV/CMakeLists.txt
    M mlir/lib/Conversion/VectorToLLVM/CMakeLists.txt
    M mlir/lib/Conversion/VectorToLoops/CMakeLists.txt
    M mlir/lib/Dialect/AffineOps/CMakeLists.txt
    M mlir/lib/Dialect/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/Analysis/CMakeLists.txt
    M mlir/lib/Dialect/Linalg/EDSC/CMakeLists.txt
    M mlir/lib/Dialect/Linalg/IR/CMakeLists.txt
    M mlir/lib/Dialect/Linalg/Transforms/CMakeLists.txt
    M mlir/lib/Dialect/Linalg/Utils/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/SDBM/CMakeLists.txt
    M mlir/lib/Dialect/SPIRV/CMakeLists.txt
    M mlir/lib/Dialect/SPIRV/Serialization/CMakeLists.txt
    M mlir/lib/Dialect/SPIRV/Transforms/CMakeLists.txt
    M mlir/lib/Dialect/StandardOps/CMakeLists.txt
    M mlir/lib/Dialect/VectorOps/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/TableGen/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/test/EDSC/CMakeLists.txt
    M mlir/test/lib/Dialect/SPIRV/CMakeLists.txt
    M mlir/test/lib/IR/CMakeLists.txt
    M mlir/test/lib/Pass/CMakeLists.txt
    M mlir/test/lib/TestDialect/CMakeLists.txt
    M mlir/test/lib/Transforms/CMakeLists.txt
    M mlir/test/mlir-cpu-runner/CMakeLists.txt
    M mlir/tools/mlir-cuda-runner/CMakeLists.txt
    M mlir/tools/mlir-opt/CMakeLists.txt
    M mlir/unittests/Dialect/SPIRV/CMakeLists.txt
    M mlir/unittests/Pass/CMakeLists.txt
    M mlir/unittests/SDBM/CMakeLists.txt

  Log Message:
  -----------
  [MLIR] Move from using target_link_libraries to LINK_LIBS for llvm libraries.

When compiling libLLVM.so, add_llvm_library() manipulates the link libraries
being used.  This means that when using add_llvm_library(), we need to pass
the list of libraries to be linked (using the LINK_LIBS keyword) instead of
using the standard target_link_libraries call.  This is preparation for
properly dealing with creating libMLIR.so as well.

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


  Commit: c4c8fbde649af8359cbfcbb5cef90fbe195c16fc
      https://github.com/llvm/llvm-project/commit/c4c8fbde649af8359cbfcbb5cef90fbe195c16fc
  Author: Stephen Neuendorffer <stephen.neuendorffer at xilinx.com>
  Date:   2020-02-29 (Sat, 29 Feb 2020)

  Changed paths:
    M mlir/lib/Analysis/CMakeLists.txt
    M mlir/lib/Conversion/AffineToStandard/CMakeLists.txt
    M mlir/lib/Conversion/LoopToStandard/CMakeLists.txt
    M mlir/lib/Conversion/LoopsToGPU/CMakeLists.txt
    M mlir/lib/Conversion/StandardToLLVM/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/Analysis/CMakeLists.txt
    M mlir/lib/Dialect/Linalg/EDSC/CMakeLists.txt
    M mlir/lib/Dialect/Linalg/IR/CMakeLists.txt
    M mlir/lib/Dialect/Linalg/Transforms/CMakeLists.txt
    M mlir/lib/Dialect/Linalg/Utils/CMakeLists.txt
    M mlir/lib/Dialect/LoopOps/CMakeLists.txt
    M mlir/lib/Dialect/QuantOps/CMakeLists.txt
    M mlir/lib/Dialect/SDBM/CMakeLists.txt
    M mlir/lib/Dialect/StandardOps/CMakeLists.txt
    M mlir/lib/EDSC/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/test/lib/IR/CMakeLists.txt

  Log Message:
  -----------
  [MLIR] Remove redundant library dependencies

In cmake, it is redundant to have a target list under target_link_libraries()
and add_dependency().  This patch removes the redundant dependency from
add_dependency().

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


  Commit: 31e07d716a083b85df226c31f6ba72bc477f58fc
      https://github.com/llvm/llvm-project/commit/31e07d716a083b85df226c31f6ba72bc477f58fc
  Author: Stephen Neuendorffer <stephen.neuendorffer at xilinx.com>
  Date:   2020-02-29 (Sat, 29 Feb 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: e17d9c11d49ab42ec19620679e981bb6147a2856
      https://github.com/llvm/llvm-project/commit/e17d9c11d49ab42ec19620679e981bb6147a2856
  Author: Valentin Churavy <v.churavy at gmail.com>
  Date:   2020-02-29 (Sat, 29 Feb 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: 777e97cc1a8c1fe44245bdcb4fd9386ae2b3cc9d
      https://github.com/llvm/llvm-project/commit/777e97cc1a8c1fe44245bdcb4fd9386ae2b3cc9d
  Author: Stephen Neuendorffer <stephen.neuendorffer at xilinx.com>
  Date:   2020-02-29 (Sat, 29 Feb 2020)

  Changed paths:
    M mlir/examples/toy/Ch5/CMakeLists.txt
    M mlir/examples/toy/Ch6/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/LoopOps/Transforms/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/07aa9ae23b8e...777e97cc1a8c


More information about the All-commits mailing list