[Mlir-commits] [mlir] [mlir][ArmNeon] Enable native I8MM integration testing on Darwin (PR #216098)
Federico Bruzzone
llvmlistbot at llvm.org
Thu Aug 13 23:53:02 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] [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 \
More information about the Mlir-commits
mailing list