public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/llvm] rawhide: Disable MLIR's execution engine on RISC-V
@ 2026-09-10 13:50 Tulio Magno Quites Machado Filho
  0 siblings, 0 replies; only message in thread
From: Tulio Magno Quites Machado Filho @ 2026-09-10 13:50 UTC (permalink / raw)
  To: git-commits

            A new commit has been pushed.

            Repo   : rpms/llvm
            Branch : rawhide
            Commit : d9a6abeb832b76a7b8c0e291cba4638d67ddb223
            Author : Tulio Magno Quites Machado Filho <tuliom@redhat.com>
            Date   : 2026-09-10T10:49:44-03:00
            Stats  : +75/-6 in 2 file(s)
            URL    : https://src.fedoraproject.org/rpms/llvm/c/d9a6abeb832b76a7b8c0e291cba4638d67ddb223?branch=rawhide

            Log:
            Disable MLIR's execution engine on RISC-V

There is an issue upstream [1] prevening MLIR's JIT from executing well
on RISC-V. This causes many MLIR tests to fail.
Disable the execution engine in order to not distribute broken software
to users.

[1] https://github.com/llvm/llvm-project/issues/162655

---
diff --git a/0001-mlir-Disable-some-tests-when-the-execution-engine-is.patch b/0001-mlir-Disable-some-tests-when-the-execution-engine-is.patch
new file mode 100644
index 0000000..c6716e3
--- /dev/null
+++ b/0001-mlir-Disable-some-tests-when-the-execution-engine-is.patch
@@ -0,0 +1,40 @@
+From de4153554a6100d978ac7a0ba49adf0b2aca8e1f Mon Sep 17 00:00:00 2001
+From: Tulio Magno Quites Machado Filho <tuliom@redhat.com>
+Date: Wed, 2 Sep 2026 18:37:19 -0300
+Subject: [PATCH] [mlir] Disable some tests when the execution engine is
+ disabled
+
+It's possible to have a scenario where the native target is enabled, but
+the execution engine is not, e.g. when trying to avoid an issue with the
+execution engine.
+
+In that case, we need to disable the tests that depend on: mlir-runner,
+mlir_async_runtime, mlir-capi-execution-engine-test,
+mlir-capi-global-constructors-test, mlir_c_runner_utils,
+mlir_runner_utils and mlir_float16_utils.
+---
+ mlir/test/CMakeLists.txt | 7 ++++++-
+ 1 file changed, 6 insertions(+), 1 deletion(-)
+
+diff --git a/mlir/test/CMakeLists.txt b/mlir/test/CMakeLists.txt
+index 689565cccf97..1603f03558ee 100644
+--- a/mlir/test/CMakeLists.txt
++++ b/mlir/test/CMakeLists.txt
+@@ -170,8 +170,13 @@ set(MLIR_TEST_DEPENDS ${MLIR_TEST_DEPENDS}
+ # useless binaries.
+ if(LLVM_ENABLE_PIC AND TARGET ${LLVM_NATIVE_ARCH})
+   list(APPEND MLIR_TEST_DEPENDS
+-    mlir-runner
+     llc
++  )
++endif()
++# The native target may be available but the execution engine may not.
++if(LLVM_ENABLE_PIC AND MLIR_ENABLE_EXECUTION_ENGINE)
++  list(APPEND MLIR_TEST_DEPENDS
++    mlir-runner
+     mlir_async_runtime
+     mlir-capi-execution-engine-test
+     mlir-capi-global-constructors-test
+-- 
+2.54.0
+

diff --git a/llvm.spec b/llvm.spec
index 117c86c..6976e90 100644
--- a/llvm.spec
+++ b/llvm.spec
@@ -103,6 +103,14 @@
 %bcond_with mlir
 %endif
 
+%ifarch riscv64
+# MLIR Execution Engine doesn't quite work on riscv64, see:
+# https://github.com/llvm/llvm-project/issues/162655
+%global mlir_jit OFF
+%else
+%global mlir_jit ON
+%endif
+
 #region flang
 %if %{without compat_build} && %{defined fedora} && 0%{?fedora} >= 44
 # Link error on i686.
@@ -614,6 +622,11 @@ Patch2105: 43cb4631c1f42dbfce78288b8ae30b5840ed59b3.patch
 # Fix for s390x vector miscompilation (rhbz#2430017)
 Patch2106: 0001-SystemZ-Fix-code-in-widening-vector-multiplication-1.patch
 
+# Disable tests when the execution engine is disabled.
+# https://github.com/llvm/llvm-project/pull/220741
+Patch2203: 0001-mlir-Disable-some-tests-when-the-execution-engine-is.patch
+Patch2301: 0001-mlir-Disable-some-tests-when-the-execution-engine-is.patch
+
 # Fix an illegal zext from combined loads (rhbz#2512927)
 # https://github.com/llvm/llvm-project/pull/207229
 Patch2207: 0001-AggressiveInstCombine-Fix-crash-when-folding-consecu.patch
@@ -1832,8 +1845,8 @@ popd
         -DMLIR_INCLUDE_INTEGRATION_TESTS:BOOL=OFF \\\
         -DMLIR_INSTALL_AGGREGATE_OBJECTS=OFF \\\
         -DMLIR_BUILD_MLIR_C_DYLIB=ON \\\
-        -DMLIR_ENABLE_BINDINGS_PYTHON:BOOL=ON
-
+        -DMLIR_ENABLE_BINDINGS_PYTHON:BOOL=%{mlir_jit} \\\
+        -DMLIR_ENABLE_EXECUTION_ENGINE:BOOL=%{mlir_jit}
 %endif
 #endregion mlir options
 
@@ -2136,8 +2149,10 @@ cd $OLD_CWD
 %if %{with mlir}
 %cmake_build --target libMLIR.so
 %cmake_build --target libMLIR-C.so
+%if "%{mlir_jit}" == "ON"
 %cmake_build --target libMLIRPythonCAPI.so
 %endif
+%endif
 
 %cmake_build
 
@@ -2469,7 +2484,7 @@ ln -vsf "../../../${liblldb}" %{buildroot}%{python3_sitearch}/lldb/_lldb.so
 #endregion LLDB installation
 
 #region mlir installation
-%if %{with mlir}
+%if %{with mlir} && "%{mlir_jit}" == "ON"
 mkdir -p %{buildroot}/%{python3_sitearch}
 mv %{buildroot}%{install_prefix}/python_packages/mlir_core/mlir %{buildroot}/%{python3_sitearch}
 # These directories should be empty now.
@@ -3899,6 +3914,10 @@ fi
 %files -n %{pkg_name_mlir}
 %license LICENSE.TXT
 %{expand_libs %{expand:
+    libMLIR*.so.%{maj_ver}*
+}}
+%if "%{mlir_jit}" == "ON"
+%{expand_libs %{expand:
     libmlir_apfloat_wrappers.so.%{maj_ver}*
     libmlir_arm_runner_utils.so.%{maj_ver}*
     libmlir_arm_sme_abi_stubs.so.%{maj_ver}*
@@ -3906,8 +3925,8 @@ fi
     libmlir_c_runner_utils.so.%{maj_ver}*
     libmlir_float16_utils.so.%{maj_ver}*
     libmlir_runner_utils.so.%{maj_ver}*
-    libMLIR*.so.%{maj_ver}*
 }}
+%endif
 
 %files -n %{pkg_name_mlir}-static
 %expand_libs libMLIR*.a
@@ -3922,12 +3941,16 @@ fi
     mlir-query
     mlir-reduce
     mlir-rewrite
-    mlir-runner
     mlir-tblgen
     mlir-translate
     tblgen-lsp-server
     tblgen-to-irdl
 }}
