[Mlir-commits] [mlir] [mlir][ArmNeon] Enable native I8MM integration testing on Darwin (PR #216098)
Federico Bruzzone
llvmlistbot at llvm.org
Tue Aug 18 11:05:22 PDT 2026
https://github.com/FedericoBruzzone updated https://github.com/llvm/llvm-project/pull/216098
>From 20580fb344400c5ef549d9559c61f9ead703ffd9 Mon Sep 17 00:00:00 2001
From: Federico Bruzzone <federico.bruzzone.i at gmail.com>
Date: Thu, 13 Aug 2026 17:57:58 +0200
Subject: [PATCH 1/3] [mlir][ArmNeon] Enable native I8MM integration testing on
Darwin
Signed-off-by: Federico Bruzzone <federico.bruzzone.i at gmail.com>
---
.../modules/MLIRCheckHardwareFeatures.cmake | 31 +++++++++++++++++--
.../CPU/ArmNeon/vector-contract-i8mm.mlir | 2 --
2 files changed, 29 insertions(+), 4 deletions(-)
diff --git a/mlir/cmake/modules/MLIRCheckHardwareFeatures.cmake b/mlir/cmake/modules/MLIRCheckHardwareFeatures.cmake
index 3aea591d885f7..00555c0b53ced 100644
--- a/mlir/cmake/modules/MLIRCheckHardwareFeatures.cmake
+++ b/mlir/cmake/modules/MLIRCheckHardwareFeatures.cmake
@@ -26,6 +26,31 @@ function(check_sme_support_on_darwin output)
set(${output} ${local_result} PARENT_SCOPE)
endfunction(check_sme_support_on_darwin)
+# Checks whether I8MM is supported by the host Darwin (macOS) system. This is
+# implemented via `sysctl`, since Darwin has no equivalent of Linux's
+# auxiliary vector feature bits (hwcap).
+#
+# check_i8mm_support_on_darwin(
+# output_var
+# )
+function(check_i8mm_support_on_darwin output)
+ execute_process(
+ COMMAND sysctl -n hw.optional.arm.FEAT_I8MM
+ OUTPUT_VARIABLE sysctl_output
+ OUTPUT_STRIP_TRAILING_WHITESPACE
+ ERROR_QUIET
+ RESULT_VARIABLE sysctl_result
+ )
+
+ if(sysctl_result EQUAL 0 AND sysctl_output STREQUAL "1")
+ set(local_result TRUE)
+ else()
+ set(local_result FALSE)
+ endif()
+ message(STATUS "Checking whether I8MM is supported by the host system (via sysctl hw.optional.arm.FEAT_I8MM): ${local_result}")
+ set(${output} ${local_result} PARENT_SCOPE)
+endfunction(check_i8mm_support_on_darwin)
+
# Checks whether the specified hardware capability is supported by the host
# Linux system. This is implemented by checking auxiliary vector feature
# provided by the Linux kernel.
@@ -115,9 +140,11 @@ function(check_emulator mlir_e2e_tests hwcap_spec emulator_exec)
if(APPLE AND hwcap_spec STREQUAL "HWCAP2_SME")
check_sme_support_on_darwin(emulator_not_required)
+ elseif(APPLE AND hwcap_spec STREQUAL "HWCAP2_I8MM")
+ check_i8mm_support_on_darwin(emulator_not_required)
elseif(APPLE)
- # No Darwin mapping for anything other than SME (yet); conservatively
- # assume an emulator is required.
+ # No Darwin mapping for anything else (yet); conservatively assume an
+ # emulator is required.
set(emulator_not_required FALSE)
else()
check_hwcap(${hwcap_spec} emulator_not_required)
diff --git a/mlir/test/Integration/Dialect/Vector/CPU/ArmNeon/vector-contract-i8mm.mlir b/mlir/test/Integration/Dialect/Vector/CPU/ArmNeon/vector-contract-i8mm.mlir
index f6012bbd3d0b2..dd96dbae2a09e 100644
--- a/mlir/test/Integration/Dialect/Vector/CPU/ArmNeon/vector-contract-i8mm.mlir
+++ b/mlir/test/Integration/Dialect/Vector/CPU/ArmNeon/vector-contract-i8mm.mlir
@@ -1,5 +1,3 @@
-// REQUIRES: arm-emulator
-
// DEFINE: %{compile} = mlir-opt %s \
// DEFINE: --convert-vector-to-scf --convert-scf-to-cf --convert-vector-to-llvm='enable-arm-neon enable-arm-i8mm' \
// DEFINE: --expand-strided-metadata --convert-to-llvm --finalize-memref-to-llvm \
>From a973fcf42deeb474f9ce75642f5c312384449737 Mon Sep 17 00:00:00 2001
From: Federico Bruzzone <federico.bruzzone.i at gmail.com>
Date: Tue, 18 Aug 2026 01:29:00 +0200
Subject: [PATCH 2/3] Address comments
Signed-off-by: Federico Bruzzone <federico.bruzzone.i at gmail.com>
---
.../Dialect/Vector/CPU/ArmNeon/vector-contract-i8mm.mlir | 2 ++
1 file changed, 2 insertions(+)
diff --git a/mlir/test/Integration/Dialect/Vector/CPU/ArmNeon/vector-contract-i8mm.mlir b/mlir/test/Integration/Dialect/Vector/CPU/ArmNeon/vector-contract-i8mm.mlir
index dd96dbae2a09e..b4dbc664f7ed9 100644
--- a/mlir/test/Integration/Dialect/Vector/CPU/ArmNeon/vector-contract-i8mm.mlir
+++ b/mlir/test/Integration/Dialect/Vector/CPU/ArmNeon/vector-contract-i8mm.mlir
@@ -1,3 +1,5 @@
+// REQUIRES: mlir_arm_i8mm_tests
+
// DEFINE: %{compile} = mlir-opt %s \
// DEFINE: --convert-vector-to-scf --convert-scf-to-cf --convert-vector-to-llvm='enable-arm-neon enable-arm-i8mm' \
// DEFINE: --expand-strided-metadata --convert-to-llvm --finalize-memref-to-llvm \
>From 0226c8a1918ae201bb366d5d03ab4544b6d96a34 Mon Sep 17 00:00:00 2001
From: Federico Bruzzone <federico.bruzzone.i at gmail.com>
Date: Tue, 18 Aug 2026 20:04:34 +0200
Subject: [PATCH 3/3] Address comment
Signed-off-by: Federico Bruzzone <federico.bruzzone.i at gmail.com>
---
mlir/cmake/modules/MLIRCheckHardwareFeatures.cmake | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/mlir/cmake/modules/MLIRCheckHardwareFeatures.cmake b/mlir/cmake/modules/MLIRCheckHardwareFeatures.cmake
index 00555c0b53ced..567fbdb9d93ee 100644
--- a/mlir/cmake/modules/MLIRCheckHardwareFeatures.cmake
+++ b/mlir/cmake/modules/MLIRCheckHardwareFeatures.cmake
@@ -121,8 +121,8 @@ endfunction(check_hwcap)
# emulator_exec
# )
#
-# mlir_e2e_tests - MLIR CMake variables corresponding to the group of e2e tests
-# to check
+# mlir_e2e_tests - Name of the MLIR CMake variable to gate on; also used to
+# name the flag in the error message below.
# hwcap_spec - HWCAP value to check. This should correspond to the hardware
# capabilities required by the tests to be checked. Possible
# values are defined in hwcap.h in the Linux kernel.
More information about the Mlir-commits
mailing list