This is an archive of the discontinued LLVM Phabricator instance.

[X86] Copy X86SchedSkylakeServer.td to X86SchedIceLake.td
ClosedPublic

Authored by RKSimon on Aug 30 2021, 6:03 AM.

Details

Summary

Icelake, Rocketlake and Tigerlake targets currently use the SkylakeServer scheduler model, despite being a later microarchitecture, leading to both reported bugs (PR48110) and discrepancies when comparing llvm-mca reports to other profiling tools (OSACA, uops, uica, etc.). And tbh I'm getting sick of llvm-mca getting blamed for what are backend scheduler model issues :-(

This patch doesn't attempt to fix any of these discrepancies - there should be no changes in codegen - its a setup patch that copies the skx model, renames all the resources, adds the additional ports (but doesn't reference them yet) and updates the llvm-exegesis pfm counter mappings (based off https://sourceforge.net/p/perfmon2/libpfm4/ci/master/tree/lib/events/intel_icl_events.h).

This should make it trivial for anyone with hardware access to use llvm-exegesis reports to iteratively improve the model (my attempts to get hold of a cheap tiger lake box haven't been fruitful yet....).

I haven't included any llvm-mca resource tests, but they are trivial to add once this patch is in place, but I can pre-commit the existing skylake tests if people think its useful (the diff should entirely be the resource renames).

Diff Detail

Event Timeline

RKSimon created this revision.Aug 30 2021, 6:03 AM
RKSimon requested review of this revision.Aug 30 2021, 6:03 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 30 2021, 6:03 AM
Matt added a subscriber: Matt.Aug 30 2021, 6:24 AM
Matt added inline comments.Aug 30 2021, 6:28 AM
llvm/lib/Target/X86/X86.td
615

Nit: Perhaps this should be "IceLake" not "Icelake" (cf. Intel codenames: "Skylake" is one word but "Ice Lake" is two).

RKSimon updated this revision to Diff 369448.Aug 30 2021, 8:28 AM
RKSimon retitled this revision from [X86] Copy X86SchedSkylakeServer.td to X86SchedIcelake.td to [X86] Copy X86SchedSkylakeServer.td to X86SchedIceLake.td.

Icelake -> Ice Lake

This seems reasonable to me.

pengfei accepted this revision.Aug 30 2021, 6:42 PM

Thanks Simon, LGTM.

This revision is now accepted and ready to land.Aug 30 2021, 6:42 PM
courbet accepted this revision.Aug 31 2021, 2:05 AM
courbet added inline comments.
llvm/lib/Target/X86/X86SchedIceLake.td
143 ↗(On Diff #369448)

typo: IceLakeModel.LoadLatency

Thanks everyone

llvm/lib/Target/X86/X86SchedIceLake.td
143 ↗(On Diff #369448)

Nice catch! Thanks.

This revision was automatically updated to reflect the committed changes.
llvm/lib/Target/X86/X86PfmCounters.td