diff --git a/clang/include/clang/Basic/X86Target.def b/clang/include/clang/Basic/X86Target.def --- a/clang/include/clang/Basic/X86Target.def +++ b/clang/include/clang/Basic/X86Target.def @@ -11,10 +11,6 @@ // //===----------------------------------------------------------------------===// -#ifndef FEATURE -#define FEATURE(ENUM) -#endif - #ifndef CPU_SPECIFIC #define CPU_SPECIFIC(NAME, MANGLING, FEATURES) #endif @@ -23,50 +19,6 @@ #define CPU_SPECIFIC_ALIAS(NEW_NAME, NAME) #endif -// List of CPU Supports features in order. These need to remain in the order -// required by attribute 'target' checking. Note that not all are supported/ -// prioritized by GCC, so synchronization with GCC's implementation may require -// changing some existing values. -FEATURE(FEATURE_CMOV) -FEATURE(FEATURE_MMX) -FEATURE(FEATURE_SSE) -FEATURE(FEATURE_SSE2) -FEATURE(FEATURE_SSE3) -FEATURE(FEATURE_SSSE3) -FEATURE(FEATURE_SSE4_A) -FEATURE(FEATURE_SSE4_1) -FEATURE(FEATURE_SSE4_2) -FEATURE(FEATURE_POPCNT) -FEATURE(FEATURE_AES) -FEATURE(FEATURE_PCLMUL) -FEATURE(FEATURE_AVX) -FEATURE(FEATURE_BMI) -FEATURE(FEATURE_FMA4) -FEATURE(FEATURE_XOP) -FEATURE(FEATURE_FMA) -FEATURE(FEATURE_BMI2) -FEATURE(FEATURE_AVX2) -FEATURE(FEATURE_AVX512F) -FEATURE(FEATURE_AVX512VL) -FEATURE(FEATURE_AVX512BW) -FEATURE(FEATURE_AVX512DQ) -FEATURE(FEATURE_AVX512CD) -FEATURE(FEATURE_AVX512ER) -FEATURE(FEATURE_AVX512PF) -FEATURE(FEATURE_AVX512VBMI) -FEATURE(FEATURE_AVX512IFMA) -FEATURE(FEATURE_AVX5124VNNIW) -FEATURE(FEATURE_AVX5124FMAPS) -FEATURE(FEATURE_AVX512VPOPCNTDQ) -FEATURE(FEATURE_AVX512VBMI2) -FEATURE(FEATURE_GFNI) -FEATURE(FEATURE_VPCLMULQDQ) -FEATURE(FEATURE_AVX512VNNI) -FEATURE(FEATURE_AVX512BITALG) -FEATURE(FEATURE_AVX512BF16) -FEATURE(FEATURE_AVX512VP2INTERSECT) - - // FIXME: When commented out features are supported in LLVM, enable them here. CPU_SPECIFIC("generic", 'A', "") CPU_SPECIFIC("pentium", 'B', "") @@ -107,4 +59,3 @@ #undef CPU_SPECIFIC #undef PROC_64_BIT #undef PROC_32_BIT -#undef FEATURE 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 @@ -1057,17 +1057,13 @@ static unsigned getFeaturePriority(llvm::X86::ProcessorFeatures Feat) { enum class FeatPriority { -#define FEATURE(FEAT) FEAT, -#include "clang/Basic/X86Target.def" +#define X86_FEATURE_COMPAT(ENUM, STR) ENUM, +#include "llvm/Support/X86TargetParser.def" + MAX }; - switch (Feat) { -#define FEATURE(FEAT) \ - case llvm::X86::FEAT: \ - return static_cast(FeatPriority::FEAT); -#include "clang/Basic/X86Target.def" - default: - llvm_unreachable("No Feature Priority for non-CPUSupports Features"); - } + assert(Feat < static_cast(FeatPriority::MAX) && + "No Feature Priority for non-CPUSupports Features"); + return static_cast(Feat); } unsigned X86TargetInfo::multiVersionSortPriority(StringRef Name) const {