From ba5828ebf4f58e23928fe0ed4c0d44cabd233026 Mon Sep 17 00:00:00 2001 From: Tom Stellard Date: Fri, 25 Aug 2017 18:57:14 +0000 Subject: [PATCH] Backport r291084 (rhbz1435545) --- ...stCPUName-to-report-Intel-model-0x4e.patch | 58 +++++++++++++++++++ llvm.spec | 7 ++- 2 files changed, 64 insertions(+), 1 deletion(-) create mode 100644 0001-X86-Change-getHostCPUName-to-report-Intel-model-0x4e.patch diff --git a/0001-X86-Change-getHostCPUName-to-report-Intel-model-0x4e.patch b/0001-X86-Change-getHostCPUName-to-report-Intel-model-0x4e.patch new file mode 100644 index 0000000..373ed26 --- /dev/null +++ b/0001-X86-Change-getHostCPUName-to-report-Intel-model-0x4e.patch @@ -0,0 +1,58 @@ +From 6974a461b485113b4e6c6ffc668b8fbc9ce45c6e Mon Sep 17 00:00:00 2001 +From: Craig Topper +Date: Thu, 5 Jan 2017 05:47:29 +0000 +Subject: [PATCH] [X86] Change getHostCPUName to report Intel model 0x4e as + "skylake" instead of "skylake-avx512". Add the proper 0x55 model for + "skylake-avx512". + +Summary: +Intel's i5-6300U CPU is reporting to have a model id of 78 (4e). +The Host detection assumes that to be Skylake Xeon (with AVX512 support), +instead of a normal Skylake machine. + +Patch by: Valentin Churavy + +Reviewers: nalimilan, craig.topper + +Subscribers: hfinkel, tkelman, craig.topper, nalimilan, llvm-commits + +Differential Revision: https://reviews.llvm.org/D28221 + +git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291084 91177308-0d34-0410-b5e6-96231b3b80d8 +--- + lib/Support/Host.cpp | 14 +++++++++++--- + 1 file changed, 11 insertions(+), 3 deletions(-) + +diff --git a/lib/Support/Host.cpp b/lib/Support/Host.cpp +index 49d0ed5..7593cfc 100644 +--- a/lib/Support/Host.cpp ++++ b/lib/Support/Host.cpp +@@ -475,14 +475,22 @@ getIntelProcessorTypeAndSubtype(unsigned int Family, unsigned int Model, + + // Skylake: + case 0x4e: +- *Type = INTEL_COREI7; // "skylake-avx512" +- *Subtype = INTEL_COREI7_SKYLAKE_AVX512; +- break; + case 0x5e: + *Type = INTEL_COREI7; // "skylake" + *Subtype = INTEL_COREI7_SKYLAKE; + break; + ++ // Skylake Xeon: ++ case 0x55: ++ *Type = INTEL_COREI7; ++ // Check that we really have AVX512 ++ if (Features & (1 << FEATURE_AVX512)) { ++ *Subtype = INTEL_COREI7_SKYLAKE_AVX512; // "skylake-avx512" ++ } else { ++ *Subtype = INTEL_COREI7_SKYLAKE; // "skylake" ++ } ++ break; ++ + case 0x1c: // Most 45 nm Intel Atom processors + case 0x26: // 45 nm Atom Lincroft + case 0x27: // 32 nm Atom Medfield +-- +1.8.3.1 + diff --git a/llvm.spec b/llvm.spec index 1cf98fa..becb407 100644 --- a/llvm.spec +++ b/llvm.spec @@ -7,7 +7,7 @@ Name: llvm Version: 3.9.1 -Release: 4%{?dist} +Release: 5%{?dist} Summary: The Low Level Virtual Machine License: NCSA @@ -29,6 +29,8 @@ Patch6: llvm-r294646.patch Patch7: 0001-Revert-Merging-r280589.patch # https://reviews.llvm.org/D27609 Patch8: 0001-Fix-R_AARCH64_MOVW_UABS_G3-relocation.patch +# rhbz1435545 +Patch9: 0001-X86-Change-getHostCPUName-to-report-Intel-model-0x4e.patch # backports cribbed from https://github.com/rust-lang/llvm/ Patch47: rust-lang-llvm-pr47.patch @@ -227,6 +229,9 @@ fi %{_libdir}/*.a %changelog +* Fri Aug 25 2017 Tom Stellard - 3.9.1-5 +- Backport r291084 (rhbz1435545) + * Thu Aug 24 2017 tstellar@redhat.com - 3.9.1-4 - Fix %postun step for -devel package (rhbz 1403539).