llvm-core/mlir: Add 23.1.0_rc2

Signed-off-by: Michał Górny <mgorny@gentoo.org>
This commit is contained in:
Michał Górny
2026-07-28 16:43:39 +02:00
parent a632e5ab22
commit cf2740c08e
2 changed files with 234 additions and 0 deletions

View File

@@ -3,4 +3,6 @@ DIST llvm-project-21.1.8.src.tar.xz 158958576 BLAKE2B 0d3d4ee920f8e5db50e9815261
DIST llvm-project-21.1.8.src.tar.xz.sig 119 BLAKE2B cffc1825f5778a3e3c128ec3e856ff6ee50687319d621cdf42e895abf67e05cc51cb7493308e2b506ab60dbdbaca7aa75eb9f78d91d42c81f9682a36f4042e9d SHA512 10f58eff58ed6e701d0f123b15e68c82ab8cbdf99b1c86c0d83e3b8553e90ea51055e30327e8e442ded57c8f503e2a2de9ee075e9c28b5ba815a0f8922f8671c
DIST llvm-project-22.1.8.src.tar.xz 167061596 BLAKE2B 092204f62e0f0364a041c737eb2c25fd073cb5689663d6ccd5a9e4e1743d6d80822360d59b64bff7b4d7872a68a79e899bf2f75f384e55c7d313a79243576f03 SHA512 2615b20ba08534f83ab8ecc7b5ba43b5f1dfcf9cdb2534a32fcdbf0ccdd9a008b46276e45ef26ed9377f65b5e4ae89ea798f3863fd034484b5715140f3a7b35c
DIST llvm-project-22.1.8.src.tar.xz.sig 119 BLAKE2B 2ce93472036e68782252991e4a8bdbeeec8706a56022220083a38a42ef18714a7894c41aaa04dc0d03f18601d8bfc1a5a030ed0ef0f0d64a662eae9843a4b362 SHA512 99a457b5b1fb409a5fe72b59ebd4ddae5cade3e5f2493e33b44d4f4b4625f7a1743f80106efb1134668842b15ea3400ce2c29263bec8ff986e05040910125e15
DIST llvm-project-23.1.0-rc2.src.tar.xz 179079292 BLAKE2B 59b4ae719ca496b29e37c1150d2953062d00d696e847d16710b6719c63246cccfb50c6f6bf33e7723e2e3757c8b1cae51a3c6a6787b6d45c808c78902ac01c97 SHA512 9ca8d0aa34f2910abc06edb832831c1a66209e7e78cffabcc52113fe0d6d96af57f4f67788ae23026c0f3b91dc8f6224cb46dfa0f1bcc41a1f60cbad5ec1623d
DIST llvm-project-23.1.0-rc2.src.tar.xz.sig 466 BLAKE2B c7acaa7f8833286cd0037c4c31ba8a1bb20f4a09b62979c7df9f69993728406b1a42db62d2ab2a34c526c0bdae1bc027074a623142420d2fc264c3f83e3c0f7b SHA512 7e2db57ed17efe3bf36c476049973b760af60c8a9302992a17e050e7a61db7b92df0b6c06f26989c61ce2e4682e7604bfdd0f063e322a726923e857890cedc8c
DIST llvm-project-bb9934d4dfef9033ded36d26827dbb6d3ac1dd92.tar.gz 277566365 BLAKE2B 401320655d19b3d430d15a48e2daf1f00567ef87fd2d1f86c3d505a1b2f5920db6cbfa620bf1b0561cd318d6046830d5b19fe0e7b58647863372c6c96526526c SHA512 354b901ca80227abe6b0514eeba437f237ea2658dd1927bb6e1d3b0b298bdb0dfdb7855c0f359eea4977dd344f6d0f6d1ce486ea0100d4a5615a9139ef198fca

View File

@@ -0,0 +1,232 @@
# Copyright 1999-2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
PYTHON_COMPAT=( python3_{11..14} )
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
# this test is completely unpredictable, no clue why
rm test/mlir-pdll-lsp-server/view-output.test || 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)
;;
MLIROpenACCTestPasses)
;;
# 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_apfloat_wrappers
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
MLIROpenACCTestPasses
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=()
case ${ABI} in
arm|ppc|x86)
known_xfail+=(
# MLIR is full of 64-bit assumptions, sigh
# https://github.com/llvm/llvm-project/issues/124541
Dialect/Bufferization/Transforms/one-shot-bufferize-pass-statistics.mlir
Dialect/LLVMIR/sroa-statistics.mlir
Dialect/Linalg/vectorize-tensor-extract.mlir
Dialect/MemRef/mem2reg-statistics.mlir
Dialect/Tensor/fold-tensor-subset-ops.mlir
Dialect/Tensor/tracking-listener.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
}