[PATCH] D94395: [X86] AMD Zen 3 Scheduler Model

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 21 12:29:48 PDT 2021


lebedev.ri updated this revision to Diff 339343.
lebedev.ri retitled this revision from "[X86] AMD Znver3 Scheduler descriptions and llvm-mca tests" to "[X86] AMD Zen 3 Scheduler Model".
lebedev.ri edited the summary of this revision.
lebedev.ri added a comment.
Herald added a subscriber: javed.absar.

Alright, here we go. I think this is the state for inclusion.
@RKSimon @GGanesh @craig.topper please stamp is satisfied.

---

This is fully built from scratch, from llvm-mca measurements
and documented reference materials.
Nothing was copied from `znver2`/`znver1`.

I believe this is in a reasonable state of completion
for initial inclusion probably better than D52779 <https://reviews.llvm.org/D52779> `bdver2` was :)

Namely:

- uops are pretty spot-on (at least what llvm-mca can measure) F16422596: uops-clusters.html <https://reviews.llvm.org/F16422596>
- latency is also pretty spot-on (at least what llvm-mca can measure) F16422601: latency-clusters.html <https://reviews.llvm.org/F16422601>
- throughput is within reason, at least for non-memory instructions F16422607: inverse_throughput-clusters.html <https://reviews.llvm.org/F16422607>

I'll call out the obvious problems there:

- i didn't really bother with X87 instructions
- i didn't really bother with obviously-microcoded/system instructions
- There are large discrepancy in throughput for memory instructions. I'm not really sure if it's a modelling defect that needs to be fixed, or it's a defect of measurements.
- Pipe distributions are probably bad :) I can't do too much here until AMD allows that to be fixed by documenting the appropriate counters and updating libpfm

Things that aren't there:

- Various tunings: zero idioms, etc. That is follow-ups.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D94395/new/

https://reviews.llvm.org/D94395

Files:
  llvm/lib/Target/X86/X86.td
  llvm/lib/Target/X86/X86PfmCounters.td
  llvm/lib/Target/X86/X86ScheduleZnver3.td
  llvm/test/CodeGen/X86/slow-unaligned-mem.ll
  llvm/test/CodeGen/X86/x86-64-double-shifts-var.ll
  llvm/test/tools/llvm-mca/X86/Znver3/partial-reg-update-2.s
  llvm/test/tools/llvm-mca/X86/Znver3/partial-reg-update-3.s
  llvm/test/tools/llvm-mca/X86/Znver3/partial-reg-update-4.s
  llvm/test/tools/llvm-mca/X86/Znver3/partial-reg-update-5.s
  llvm/test/tools/llvm-mca/X86/Znver3/partial-reg-update-6.s
  llvm/test/tools/llvm-mca/X86/Znver3/partial-reg-update-7.s
  llvm/test/tools/llvm-mca/X86/Znver3/partial-reg-update.s
  llvm/test/tools/llvm-mca/X86/Znver3/resources-adx.s
  llvm/test/tools/llvm-mca/X86/Znver3/resources-aes.s
  llvm/test/tools/llvm-mca/X86/Znver3/resources-avx1.s
  llvm/test/tools/llvm-mca/X86/Znver3/resources-avx2.s
  llvm/test/tools/llvm-mca/X86/Znver3/resources-bmi1.s
  llvm/test/tools/llvm-mca/X86/Znver3/resources-bmi2.s
  llvm/test/tools/llvm-mca/X86/Znver3/resources-clflushopt.s
  llvm/test/tools/llvm-mca/X86/Znver3/resources-clzero.s
  llvm/test/tools/llvm-mca/X86/Znver3/resources-cmov.s
  llvm/test/tools/llvm-mca/X86/Znver3/resources-cmpxchg.s
  llvm/test/tools/llvm-mca/X86/Znver3/resources-f16c.s
  llvm/test/tools/llvm-mca/X86/Znver3/resources-fma.s
  llvm/test/tools/llvm-mca/X86/Znver3/resources-fsgsbase.s
  llvm/test/tools/llvm-mca/X86/Znver3/resources-lea.s
  llvm/test/tools/llvm-mca/X86/Znver3/resources-lzcnt.s
  llvm/test/tools/llvm-mca/X86/Znver3/resources-mmx.s
  llvm/test/tools/llvm-mca/X86/Znver3/resources-movbe.s
  llvm/test/tools/llvm-mca/X86/Znver3/resources-mwaitx.s
  llvm/test/tools/llvm-mca/X86/Znver3/resources-pclmul.s
  llvm/test/tools/llvm-mca/X86/Znver3/resources-popcnt.s
  llvm/test/tools/llvm-mca/X86/Znver3/resources-prefetchw.s
  llvm/test/tools/llvm-mca/X86/Znver3/resources-rdrand.s
  llvm/test/tools/llvm-mca/X86/Znver3/resources-rdseed.s
  llvm/test/tools/llvm-mca/X86/Znver3/resources-sha.s
  llvm/test/tools/llvm-mca/X86/Znver3/resources-sse1.s
  llvm/test/tools/llvm-mca/X86/Znver3/resources-sse2.s
  llvm/test/tools/llvm-mca/X86/Znver3/resources-sse3.s
  llvm/test/tools/llvm-mca/X86/Znver3/resources-sse41.s
  llvm/test/tools/llvm-mca/X86/Znver3/resources-sse42.s
  llvm/test/tools/llvm-mca/X86/Znver3/resources-sse4a.s
  llvm/test/tools/llvm-mca/X86/Znver3/resources-ssse3.s
  llvm/test/tools/llvm-mca/X86/Znver3/resources-x86_32.s
  llvm/test/tools/llvm-mca/X86/Znver3/resources-x86_64.s
  llvm/test/tools/llvm-mca/X86/Znver3/resources-x87.s
  llvm/test/tools/llvm-mca/X86/cpus.s
  llvm/test/tools/llvm-mca/X86/in-order-cpu.s
  llvm/test/tools/llvm-mca/X86/read-after-ld-1.s
  llvm/test/tools/llvm-mca/X86/register-file-statistics.s
  llvm/test/tools/llvm-mca/X86/scheduler-queue-usage.s



More information about the llvm-commits mailing list