diff --git a/clang/lib/Basic/Targets/X86.cpp b/clang/lib/Basic/Targets/X86.cpp --- a/clang/lib/Basic/Targets/X86.cpp +++ b/clang/lib/Basic/Targets/X86.cpp @@ -510,6 +510,7 @@ case CK_Tigerlake: case CK_SapphireRapids: case CK_Alderlake: + case CK_Raptorlake: // FIXME: Historically, we defined this legacy name, it would be nice to // remove it at some point. We've never exposed fine-grained names for // recent primary x86 CPUs, and we should keep it that way. @@ -1366,6 +1367,7 @@ case CK_Rocketlake: case CK_IcelakeServer: case CK_Alderlake: + case CK_Raptorlake: case CK_KNL: case CK_KNM: // K7 diff --git a/clang/test/CodeGen/attr-target-mv.c b/clang/test/CodeGen/attr-target-mv.c --- a/clang/test/CodeGen/attr-target-mv.c +++ b/clang/test/CodeGen/attr-target-mv.c @@ -15,6 +15,7 @@ int __attribute__((target("arch=alderlake"))) foo(void) {return 11;} int __attribute__((target("arch=rocketlake"))) foo(void) {return 12;} int __attribute__((target("arch=core2"))) foo(void) {return 13;} +int __attribute__((target("arch=raptorlake"))) foo(void) {return 14;} int __attribute__((target("default"))) foo(void) { return 2; } int bar(void) { @@ -149,6 +150,8 @@ // LINUX: ret i32 12 // LINUX: define{{.*}} i32 @foo.arch_core2() // LINUX: ret i32 13 +// LINUX: define{{.*}} i32 @foo.arch_raptorlake() +// LINUX: ret i32 14 // LINUX: define{{.*}} i32 @foo() // LINUX: ret i32 2 // LINUX: define{{.*}} i32 @bar() @@ -180,6 +183,8 @@ // WINDOWS: ret i32 12 // WINDOWS: define dso_local i32 @foo.arch_core2() // WINDOWS: ret i32 13 +// WINDOWS: define dso_local i32 @foo.arch_raptorlake() +// WINDOWS: ret i32 14 // WINDOWS: define dso_local i32 @foo() // WINDOWS: ret i32 2 // WINDOWS: define dso_local i32 @bar() diff --git a/clang/test/CodeGen/target-builtin-noerror.c b/clang/test/CodeGen/target-builtin-noerror.c --- a/clang/test/CodeGen/target-builtin-noerror.c +++ b/clang/test/CodeGen/target-builtin-noerror.c @@ -126,6 +126,7 @@ (void)__builtin_cpu_is("tigerlake"); (void)__builtin_cpu_is("sapphirerapids"); (void)__builtin_cpu_is("tremont"); + (void)__builtin_cpu_is("raptorlake"); (void)__builtin_cpu_is("westmere"); (void)__builtin_cpu_is("znver1"); (void)__builtin_cpu_is("znver2"); diff --git a/clang/test/Driver/x86-march.c b/clang/test/Driver/x86-march.c --- a/clang/test/Driver/x86-march.c +++ b/clang/test/Driver/x86-march.c @@ -112,6 +112,10 @@ // RUN: | FileCheck %s -check-prefix=tremont // tremont: "-target-cpu" "tremont" // +// RUN: %clang -target x86_64-unknown-unknown -c -### %s -march=raptorlake 2>&1 \ +// RUN: | FileCheck %s -check-prefix=raptorlake +// raptorlake: "-target-cpu" "raptorlake" +// // RUN: %clang -target x86_64-unknown-unknown -c -### %s -march=sapphirerapids 2>&1 \ // RUN: | FileCheck %s -check-prefix=sapphirerapids // sapphirerapids: "-target-cpu" "sapphirerapids" diff --git a/clang/test/Misc/target-invalid-cpu-note.c b/clang/test/Misc/target-invalid-cpu-note.c --- a/clang/test/Misc/target-invalid-cpu-note.c +++ b/clang/test/Misc/target-invalid-cpu-note.c @@ -13,19 +13,19 @@ // RUN: not %clang_cc1 -triple i386--- -target-cpu not-a-cpu -fsyntax-only %s 2>&1 | FileCheck %s --check-prefix X86 // X86: error: unknown target CPU 'not-a-cpu' -// X86-NEXT: note: valid target CPU values are: i386, i486, winchip-c6, winchip2, c3, i586, pentium, pentium-mmx, pentiumpro, i686, pentium2, pentium3, pentium3m, pentium-m, c3-2, yonah, pentium4, pentium4m, prescott, nocona, core2, penryn, bonnell, atom, silvermont, slm, goldmont, goldmont-plus, tremont, nehalem, corei7, westmere, sandybridge, corei7-avx, ivybridge, core-avx-i, haswell, core-avx2, broadwell, skylake, skylake-avx512, skx, cascadelake, cooperlake, cannonlake, icelake-client, rocketlake, icelake-server, tigerlake, sapphirerapids, alderlake, knl, knm, lakemont, k6, k6-2, k6-3, athlon, athlon-tbird, athlon-xp, athlon-mp, athlon-4, k8, athlon64, athlon-fx, opteron, k8-sse3, athlon64-sse3, opteron-sse3, amdfam10, barcelona, btver1, btver2, bdver1, bdver2, bdver3, bdver4, znver1, znver2, znver3, x86-64, x86-64-v2, x86-64-v3, x86-64-v4, geode{{$}} +// X86-NEXT: note: valid target CPU values are: i386, i486, winchip-c6, winchip2, c3, i586, pentium, pentium-mmx, pentiumpro, i686, pentium2, pentium3, pentium3m, pentium-m, c3-2, yonah, pentium4, pentium4m, prescott, nocona, core2, penryn, bonnell, atom, silvermont, slm, goldmont, goldmont-plus, tremont, nehalem, corei7, westmere, sandybridge, corei7-avx, ivybridge, core-avx-i, haswell, core-avx2, broadwell, skylake, skylake-avx512, skx, cascadelake, cooperlake, cannonlake, icelake-client, rocketlake, icelake-server, tigerlake, sapphirerapids, alderlake, raptorlake, knl, knm, lakemont, k6, k6-2, k6-3, athlon, athlon-tbird, athlon-xp, athlon-mp, athlon-4, k8, athlon64, athlon-fx, opteron, k8-sse3, athlon64-sse3, opteron-sse3, amdfam10, barcelona, btver1, btver2, bdver1, bdver2, bdver3, bdver4, znver1, znver2, znver3, x86-64, x86-64-v2, x86-64-v3, x86-64-v4, geode{{$}} // RUN: not %clang_cc1 -triple x86_64--- -target-cpu not-a-cpu -fsyntax-only %s 2>&1 | FileCheck %s --check-prefix X86_64 // X86_64: error: unknown target CPU 'not-a-cpu' -// X86_64-NEXT: note: valid target CPU values are: nocona, core2, penryn, bonnell, atom, silvermont, slm, goldmont, goldmont-plus, tremont, nehalem, corei7, westmere, sandybridge, corei7-avx, ivybridge, core-avx-i, haswell, core-avx2, broadwell, skylake, skylake-avx512, skx, cascadelake, cooperlake, cannonlake, icelake-client, rocketlake, icelake-server, tigerlake, sapphirerapids, alderlake, knl, knm, k8, athlon64, athlon-fx, opteron, k8-sse3, athlon64-sse3, opteron-sse3, amdfam10, barcelona, btver1, btver2, bdver1, bdver2, bdver3, bdver4, znver1, znver2, znver3, x86-64, x86-64-v2, x86-64-v3, x86-64-v4{{$}} +// X86_64-NEXT: note: valid target CPU values are: nocona, core2, penryn, bonnell, atom, silvermont, slm, goldmont, goldmont-plus, tremont, nehalem, corei7, westmere, sandybridge, corei7-avx, ivybridge, core-avx-i, haswell, core-avx2, broadwell, skylake, skylake-avx512, skx, cascadelake, cooperlake, cannonlake, icelake-client, rocketlake, icelake-server, tigerlake, sapphirerapids, alderlake, raptorlake, knl, knm, k8, athlon64, athlon-fx, opteron, k8-sse3, athlon64-sse3, opteron-sse3, amdfam10, barcelona, btver1, btver2, bdver1, bdver2, bdver3, bdver4, znver1, znver2, znver3, x86-64, x86-64-v2, x86-64-v3, x86-64-v4{{$}} // RUN: not %clang_cc1 -triple i386--- -tune-cpu not-a-cpu -fsyntax-only %s 2>&1 | FileCheck %s --check-prefix TUNE_X86 // TUNE_X86: error: unknown target CPU 'not-a-cpu' -// TUNE_X86-NEXT: note: valid target CPU values are: i386, i486, winchip-c6, winchip2, c3, i586, pentium, pentium-mmx, pentiumpro, i686, pentium2, pentium3, pentium3m, pentium-m, c3-2, yonah, pentium4, pentium4m, prescott, nocona, core2, penryn, bonnell, atom, silvermont, slm, goldmont, goldmont-plus, tremont, nehalem, corei7, westmere, sandybridge, corei7-avx, ivybridge, core-avx-i, haswell, core-avx2, broadwell, skylake, skylake-avx512, skx, cascadelake, cooperlake, cannonlake, icelake-client, rocketlake, icelake-server, tigerlake, sapphirerapids, alderlake, knl, knm, lakemont, k6, k6-2, k6-3, athlon, athlon-tbird, athlon-xp, athlon-mp, athlon-4, k8, athlon64, athlon-fx, opteron, k8-sse3, athlon64-sse3, opteron-sse3, amdfam10, barcelona, btver1, btver2, bdver1, bdver2, bdver3, bdver4, znver1, znver2, znver3, x86-64, geode{{$}} +// TUNE_X86-NEXT: note: valid target CPU values are: i386, i486, winchip-c6, winchip2, c3, i586, pentium, pentium-mmx, pentiumpro, i686, pentium2, pentium3, pentium3m, pentium-m, c3-2, yonah, pentium4, pentium4m, prescott, nocona, core2, penryn, bonnell, atom, silvermont, slm, goldmont, goldmont-plus, tremont, nehalem, corei7, westmere, sandybridge, corei7-avx, ivybridge, core-avx-i, haswell, core-avx2, broadwell, skylake, skylake-avx512, skx, cascadelake, cooperlake, cannonlake, icelake-client, rocketlake, icelake-server, tigerlake, sapphirerapids, alderlake, raptorlake, knl, knm, lakemont, k6, k6-2, k6-3, athlon, athlon-tbird, athlon-xp, athlon-mp, athlon-4, k8, athlon64, athlon-fx, opteron, k8-sse3, athlon64-sse3, opteron-sse3, amdfam10, barcelona, btver1, btver2, bdver1, bdver2, bdver3, bdver4, znver1, znver2, znver3, x86-64, geode{{$}} // RUN: not %clang_cc1 -triple x86_64--- -tune-cpu not-a-cpu -fsyntax-only %s 2>&1 | FileCheck %s --check-prefix TUNE_X86_64 // TUNE_X86_64: error: unknown target CPU 'not-a-cpu' -// TUNE_X86_64-NEXT: note: valid target CPU values are: i386, i486, winchip-c6, winchip2, c3, i586, pentium, pentium-mmx, pentiumpro, i686, pentium2, pentium3, pentium3m, pentium-m, c3-2, yonah, pentium4, pentium4m, prescott, nocona, core2, penryn, bonnell, atom, silvermont, slm, goldmont, goldmont-plus, tremont, nehalem, corei7, westmere, sandybridge, corei7-avx, ivybridge, core-avx-i, haswell, core-avx2, broadwell, skylake, skylake-avx512, skx, cascadelake, cooperlake, cannonlake, icelake-client, rocketlake, icelake-server, tigerlake, sapphirerapids, alderlake, knl, knm, lakemont, k6, k6-2, k6-3, athlon, athlon-tbird, athlon-xp, athlon-mp, athlon-4, k8, athlon64, athlon-fx, opteron, k8-sse3, athlon64-sse3, opteron-sse3, amdfam10, barcelona, btver1, btver2, bdver1, bdver2, bdver3, bdver4, znver1, znver2, znver3, x86-64, geode{{$}} +// TUNE_X86_64-NEXT: note: valid target CPU values are: i386, i486, winchip-c6, winchip2, c3, i586, pentium, pentium-mmx, pentiumpro, i686, pentium2, pentium3, pentium3m, pentium-m, c3-2, yonah, pentium4, pentium4m, prescott, nocona, core2, penryn, bonnell, atom, silvermont, slm, goldmont, goldmont-plus, tremont, nehalem, corei7, westmere, sandybridge, corei7-avx, ivybridge, core-avx-i, haswell, core-avx2, broadwell, skylake, skylake-avx512, skx, cascadelake, cooperlake, cannonlake, icelake-client, rocketlake, icelake-server, tigerlake, sapphirerapids, alderlake, raptorlake, knl, knm, lakemont, k6, k6-2, k6-3, athlon, athlon-tbird, athlon-xp, athlon-mp, athlon-4, k8, athlon64, athlon-fx, opteron, k8-sse3, athlon64-sse3, opteron-sse3, amdfam10, barcelona, btver1, btver2, bdver1, bdver2, bdver3, bdver4, znver1, znver2, znver3, x86-64, geode{{$}} // RUN: not %clang_cc1 -triple nvptx--- -target-cpu not-a-cpu -fsyntax-only %s 2>&1 | FileCheck %s --check-prefix NVPTX // NVPTX: error: unknown target CPU 'not-a-cpu' diff --git a/clang/test/Preprocessor/predefined-arch-macros.c b/clang/test/Preprocessor/predefined-arch-macros.c --- a/clang/test/Preprocessor/predefined-arch-macros.c +++ b/clang/test/Preprocessor/predefined-arch-macros.c @@ -2230,6 +2230,132 @@ // RUN: | FileCheck %s -check-prefix=CHECK_LAKEMONT_M64 // CHECK_LAKEMONT_M64: error: +// RUN: %clang -march=raptorlake -m32 -E -dM %s -o - 2>&1 \ +// RUN: -target i386-unknown-linux \ +// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_RPL_M32 +// CHECK_RPL_M32: #define __ADX__ 1 +// CHECK_RPL_M32: #define __AES__ 1 +// CHECK_RPL_M32: #define __AVX2__ 1 +// CHECK_RPL_M32-NOT: AVX512 +// CHECK_RPL_M32: #define __AVXVNNI__ 1 +// CHECK_RPL_M32: #define __AVX__ 1 +// CHECK_RPL_M32: #define __BMI2__ 1 +// CHECK_RPL_M32: #define __BMI__ 1 +// CHECK_RPL_M32: #define __CLDEMOTE__ 1 +// CHECK_RPL_M32: #define __CLFLUSHOPT__ 1 +// CHECK_RPL_M32: #define __CLWB__ 1 +// CHECK_RPL_M32: #define __F16C__ 1 +// CHECK_RPL_M32: #define __FMA__ 1 +// CHECK_RPL_M32: #define __FSGSBASE__ 1 +// CHECK_RPL_M32: #define __FXSR__ 1 +// CHECK_RPL_M32: #define __GFNI__ 1 +// CHECK_RPL_M32: #define __HRESET__ 1 +// CHECK_RPL_M32: #define __INVPCID__ 1 +// CHECK_RPL_M32: #define __KL__ 1 +// CHECK_RPL_M32: #define __LZCNT__ 1 +// CHECK_RPL_M32: #define __MMX__ 1 +// CHECK_RPL_M32: #define __MOVBE__ 1 +// CHECK_RPL_M32: #define __MOVDIR64B__ 1 +// CHECK_RPL_M32: #define __MOVDIRI__ 1 +// CHECK_RPL_M32: #define __PCLMUL__ 1 +// CHECK_RPL_M32: #define __PCONFIG__ 1 +// CHECK_RPL_M32: #define __PKU__ 1 +// CHECK_RPL_M32: #define __POPCNT__ 1 +// CHECK_RPL_M32: #define __PRFCHW__ 1 +// CHECK_RPL_M32: #define __PTWRITE__ 1 +// CHECK_RPL_M32: #define __RDPID__ 1 +// CHECK_RPL_M32: #define __RDRND__ 1 +// CHECK_RPL_M32: #define __RDSEED__ 1 +// CHECK_RPL_M32: #define __SERIALIZE__ 1 +// CHECK_RPL_M32: #define __SGX__ 1 +// CHECK_RPL_M32: #define __SHA__ 1 +// CHECK_RPL_M32: #define __SHSTK__ 1 +// CHECK_RPL_M32: #define __SSE2__ 1 +// CHECK_RPL_M32: #define __SSE3__ 1 +// CHECK_RPL_M32: #define __SSE4_1__ 1 +// CHECK_RPL_M32: #define __SSE4_2__ 1 +// CHECK_RPL_M32: #define __SSE_MATH__ 1 +// CHECK_RPL_M32: #define __SSE__ 1 +// CHECK_RPL_M32: #define __SSSE3__ 1 +// CHECK_RPL_M32: #define __VAES__ 1 +// CHECK_RPL_M32: #define __VPCLMULQDQ__ 1 +// CHECK_RPL_M32: #define __WAITPKG__ 1 +// CHECK_RPL_M32: #define __WIDEKL__ 1 +// CHECK_RPL_M32: #define __XSAVEC__ 1 +// CHECK_RPL_M32: #define __XSAVEOPT__ 1 +// CHECK_RPL_M32: #define __XSAVES__ 1 +// CHECK_RPL_M32: #define __XSAVE__ 1 +// CHECK_RPL_M32: #define __corei7 1 +// CHECK_RPL_M32: #define __corei7__ 1 +// CHECK_RPL_M32: #define __i386 1 +// CHECK_RPL_M32: #define __i386__ 1 +// CHECK_RPL_M32: #define __tune_corei7__ 1 +// CHECK_RPL_M32: #define i386 1 + +// RUN: %clang -march=raptorlake -m64 -E -dM %s -o - 2>&1 \ +// RUN: -target i386-unknown-linux \ +// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_RPL_M64 +// CHECK_RPL_M64: #define __ADX__ 1 +// CHECK_RPL_M64: #define __AES__ 1 +// CHECK_RPL_M64: #define __AVX2__ 1 +// CHECK_RPL_M64-NOT: AVX512 +// CHECK_RPL_M64: #define __AVXVNNI__ 1 +// CHECK_RPL_M64: #define __AVX__ 1 +// CHECK_RPL_M64: #define __BMI2__ 1 +// CHECK_RPL_M64: #define __BMI__ 1 +// CHECK_RPL_M64: #define __CLDEMOTE__ 1 +// CHECK_RPL_M64: #define __CLFLUSHOPT__ 1 +// CHECK_RPL_M64: #define __CLWB__ 1 +// CHECK_RPL_M64: #define __F16C__ 1 +// CHECK_RPL_M64: #define __FMA__ 1 +// CHECK_RPL_M64: #define __FSGSBASE__ 1 +// CHECK_RPL_M64: #define __FXSR__ 1 +// CHECK_RPL_M64: #define __GFNI__ 1 +// CHECK_RPL_M64: #define __HRESET__ 1 +// CHECK_RPL_M64: #define __INVPCID__ 1 +// CHECK_RPL_M64: #define __KL__ 1 +// CHECK_RPL_M64: #define __LZCNT__ 1 +// CHECK_RPL_M64: #define __MMX__ 1 +// CHECK_RPL_M64: #define __MOVBE__ 1 +// CHECK_RPL_M64: #define __MOVDIR64B__ 1 +// CHECK_RPL_M64: #define __MOVDIRI__ 1 +// CHECK_RPL_M64: #define __PCLMUL__ 1 +// CHECK_RPL_M64: #define __PCONFIG__ 1 +// CHECK_RPL_M64: #define __PKU__ 1 +// CHECK_RPL_M64: #define __POPCNT__ 1 +// CHECK_RPL_M64: #define __PRFCHW__ 1 +// CHECK_RPL_M64: #define __PTWRITE__ 1 +// CHECK_RPL_M64: #define __RDPID__ 1 +// CHECK_RPL_M64: #define __RDRND__ 1 +// CHECK_RPL_M64: #define __RDSEED__ 1 +// CHECK_RPL_M64: #define __SERIALIZE__ 1 +// CHECK_RPL_M64: #define __SGX__ 1 +// CHECK_RPL_M64: #define __SHA__ 1 +// CHECK_RPL_M64: #define __SHSTK__ 1 +// CHECK_RPL_M64: #define __SSE2_MATH__ 1 +// CHECK_RPL_M64: #define __SSE2__ 1 +// CHECK_RPL_M64: #define __SSE3__ 1 +// CHECK_RPL_M64: #define __SSE4_1__ 1 +// CHECK_RPL_M64: #define __SSE4_2__ 1 +// CHECK_RPL_M64: #define __SSE_MATH__ 1 +// CHECK_RPL_M64: #define __SSE__ 1 +// CHECK_RPL_M64: #define __SSSE3__ 1 +// CHECK_RPL_M64: #define __VAES__ 1 +// CHECK_RPL_M64: #define __VPCLMULQDQ__ 1 +// CHECK_RPL_M64: #define __WAITPKG__ 1 +// CHECK_RPL_M64: #define __WIDEKL__ 1 +// CHECK_RPL_M64: #define __XSAVEC__ 1 +// CHECK_RPL_M64: #define __XSAVEOPT__ 1 +// CHECK_RPL_M64: #define __XSAVES__ 1 +// CHECK_RPL_M64: #define __XSAVE__ 1 +// CHECK_RPL_M64: #define __amd64 1 +// CHECK_RPL_M64: #define __amd64__ 1 +// CHECK_RPL_M64: #define __corei7 1 +// CHECK_RPL_M64: #define __corei7__ 1 +// CHECK_RPL_M64: #define __tune_corei7__ 1 +// CHECK_RPL_M64: #define __x86_64 1 +// CHECK_RPL_M64: #define __x86_64__ 1 + // RUN: %clang -march=geode -m32 -E -dM %s -o - 2>&1 \ // RUN: -target i386-unknown-linux \ // RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_GEODE_M32 diff --git a/compiler-rt/lib/builtins/cpu_model.c b/compiler-rt/lib/builtins/cpu_model.c --- a/compiler-rt/lib/builtins/cpu_model.c +++ b/compiler-rt/lib/builtins/cpu_model.c @@ -107,6 +107,7 @@ INTEL_COREI7_ALDERLAKE, AMDFAM19H_ZNVER3, INTEL_COREI7_ROCKETLAKE, + INTEL_COREI7_RAPTORLAKE, CPU_SUBTYPE_MAX }; @@ -460,6 +461,13 @@ *Subtype = INTEL_COREI7_SAPPHIRERAPIDS; break; + // Raptorlake: + case 0xb7: + CPU = "raptorlake"; + *Type = INTEL_COREI7; + *Subtype = INTEL_COREI7_RAPTORLAKE; + break; + case 0x1c: // Most 45 nm Intel Atom processors case 0x26: // 45 nm Atom Lincroft case 0x27: // 32 nm Atom Medfield diff --git a/llvm/include/llvm/Support/X86TargetParser.h b/llvm/include/llvm/Support/X86TargetParser.h --- a/llvm/include/llvm/Support/X86TargetParser.h +++ b/llvm/include/llvm/Support/X86TargetParser.h @@ -104,6 +104,7 @@ CK_Tigerlake, CK_SapphireRapids, CK_Alderlake, + CK_Raptorlake, CK_KNL, CK_KNM, CK_Lakemont, diff --git a/llvm/include/llvm/Support/X86TargetParser.def b/llvm/include/llvm/Support/X86TargetParser.def --- a/llvm/include/llvm/Support/X86TargetParser.def +++ b/llvm/include/llvm/Support/X86TargetParser.def @@ -89,6 +89,7 @@ X86_CPU_SUBTYPE(INTEL_COREI7_ALDERLAKE, "alderlake") X86_CPU_SUBTYPE(AMDFAM19H_ZNVER3, "znver3") X86_CPU_SUBTYPE(INTEL_COREI7_ROCKETLAKE, "rocketlake") +X86_CPU_SUBTYPE(INTEL_COREI7_RAPTORLAKE, "raptorlake") #undef X86_CPU_SUBTYPE // This macro is used for cpu types present in compiler-rt/libgcc. The third diff --git a/llvm/lib/Support/Host.cpp b/llvm/lib/Support/Host.cpp --- a/llvm/lib/Support/Host.cpp +++ b/llvm/lib/Support/Host.cpp @@ -820,6 +820,12 @@ *Subtype = X86::INTEL_COREI7_ALDERLAKE; break; + // Raptorlake: + case 0xb7: + CPU = "raptorlake"; + *Type = X86::INTEL_COREI7; + *Subtype = X86::INTEL_COREI7_RAPTORLAKE; + break; // Icelake Xeon: case 0x6a: case 0x6c: diff --git a/llvm/lib/Support/X86TargetParser.cpp b/llvm/lib/Support/X86TargetParser.cpp --- a/llvm/lib/Support/X86TargetParser.cpp +++ b/llvm/lib/Support/X86TargetParser.cpp @@ -370,6 +370,8 @@ { {"sapphirerapids"}, CK_SapphireRapids, FEATURE_AVX512BF16, FeaturesSapphireRapids }, // Alderlake microarchitecture based processors. { {"alderlake"}, CK_Alderlake, FEATURE_AVX2, FeaturesAlderlake }, + // Raptorlake microarchitecture based processors. + { {"raptorlake"}, CK_Raptorlake, FEATURE_AVX2, FeaturesAlderlake }, // Knights Landing processor. { {"knl"}, CK_KNL, FEATURE_AVX512F, FeaturesKNL }, // Knights Mill processor. diff --git a/llvm/lib/Target/X86/X86.td b/llvm/lib/Target/X86/X86.td --- a/llvm/lib/Target/X86/X86.td +++ b/llvm/lib/Target/X86/X86.td @@ -1420,6 +1420,8 @@ ProcessorFeatures.GLPTuning>; def : ProcModel<"tremont", SLMModel, ProcessorFeatures.TRMFeatures, ProcessorFeatures.TRMTuning>; +def : ProcModel<"raptorlake", SLMModel, ProcessorFeatures.ADLFeatures, + ProcessorFeatures.TRMTuning>; // "Arrandale" along with corei3 and corei5 foreach P = ["nehalem", "corei7"] in { diff --git a/llvm/test/CodeGen/X86/cpus-intel.ll b/llvm/test/CodeGen/X86/cpus-intel.ll --- a/llvm/test/CodeGen/X86/cpus-intel.ll +++ b/llvm/test/CodeGen/X86/cpus-intel.ll @@ -17,6 +17,7 @@ ; RUN: llc < %s -o /dev/null -mtriple=i686-unknown-unknown -mcpu=yonah 2>&1 | FileCheck %s --check-prefix=CHECK-NO-ERROR --allow-empty ; RUN: llc < %s -o /dev/null -mtriple=i686-unknown-unknown -mcpu=prescott 2>&1 | FileCheck %s --check-prefix=CHECK-NO-ERROR --allow-empty ; RUN: llc < %s -o /dev/null -mtriple=i686-unknown-unknown -mcpu=lakemont 2>&1 | FileCheck %s --check-prefix=CHECK-NO-ERROR --allow-empty +; RUN: llc < %s -o /dev/null -mtriple=i686-unknown-unknown -mcpu=raptorlake 2>&1 | FileCheck %s --check-prefix=CHECK-NO-ERROR --allow-empty ; RUN: llc < %s -o /dev/null -mtriple=x86_64-unknown-unknown -mcpu=nocona 2>&1 | FileCheck %s --check-prefix=CHECK-NO-ERROR --allow-empty ; RUN: llc < %s -o /dev/null -mtriple=x86_64-unknown-unknown -mcpu=core2 2>&1 | FileCheck %s --check-prefix=CHECK-NO-ERROR --allow-empty @@ -52,6 +53,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=raptorlake 2>&1 | FileCheck %s --check-prefix=CHECK-NO-ERROR --allow-empty define void @foo() { ret void