From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 3232D1581EE for ; Sat, 05 Apr 2025 12:24:15 +0000 (UTC) Received: from lists.gentoo.org (bobolink.gentoo.org [140.211.166.189]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) (Authenticated sender: relay-lists.gentoo.org@gentoo.org) by smtp.gentoo.org (Postfix) with ESMTPSA id 13E4F3432F7 for ; Sat, 05 Apr 2025 12:24:15 +0000 (UTC) Received: from bobolink.gentoo.org (localhost [127.0.0.1]) by bobolink.gentoo.org (Postfix) with ESMTP id 5C9B11104BA; Sat, 05 Apr 2025 12:24:06 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by bobolink.gentoo.org (Postfix) with ESMTPS id 532A31104BA for ; Sat, 05 Apr 2025 12:24:06 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 01A0A3432BB for ; Sat, 05 Apr 2025 12:24:06 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 1D2A52777 for ; Sat, 05 Apr 2025 12:24:03 +0000 (UTC) From: "Michał Górny" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Michał Górny" Message-ID: <1743855823.13b706d9d5715ccc194f9242673b079cdf38f66f.mgorny@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: llvm-core/mlir/ X-VCS-Repository: repo/gentoo X-VCS-Files: llvm-core/mlir/Manifest llvm-core/mlir/mlir-21.0.0_pre20250405.ebuild X-VCS-Directories: llvm-core/mlir/ X-VCS-Committer: mgorny X-VCS-Committer-Name: Michał Górny X-VCS-Revision: 13b706d9d5715ccc194f9242673b079cdf38f66f X-VCS-Branch: master Date: Sat, 05 Apr 2025 12:24:03 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 4539d0d1-90f1-4581-99c1-8051f618708b X-Archives-Hash: b2c909b1cd6264fe84daf0ff238a21f0 commit: 13b706d9d5715ccc194f9242673b079cdf38f66f Author: Michał Górny gentoo org> AuthorDate: Sat Apr 5 10:51:32 2025 +0000 Commit: Michał Górny gentoo org> CommitDate: Sat Apr 5 12:23:43 2025 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=13b706d9 llvm-core/mlir: Add 21.0.0_pre20250405 snapshot Signed-off-by: Michał Górny gentoo.org> llvm-core/mlir/Manifest | 1 + llvm-core/mlir/mlir-21.0.0_pre20250405.ebuild | 247 ++++++++++++++++++++++++++ 2 files changed, 248 insertions(+) diff --git a/llvm-core/mlir/Manifest b/llvm-core/mlir/Manifest index 1fe3ff455123..251d138dbd00 100644 --- a/llvm-core/mlir/Manifest +++ b/llvm-core/mlir/Manifest @@ -1,3 +1,4 @@ DIST llvm-project-1c3a9a853ce68c3c539e7cab21380b9d8b18f426.tar.gz 229448743 BLAKE2B c1eacc2ed05c460f56cf83f16b982e3fa4ac530483d7cf003034239aff3b3dbffbdd3042a3f295a83ec94fcf32f802714e4937fd3761a5e03d4ed1b4093e81bf SHA512 98b7e9fa330a6fce33ca9757caf5d2e41d0b73117cb24b2aed880274c2d6f8a8c1a0028dd0e773fa42deb61dbe3b9dd4fb2f44e50814b966fcdeae8e5b417e6d DIST llvm-project-1d133420dc512487e2be0e9d86755f2a7c3497a7.tar.gz 229268288 BLAKE2B aca79bcca631deeab429a03cd2732d78d8ecf0c9615bce181445ed875436806609dc85a57d4f97109492833d620d060ea93fed450a4912c2d94597aeabf84974 SHA512 24ecadfccdf785bfbf27d5007afd2a4d5868493b2c5f48d6cf07c335bfbfef5cba4f12a639971e5f95877ae3b8c7b7fc0c210e404d21036af553de82a5059037 DIST llvm-project-21eeca3db0341fef4ab4a6464ffe38b2eba5810c.tar.gz 229546432 BLAKE2B e783f08b93498b252741a07fd3aa3383ca93f66688f9bbdb2e11185c660dfff1020ab4a1ca803ab69ab28dc2fd8b5c3855f45c0b77851b8e6edeb0dc5bf6cbd4 SHA512 54420956b36f3bccabea2171a4103ca20d6b136e1d1f7f217e0ec735be4542bbd840ef228c55f3e9103ad2f9fb41393e611d5aaa1521d01fdd163b770b80ba0b +DIST llvm-project-f3e6473df46fd920e09e06e57a5549eb8e3a8bd3.tar.gz 229893133 BLAKE2B 20a14a99fb55070c30b05298916875d7f7b5476bc47c72f675204adb62daf1126bc83f2e7e51867042cb0ea415f04ef32653118116d01f666a82dc888fb6e999 SHA512 f11eac15fc1d96232267d588fa1c41ebbff3367b1fccf1cfd43f3290f682b73ffa78f2336a2a155c41ef67cf4e6f43019b152996d790f03acf4b9b732a3cf4b7 diff --git a/llvm-core/mlir/mlir-21.0.0_pre20250405.ebuild b/llvm-core/mlir/mlir-21.0.0_pre20250405.ebuild new file mode 100644 index 000000000000..eeedc760dbcb --- /dev/null +++ b/llvm-core/mlir/mlir-21.0.0_pre20250405.ebuild @@ -0,0 +1,247 @@ +# Copyright 1999-2025 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +PYTHON_COMPAT=( python3_{10..13} ) +inherit cmake llvm.org multilib-minimal python-any-r1 + +DESCRIPTION="Multi-Level Intermediate Representation (library only)" +HOMEPAGE="https://mlir.llvm.org/" + +LICENSE="Apache-2.0-with-LLVM-exceptions" +SLOT="${LLVM_MAJOR}/${LLVM_SOABI}" +IUSE="+debug test" +RESTRICT="!test? ( test )" + +DEPEND=" + ~llvm-core/llvm-${PV}[debug=,${MULTILIB_USEDEP}] +" +RDEPEND=" + ${DEPEND} +" +BDEPEND=" + ${PYTHON_DEPS} + llvm-core/llvm:${LLVM_MAJOR} + test? ( + $(python_gen_any_dep 'dev-python/lit[${PYTHON_USEDEP}]') + ) +" + +LLVM_COMPONENTS=( mlir cmake ) +# tablegen tests use *.td files there +LLVM_TEST_COMPONENTS=( llvm/include ) +llvm.org_set_globals + +python_check_deps() { + if use test; then + python_has_version "dev-python/lit[${PYTHON_USEDEP}]" + fi +} + +src_prepare() { + llvm.org_src_prepare + + # https://github.com/llvm/llvm-project/issues/120902 + sed -i -e '/LINK_LIBS/s:PUBLIC:PRIVATE:' \ + lib/ExecutionEngine/CMakeLists.txt || die +} + +check_distribution_components() { + if [[ ${CMAKE_MAKEFILE_GENERATOR} == ninja ]]; then + local all_targets=() my_targets=() l + cd "${BUILD_DIR}" || die + + while read -r l; do + if [[ ${l} == install-*-stripped:* ]]; then + l=${l#install-} + l=${l%%-stripped*} + + case ${l} in + # meta-targets + mlir-libraries|distribution) + continue + ;; + # dylib + MLIR) + ;; + # installed test libraries + MLIRTestAnalysis|MLIRTestDialect|MLIRTestIR) + ;; + # static libraries + MLIR*) + continue + ;; + esac + + all_targets+=( "${l}" ) + fi + done < <(${NINJA} -t targets all) + + while read -r l; do + my_targets+=( "${l}" ) + done < <(get_distribution_components $"\n") + + local add=() remove=() + for l in "${all_targets[@]}"; do + if ! has "${l}" "${my_targets[@]}"; then + add+=( "${l}" ) + fi + done + for l in "${my_targets[@]}"; do + if ! has "${l}" "${all_targets[@]}"; then + remove+=( "${l}" ) + fi + done + + if [[ ${#add[@]} -gt 0 || ${#remove[@]} -gt 0 ]]; then + eqawarn "get_distribution_components() is outdated!" + eqawarn " Add: ${add[*]}" + eqawarn "Remove: ${remove[*]}" + fi + cd - >/dev/null || die + fi +} + +get_distribution_components() { + local sep=${1-;} + + local out=( + mlir-cmake-exports + mlir-headers + + # the dylib + MLIR + + # shared libraries + mlir_arm_runner_utils + mlir_arm_sme_abi_stubs + mlir_async_runtime + mlir_c_runner_utils + mlir_float16_utils + mlir_runner_utils + + # test libraries required by flang + MLIRTestAnalysis + MLIRTestDialect + MLIRTestIR + ) + + if multilib_is_native_abi; then + out+=( + # tools + mlir-linalg-ods-yaml-gen + mlir-lsp-server + mlir-opt + mlir-pdll + mlir-pdll-lsp-server + mlir-query + mlir-reduce + mlir-rewrite + mlir-runner + mlir-tblgen + mlir-translate + tblgen-lsp-server + tblgen-to-irdl + ) + fi + + printf "%s${sep}" "${out[@]}" +} + +multilib_src_configure() { + local mycmakeargs=( + -DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}" + -DLLVM_ROOT="${ESYSROOT}/usr/lib/llvm/${LLVM_MAJOR}" + + -DBUILD_SHARED_LIBS=OFF + # this controls building libMLIR.so + -DLLVM_BUILD_LLVM_DYLIB=ON + -DMLIR_BUILD_MLIR_C_DYLIB=OFF + -DMLIR_LINK_MLIR_DYLIB=ON + -DMLIR_INCLUDE_TESTS=ON + -DMLIR_INCLUDE_INTEGRATION_TESTS=OFF + -DLLVM_DISTRIBUTION_COMPONENTS=$(get_distribution_components) + # this enables installing mlir-tblgen and mlir-pdll + -DLLVM_BUILD_UTILS=ON + + -DPython3_EXECUTABLE="${PYTHON}" + + -DLLVM_BUILD_TOOLS=ON + # TODO + -DMLIR_ENABLE_CUDA_RUNNER=0 + -DMLIR_ENABLE_ROCM_RUNNER=0 + -DMLIR_ENABLE_SYCL_RUNNER=0 + -DMLIR_ENABLE_SPIRV_CPU_RUNNER=0 + -DMLIR_ENABLE_VULKAN_RUNNER=0 + -DMLIR_ENABLE_BINDINGS_PYTHON=0 + -DMLIR_INSTALL_AGGREGATE_OBJECTS=OFF + ) + use test && mycmakeargs+=( + -DLLVM_EXTERNAL_LIT="${EPREFIX}/usr/bin/lit" + -DLLVM_LIT_ARGS="$(get_lit_flags)" + ) + + # LLVM_ENABLE_ASSERTIONS=NO does not guarantee this for us, #614844 + use debug || local -x CPPFLAGS="${CPPFLAGS} -DNDEBUG" + cmake_src_configure + + multilib_is_native_abi && check_distribution_components +} + +multilib_src_compile() { + cmake_build distribution +} + +multilib_src_test() { + local known_xfail=( + # TODO: Gentoo-specific + # https://github.com/llvm/llvm-project/issues/124410 + Dialect/SPIRV/IR/availability.mlir + Dialect/SPIRV/IR/target-env.mlir + ) + + case ${ABI} in + arm|ppc|x86) + known_xfail+=( + # MLIR is full of 64-bit assumptions, sigh + # https://github.com/llvm/llvm-project/issues/124541 + Conversion/ConvertToSPIRV/func-signature-vector-unroll.mlir + Conversion/ConvertToSPIRV/vector-unroll.mlir + Conversion/MathToLibm/convert-to-libm.mlir + Conversion/MemRefToLLVM/memref-to-llvm.mlir + Conversion/VectorToLLVM/vector-to-llvm.mlir + Dialect/ArmSVE/legalize-for-llvm.mlir + Dialect/Bufferization/Transforms/one-shot-bufferize-pass-statistics.mlir + Dialect/GPU/transform-gpu.mlir + Dialect/LLVMIR/sroa-statistics.mlir + Dialect/Linalg/mesh-spmdization.mlir + Dialect/Linalg/vectorize-tensor-extract.mlir + Dialect/Math/polynomial-approximation.mlir + Dialect/MemRef/expand-strided-metadata.mlir + Dialect/MemRef/fold-memref-alias-ops.mlir + Dialect/MemRef/mem2reg-statistics.mlir + Dialect/Mesh/all-scatter-op-lowering.mlir + Dialect/Tensor/fold-tensor-subset-ops.mlir + Dialect/Tensor/tracking-listener.mlir + Dialect/Vector/canonicalize.mlir + Dialect/Vector/vector-bitcast-lowering-transforms.mlir + Dialect/Vector/vector-deinterleave-lowering-transforms.mlir + Dialect/Vector/vector-interleave-lowering-transforms.mlir + Dialect/Vector/vector-unroll-options.mlir + Pass/pipeline-stats-nested.mlir + Pass/pipeline-stats.mlir + ) + ;; + esac + + # respect TMPDIR! + local -x LIT_PRESERVES_TMP=1 + local -x LIT_XFAIL="${known_xfail[*]}" + LIT_XFAIL=${LIT_XFAIL// /;} + cmake_build check-mlir +} + +multilib_src_install() { + DESTDIR=${D} cmake_build install-distribution +}