[PATCH] D137153: [WIP][X86] Support -march=sierraforest, grandridge, graniterapids.
FreddyYe updated this revision to Diff 474138. FreddyYe added a comment. Rebase and add missing supports in cpu_model.c Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D137153/new/ https://reviews.llvm.org/D137153 Files: clang/docs/ReleaseNotes.rst clang/lib/Basic/Targets/X86.cpp clang/test/CodeGen/attr-target-mv.c clang/test/CodeGen/target-builtin-noerror.c clang/test/Driver/x86-march.c clang/test/Misc/target-invalid-cpu-note.c clang/test/Preprocessor/predefined-arch-macros.c compiler-rt/lib/builtins/cpu_model.c llvm/docs/ReleaseNotes.rst llvm/include/llvm/Support/X86TargetParser.def llvm/include/llvm/Support/X86TargetParser.h llvm/lib/Support/Host.cpp llvm/lib/Support/X86TargetParser.cpp llvm/lib/Target/X86/X86.td llvm/test/CodeGen/X86/cpus-intel.ll Index: llvm/test/CodeGen/X86/cpus-intel.ll === --- llvm/test/CodeGen/X86/cpus-intel.ll +++ llvm/test/CodeGen/X86/cpus-intel.ll @@ -19,6 +19,9 @@ ; 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=i686-unknown-unknown -mcpu=meteorlake 2>&1 | FileCheck %s --check-prefix=CHECK-NO-ERROR --allow-empty +; RUN: llc < %s -o /dev/null -mtriple=i686-unknown-unknown -mcpu=sierraforest 2>&1 | FileCheck %s --check-prefix=CHECK-NO-ERROR --allow-empty +; RUN: llc < %s -o /dev/null -mtriple=i686-unknown-unknown -mcpu=grandridge 2>&1 | FileCheck %s --check-prefix=CHECK-NO-ERROR --allow-empty +; RUN: llc < %s -o /dev/null -mtriple=i686-unknown-unknown -mcpu=graniterapids 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 @@ -56,6 +59,9 @@ ; 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 ; RUN: llc < %s -o /dev/null -mtriple=x86_64-unknown-unknown -mcpu=meteorlake 2>&1 | FileCheck %s --check-prefix=CHECK-NO-ERROR --allow-empty +; RUN: llc < %s -o /dev/null -mtriple=x86_64-unknown-unknown -mcpu=sierraforest 2>&1 | FileCheck %s --check-prefix=CHECK-NO-ERROR --allow-empty +; RUN: llc < %s -o /dev/null -mtriple=x86_64-unknown-unknown -mcpu=grandridge 2>&1 | FileCheck %s --check-prefix=CHECK-NO-ERROR --allow-empty +; RUN: llc < %s -o /dev/null -mtriple=x86_64-unknown-unknown -mcpu=graniterapids 2>&1 | FileCheck %s --check-prefix=CHECK-NO-ERROR --allow-empty define void @foo() { ret void Index: llvm/lib/Target/X86/X86.td === --- llvm/lib/Target/X86/X86.td +++ llvm/lib/Target/X86/X86.td @@ -943,6 +943,14 @@ list SPRFeatures = !listconcat(ICXFeatures, SPRAdditionalFeatures); + // Graniterapids + list GNRAdditionalFeatures = [FeatureAMXTILE, + FeatureAMXINT8, + FeatureAMXBF16, + FeatureBF16]; + list GNRFeatures = +!listconcat(SPRFeatures, GNRAdditionalFeatures); + // Atom list AtomFeatures = [FeatureX87, FeatureCX8, @@ -1050,6 +1058,19 @@ list ADLFeatures = !listconcat(TRMFeatures, ADLAdditionalFeatures); + // Sierraforest + list SRFAdditionalFeatures = [FeatureCMPCCXADD, + FeatureAVXIFMA, + FeatureAVXNECONVERT, + FeatureAVXVNNIINT8]; + list SRFFeatures = +!listconcat(ADLFeatures, SRFAdditionalFeatures); + + // Grandridge + list GRRAdditionalFeatures = [FeatureRAOINT]; + list GRRFeatures = +!listconcat(SRFFeatures, GRRAdditionalFeatures); + // Knights Landing list KNLFeatures = [FeatureX87, FeatureCX8, @@ -1441,6 +1462,10 @@ ProcessorFeatures.GLPTuning>; def : ProcModel<"tremont", SLMModel, ProcessorFeatures.TRMFeatures, ProcessorFeatures.TRMTuning>; +def : ProcModel<"sierraforest", AlderlakePModel, ProcessorFeatures.SRFFeatures, +ProcessorFeatures.TRMTuning>; +def : ProcModel<"grandridge", AlderlakePModel, ProcessorFeatures.GRRFeatures, +ProcessorFeatures.TRMTuning>; // "Arrandale" along with corei3 and
[PATCH] D137153: [WIP][X86] Support -march=sierraforest, grandridge, graniterapids.
FreddyYe updated this revision to Diff 474132. FreddyYe marked an inline comment as done. FreddyYe added a comment. Address comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D137153/new/ https://reviews.llvm.org/D137153 Files: clang/docs/ReleaseNotes.rst clang/lib/Basic/Targets/X86.cpp clang/test/CodeGen/attr-target-mv.c clang/test/CodeGen/target-builtin-noerror.c clang/test/Driver/x86-march.c clang/test/Misc/target-invalid-cpu-note.c clang/test/Preprocessor/predefined-arch-macros.c compiler-rt/lib/builtins/cpu_model.c llvm/docs/ReleaseNotes.rst llvm/include/llvm/Support/X86TargetParser.def llvm/include/llvm/Support/X86TargetParser.h llvm/lib/Support/Host.cpp llvm/lib/Support/X86TargetParser.cpp llvm/lib/Target/X86/X86.td llvm/test/CodeGen/X86/cpus-intel.ll Index: llvm/test/CodeGen/X86/cpus-intel.ll === --- llvm/test/CodeGen/X86/cpus-intel.ll +++ llvm/test/CodeGen/X86/cpus-intel.ll @@ -17,6 +17,9 @@ ; 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=sierraforest 2>&1 | FileCheck %s --check-prefix=CHECK-NO-ERROR --allow-empty +; RUN: llc < %s -o /dev/null -mtriple=i686-unknown-unknown -mcpu=grandridge 2>&1 | FileCheck %s --check-prefix=CHECK-NO-ERROR --allow-empty +; RUN: llc < %s -o /dev/null -mtriple=i686-unknown-unknown -mcpu=graniterapids 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 +55,9 @@ ; 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=sierraforest 2>&1 | FileCheck %s --check-prefix=CHECK-NO-ERROR --allow-empty +; RUN: llc < %s -o /dev/null -mtriple=x86_64-unknown-unknown -mcpu=grandridge 2>&1 | FileCheck %s --check-prefix=CHECK-NO-ERROR --allow-empty +; RUN: llc < %s -o /dev/null -mtriple=x86_64-unknown-unknown -mcpu=graniterapids 2>&1 | FileCheck %s --check-prefix=CHECK-NO-ERROR --allow-empty define void @foo() { ret void Index: llvm/lib/Target/X86/X86.td === --- llvm/lib/Target/X86/X86.td +++ llvm/lib/Target/X86/X86.td @@ -943,6 +943,14 @@ list SPRFeatures = !listconcat(ICXFeatures, SPRAdditionalFeatures); + // Graniterapids + list GNRAdditionalFeatures = [FeatureAMXTILE, + FeatureAMXINT8, + FeatureAMXBF16, + FeatureBF16]; + list GNRFeatures = +!listconcat(SPRFeatures, GNRAdditionalFeatures); + // Atom list AtomFeatures = [FeatureX87, FeatureCX8, @@ -1050,6 +1058,19 @@ list ADLFeatures = !listconcat(TRMFeatures, ADLAdditionalFeatures); + // Sierraforest + list SRFAdditionalFeatures = [FeatureCMPCCXADD, + FeatureAVXIFMA, + FeatureAVXNECONVERT, + FeatureAVXVNNIINT8]; + list SRFFeatures = +!listconcat(ADLFeatures, SRFAdditionalFeatures); + + // Grandridge + list GRRAdditionalFeatures = [FeatureRAOINT]; + list GRRFeatures = +!listconcat(SRFFeatures, GRRAdditionalFeatures); + // Knights Landing list KNLFeatures = [FeatureX87, FeatureCX8, @@ -1441,6 +1462,10 @@ ProcessorFeatures.GLPTuning>; def : ProcModel<"tremont", SLMModel, ProcessorFeatures.TRMFeatures, ProcessorFeatures.TRMTuning>; +def : ProcModel<"sierraforest", AlderlakePModel, ProcessorFeatures.SRFFeatures, +ProcessorFeatures.TRMTuning>; +def : ProcModel<"grandridge", AlderlakePModel, ProcessorFeatures.GRRFeatures, +ProcessorFeatures.TRMTuning>; // "Arrandale" along with corei3 and corei5
[PATCH] D137153: [WIP][X86] Support -march=sierraforest, grandridge, graniterapids.
RKSimon added inline comments. Comment at: llvm/lib/Target/X86/X86.td:1528 +ProcessorFeatures.TRMTuning>; +def : ProcModel<"grandridge", SLMModel, ProcessorFeatures.GRRFeatures, +ProcessorFeatures.TRMTuning>; SLMModel explicitly doesn't have support for AVX/AVX2 - I think you should investigate forking SLMModel and creating a AlderlakeEModel for all of these Also, should these be here or moved up below tremont and the other atom cores? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D137153/new/ https://reviews.llvm.org/D137153 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D137153: [WIP][X86] Support -march=sierraforest, grandridge, graniterapids.
FreddyYe added inline comments. Comment at: llvm/include/llvm/Support/X86TargetParser.def:94 +X86_CPU_SUBTYPE(AMDFAM19H_ZNVER4,"znver4") +X86_CPU_SUBTYPE(INTEL_COREI7_SIERRAFOREST, "sierraforest") +X86_CPU_SUBTYPE(INTEL_COREI7_GRANITERAPIDS, "graniterapids") FreddyYe wrote: > FYI: gcc is going to land the [[ > https://gcc.gnu.org/pipermail/gcc-patches/2022-October/603547.html | > sierraforest patch ]]. They are going to add such E-core based CPUs to > CPU_TYPE list but not this one, like the previous atom series e.g. tremont, > silvermont and so on. It's functionally correct, so I'm ok to this change. > WDYT > FYI: gcc is going to land the [[ > https://gcc.gnu.org/pipermail/gcc-patches/2022-October/603547.html | > sierraforest patch ]]. They are going to add such E-core based CPUs to > CPU_TYPE list but not this one, like the previous atom series e.g. tremont, > silvermont and so on. It's functionally correct, so I'm ok to this change. > WDYT ping. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D137153/new/ https://reviews.llvm.org/D137153 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D137153: [WIP][X86] Support -march=sierraforest, grandridge, graniterapids.
FreddyYe added inline comments. Comment at: llvm/include/llvm/Support/X86TargetParser.def:94 +X86_CPU_SUBTYPE(AMDFAM19H_ZNVER4,"znver4") +X86_CPU_SUBTYPE(INTEL_COREI7_SIERRAFOREST, "sierraforest") +X86_CPU_SUBTYPE(INTEL_COREI7_GRANITERAPIDS, "graniterapids") FYI: gcc is going to land the [[ https://gcc.gnu.org/pipermail/gcc-patches/2022-October/603547.html | sierraforest patch ]]. They are going to add such E-core based CPUs to CPU_TYPE list but not this one, like the previous atom series e.g. tremont, silvermont and so on. It's functionally correct, so I'm ok to this change. WDYT Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D137153/new/ https://reviews.llvm.org/D137153 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits