From 747fc0efaad9438b5f4714845fb6d6960e4d0d60 Mon Sep 17 00:00:00 2001 From: Ani Date: Thu, 4 Nov 2021 17:28:24 +0000 Subject: [PATCH] lib/Support: Detect AVX-512 on Alderlake CPUs --- lib/Support/Host.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/Support/Host.cpp b/lib/Support/Host.cpp index 7d61b4f41e8..cfbf5765dd5 100644 --- a/lib/Support/Host.cpp +++ b/lib/Support/Host.cpp @@ -777,13 +777,21 @@ getIntelProcessorTypeAndSubtype(unsigned Family, unsigned Model, case 0x8d: CPU = "tigerlake"; *Type = X86::INTEL_COREI7; + *Subtype = X86::INTEL_COREI7_TIGERLAKE; break; // Alderlake: case 0x97: case 0x9a: - CPU = "alderlake"; *Type = X86::INTEL_COREI7; + // Alderlake has AVX-512 when the E-cores are disabled + if (testFeature(X86::FEATURE_AVX512VBMI2)) { + CPU = "rocketlake"; + *Subtype = X86::INTEL_COREI7_ROCKETLAKE; + } else { + CPU = "alderlake"; + *Subtype = X86::INTEL_COREI7_ALDERLAKE; + } break; // Icelake Xeon: