[PATCH] D53663: [X86] Add a common-avx512 CPU to match icc's -xCOMMON-AVX512 option
Craig Topper via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Oct 24 12:08:00 PDT 2018
craig.topper created this revision.
craig.topper added reviewers: RKSimon, spatel.
This adds a common-avx512 CPU to target the avx512 features common between skylake-avx512 and knl.
https://reviews.llvm.org/D53663
Files:
include/llvm/Support/X86TargetParser.def
lib/Target/X86/X86.td
test/CodeGen/X86/cpus-intel.ll
Index: test/CodeGen/X86/cpus-intel.ll
===================================================================
--- test/CodeGen/X86/cpus-intel.ll
+++ test/CodeGen/X86/cpus-intel.ll
@@ -46,6 +46,7 @@
; RUN: llc < %s -o /dev/null -mtriple=x86_64-unknown-unknown -mcpu=tremont 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=common-avx512 2>&1 | FileCheck %s --check-prefix=CHECK-NO-ERROR --allow-empty
define void @foo() {
ret void
Index: lib/Target/X86/X86.td
===================================================================
--- lib/Target/X86/X86.td
+++ lib/Target/X86/X86.td
@@ -862,6 +862,17 @@
def : SkylakeServerProc<"skylake-avx512">;
def : SkylakeServerProc<"skx">; // Legacy alias.
+// Fake CPU to represent the intersection between SKX and KNL. Matches
+// icc's -xCOMMON-AVX512. BDW ISA + AVX512F + AVX512CD.
+class CommonAVX512Proc<string Name> : ProcModel<Name, BroadwellModel,
+ BDWFeatures.Value, [
+ FeatureAVX512,
+ FeatureCDI,
+ FeaturePOPCNTFalseDeps,
+ FeatureLZCNTFalseDeps
+]>;
+def : CommonAVX512Proc<"common-avx512">;
+
def CNLFeatures : ProcessorFeatures<SKLFeatures.Value, [
FeatureAVX512,
FeatureCDI,
Index: include/llvm/Support/X86TargetParser.def
===================================================================
--- include/llvm/Support/X86TargetParser.def
+++ include/llvm/Support/X86TargetParser.def
@@ -67,6 +67,7 @@
X86_CPU_TYPE ("athlon-xp", AMD_ATHLON_XP)
X86_CPU_TYPE ("k8", AMD_K8)
X86_CPU_TYPE ("k8-sse3", AMD_K8SSE3)
+X86_CPU_TYPE ("common-avx512", INTEL_COMMON_AVX512)
#undef X86_CPU_TYPE_COMPAT_WITH_ALIAS
#undef X86_CPU_TYPE_COMPAT
#undef X86_CPU_TYPE
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D53663.170945.patch
Type: text/x-patch
Size: 2107 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181024/519cd846/attachment.bin>
More information about the llvm-commits
mailing list