[Mlir-commits] [mlir] [mlir][test] Make SME e2e tests require an emulator (PR #86489)

Cullen Rhodes llvmlistbot at llvm.org
Thu Mar 28 02:31:06 PDT 2024


c-rhodes wrote:

> > I don't know how to reliably query hardware,
> 
> Have cmake compile an input file, run it, and check the result?

There's an example in compiler-rt [1] checking if the host compiler supports SME, perhaps could use the same input/test but compile and run with CMake `try_run` [2] instead?

There's also the `__builtin_cpu_supports` builtin [3] which could be used in the input/test, but not sure how well supported that is. It seems for GCC it's implemented for x86 [4] but not AArch64 [5]. Host toolchain support can be queried with `__has_builtin(__builtin_cpu_supports)` as [3] mentions.

[1] https://github.com/llvm/llvm-project/blob/8d77d362af6ade32f087c051fe4774a3891f6ec9/compiler-rt/cmake/builtin-config-ix.cmake#L39-L45
[2] https://cmake.org/cmake/help/latest/command/try_run.html#command:try_run
[3] https://clang.llvm.org/docs/LanguageExtensions.html#builtin-cpu-supports
[4] https://gcc.gnu.org/onlinedocs/gcc/x86-Built-in-Functions.html#index-_005f_005fbuiltin_005fcpu_005fsupports-1
[5] https://gcc.gnu.org/onlinedocs/gcc/AArch64-Built-in-Functions.html




https://github.com/llvm/llvm-project/pull/86489


More information about the Mlir-commits mailing list