+%if "%{mlir_jit}" == "ON"
+%{expand_bins %{expand:
+    mlir-runner
+}}
+%endif
 %if %{maj_ver} >= 23
 %{expand_bins %{expand:
     mlir-irdl-to-cpp
@@ -3937,6 +3960,10 @@ fi
 %expand_includes mlir mlir-c
 %{expand_libs %{expand:
     cmake/mlir
+    libMLIR*.so
+}}
+%if "%{mlir_jit}" == "ON"
+%{expand_libs %{expand:
     libmlir_apfloat_wrappers.so
     libmlir_arm_runner_utils.so
     libmlir_arm_sme_abi_stubs.so
@@ -3944,12 +3971,14 @@ fi
     libmlir_c_runner_utils.so
     libmlir_float16_utils.so
     libmlir_runner_utils.so
-    libMLIR*.so
 }}
+%endif
 
+%if "%{mlir_jit}" == "ON"
 %files -n python%{python3_pkgversion}-%{pkg_name_mlir}
 %{python3_sitearch}/mlir/
 %endif
+%endif
 #endregion MLIR files
 
 #region flang files

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-09-10 13:50 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-10 13:50 [rpms/llvm] rawhide: Disable MLIR's execution engine on RISC-V Tulio Magno Quites Machado Filho

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox