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 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 : ProcModel; +def : CommonAVX512Proc<"common-avx512">; + def CNLFeatures : ProcessorFeatures&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