This is an archive of the discontinued LLVM Phabricator instance.

[X86] Support -march=sierraforest, grandridge, graniterapids.
ClosedPublic

Authored by FreddyYe on Nov 1 2022, 3:45 AM.

Diff Detail

Event Timeline

FreddyYe created this revision.Nov 1 2022, 3:45 AM
Herald added a project: Restricted Project. · View Herald TranscriptNov 1 2022, 3:45 AM
FreddyYe requested review of this revision.Nov 1 2022, 3:45 AM
Herald added projects: Restricted Project, Restricted Project, Restricted Project. · View Herald TranscriptNov 1 2022, 3:45 AM
Herald added subscribers: llvm-commits, Restricted Project, cfe-commits. · View Herald Transcript
FreddyYe retitled this revision from [X86] Support -march=sierraforest, grandridge, graniterapids. to [WIP][X86] Support -march=sierraforest, grandridge, graniterapids..Nov 1 2022, 3:45 AM
Matt added a subscriber: Matt.Nov 1 2022, 5:53 PM
FreddyYe added inline comments.Nov 3 2022, 1:28 AM
llvm/include/llvm/Support/X86TargetParser.def
96

FYI: gcc is going to land the 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

FreddyYe added inline comments.Nov 3 2022, 1:29 AM
llvm/include/llvm/Support/X86TargetParser.def
96

FYI: gcc is going to land the 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.

RKSimon added inline comments.Nov 3 2022, 3:14 AM
llvm/lib/Target/X86/X86.td
1532

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?

FreddyYe updated this revision to Diff 474132.Nov 8 2022, 5:58 PM
FreddyYe marked an inline comment as done.

Address comments.

FreddyYe updated this revision to Diff 474138.Nov 8 2022, 6:35 PM

Rebase and add missing supports in cpu_model.c

FreddyYe retitled this revision from [WIP][X86] Support -march=sierraforest, grandridge, graniterapids. to [X86] Support -march=sierraforest, grandridge, graniterapids..Nov 8 2022, 6:36 PM
FreddyYe added inline comments.
llvm/lib/Target/X86/X86.td
1532

Yeah, SLMModel's coverage is not right here. From view of coverage, AlderlakePModel is better here. Maybe we could use AlderlakePModel first? When sierraforest and grandridge's instruction perf info is more detailed or we can test from a real machine, we can then add a new Model and replaced here. Same for SRFTuning and GRRTuning.

gcc has landed related patch: Sierraforest, Graniterapids and Grandrdige. We can follow their CPU list order now.

FreddyYe updated this revision to Diff 474140.Nov 8 2022, 6:42 PM

Added ZHAOXIN_FAM7H.

pengfei added inline comments.Nov 8 2022, 7:58 PM
llvm/include/llvm/Support/X86TargetParser.def
96

Is this to match with GCC?

llvm/lib/Support/X86TargetParser.cpp
385

Is VP2INTERSECT supported by graniterapids?

FreddyYe updated this revision to Diff 474146.Nov 8 2022, 8:04 PM
FreddyYe marked 2 inline comments as done.

Address comments. THX for review!

skan added inline comments.Nov 8 2022, 10:11 PM
llvm/lib/Target/X86/X86.td
949

Why is this differnt from FeaturesGraniteRapids in X86TargetParser.cpp?

FreddyYe updated this revision to Diff 474155.Nov 8 2022, 10:14 PM
FreddyYe marked an inline comment as done.

Address comments. THX fore review!

llvm/include/llvm/Support/X86TargetParser.def
96

Yes.

llvm/lib/Target/X86/X86.td
949

Good catch!

pengfei accepted this revision.Nov 8 2022, 10:53 PM

LGTM.

This revision is now accepted and ready to land.Nov 8 2022, 10:53 PM
skan accepted this revision.Nov 8 2022, 10:56 PM
MaskRay accepted this revision.Nov 8 2022, 11:43 PM
MaskRay added a subscriber: MaskRay.

Drop trailing period from subject.

clang/test/Preprocessor/predefined-arch-macros.c
1792

Prefer --target= to legacy -target for new tests.

Consider refactoring the long CHECK lines to use delta encoding:

RUN: ... | FileCheck %s --check-prefixes=A
RUN: ... | FileCheck %s --check-prefixes=A,B
RUN: ... | FileCheck %s --check-prefixes=A,B,C

for better maintenance.

This revision was landed with ongoing or failed builds.Nov 9 2022, 12:56 AM
This revision was automatically updated to reflect the committed changes.