diff options
-rw-r--r-- | llvm/lib/Support/Host.cpp | 6 | ||||
-rw-r--r-- | llvm/lib/Target/X86/X86.td | 21 | ||||
-rw-r--r-- | llvm/test/CodeGen/X86/cpus.ll | 1 |
3 files changed, 23 insertions, 5 deletions
diff --git a/llvm/lib/Support/Host.cpp b/llvm/lib/Support/Host.cpp index e5bd7e0e44f..b1d5b44ebd0 100644 --- a/llvm/lib/Support/Host.cpp +++ b/llvm/lib/Support/Host.cpp @@ -339,6 +339,7 @@ enum ProcessorTypes { AMD_BTVER1, AMD_BTVER2, AMDFAM17H, + INTEL_KNM, // Entries below this are not in libgcc/compiler-rt. INTEL_i386, INTEL_i486, @@ -759,6 +760,9 @@ getIntelProcessorTypeAndSubtype(unsigned Family, unsigned Model, case 0x57: *Type = INTEL_KNL; // knl break; + case 0x85: + *Type = INTEL_KNM; // knm + break; default: // Unknown family 6 CPU, try to guess. if (Features & (1 << FEATURE_AVX512F)) { @@ -1167,6 +1171,8 @@ StringRef sys::getHostCPUName() { return "goldmont"; case INTEL_KNL: return "knl"; + case INTEL_KNM: + return "knm"; case INTEL_X86_64: return "x86-64"; case INTEL_NOCONA: diff --git a/llvm/lib/Target/X86/X86.td b/llvm/lib/Target/X86/X86.td index dbe3620ee8f..07e78adf928 100644 --- a/llvm/lib/Target/X86/X86.td +++ b/llvm/lib/Target/X86/X86.td @@ -610,10 +610,7 @@ class SkylakeClientProc<string Name> : ProcModel<Name, SkylakeClientModel, ]>; def : SkylakeClientProc<"skylake">; -// FIXME: define KNL model -class KnightsLandingProc<string Name> : ProcModel<Name, HaswellModel, - IVBFeatures.Value, [ - ProcIntelKNL, +def KNLFeatures : ProcessorFeatures<IVBFeatures.Value, [ FeatureAVX512, FeatureERI, FeatureCDI, @@ -625,12 +622,26 @@ class KnightsLandingProc<string Name> : ProcModel<Name, HaswellModel, FeatureLZCNT, FeatureBMI, FeatureBMI2, - FeatureFMA, + FeatureFMA +]>; + +// FIXME: define KNL model +class KnightsLandingProc<string Name> : ProcModel<Name, HaswellModel, + KNLFeatures.Value, [ + ProcIntelKNL, FeatureSlowTwoMemOps, FeatureFastPartialYMMorZMMWrite ]>; def : KnightsLandingProc<"knl">; +class KnightsMillProc<string Name> : ProcModel<Name, HaswellModel, + KNLFeatures.Value, [ + ProcIntelKNL, + FeatureSlowTwoMemOps, + FeatureFastPartialYMMorZMMWrite +]>; +def : KnightsMillProc<"knm">; // TODO Add AVX5124FMAPS/AVX5124VNNIW features + def SKXFeatures : ProcessorFeatures<SKLFeatures.Value, [ FeatureAVX512, FeatureCDI, diff --git a/llvm/test/CodeGen/X86/cpus.ll b/llvm/test/CodeGen/X86/cpus.ll index bbd023316d6..6729ec05ed8 100644 --- a/llvm/test/CodeGen/X86/cpus.ll +++ b/llvm/test/CodeGen/X86/cpus.ll @@ -30,6 +30,7 @@ ; RUN: llc < %s -o /dev/null -mtriple=x86_64-unknown-unknown -mcpu=goldmont 2>&1 | FileCheck %s --check-prefix=CHECK-NO-ERROR --allow-empty ; RUN: llc < %s -o /dev/null -mtriple=x86_64-unknown-unknown -mcpu=lakemont 2>&1 | FileCheck %s --check-prefix=CHECK-NO-ERROR --allow-empty ; RUN: llc < %s -o /dev/null -mtriple=x86_64-unknown-unknown -mcpu=knl 2>&1 | FileCheck %s --check-prefix=CHECK-NO-ERROR --allow-empty +; RUN: llc < %s -o /dev/null -mtriple=x86_64-unknown-unknown -mcpu=knm 2>&1 | FileCheck %s --check-prefix=CHECK-NO-ERROR --allow-empty ; RUN: llc < %s -o /dev/null -mtriple=x86_64-unknown-unknown -mcpu=k8 2>&1 | FileCheck %s --check-prefix=CHECK-NO-ERROR --allow-empty ; RUN: llc < %s -o /dev/null -mtriple=x86_64-unknown-unknown -mcpu=opteron 2>&1 | FileCheck %s --check-prefix=CHECK-NO-ERROR --allow-empty ; RUN: llc < %s -o /dev/null -mtriple=x86_64-unknown-unknown -mcpu=athlon64 2>&1 | FileCheck %s --check-prefix=CHECK-NO-ERROR --allow-empty |