[llvm] [AArch64] Improve host feature detection. (PR #160410)

Eli Friedman via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 22 11:01:47 PDT 2025


================
@@ -2260,20 +2260,80 @@ StringMap<bool> sys::getHostCPUFeatures() {
   uint32_t Sha2 = CAP_SHA1 | CAP_SHA2;
   Features["aes"] = (crypto & Aes) == Aes;
   Features["sha2"] = (crypto & Sha2) == Sha2;
+
+  // SVE support is disabled in for cores which are identified as supporting
+  // SVE; disable SVE if we don't detect support at runtime.
+  if (!Features.contains("sve"))
+    Features["sve"] = false;
----------------
efriedma-quic wrote:

We should probably have better detection for features generally, but other features are unlikely to trigger misdetection based on the detected CPU.  Usually the only features that get disabled are SVE and cryptography.

I think disabling aes should disable sveaes.

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


More information about the llvm-commits mailing list