From bc7b2ed1720655b904356aaf06c726ce8d0a95e5 Mon Sep 17 00:00:00 2001 From: xddxd Date: Mon, 26 Sep 2022 17:06:43 +0300 Subject: [PATCH] Quick hack for Zen 4, more Zen 3 detection --- lib/Support/Host.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/Support/Host.cpp b/lib/Support/Host.cpp index bc773c59ff2..b96e9c5547c 100644 --- a/lib/Support/Host.cpp +++ b/lib/Support/Host.cpp @@ -1038,9 +1038,15 @@ getAMDProcessorTypeAndSubtype(unsigned Family, unsigned Model, } break; case 25: + if (testFeature(X86::FEATURE_AVX512VBMI2)) { + CPU = "icelake-client"; + *Type = X86::INTEL_COREI7; + *Subtype = X86::INTEL_COREI7_ICELAKE_CLIENT; + break; // Treat Zen 4 as Ice Lake for AVX512 + } CPU = "znver3"; *Type = X86::AMDFAM19H; - if (Model <= 0x0f) { + if (Model <= 0x0f || Model == 0x21) { *Subtype = X86::AMDFAM19H_ZNVER3; break; // 00h-0Fh: Zen3 }