[PATCH] D63628: AMD K10 (Barcelona) Initial Scheduler model

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 20 15:22:40 PDT 2019


lebedev.ri created this revision.
lebedev.ri added reviewers: RKSimon, andreadb, craig.topper, courbet, avt77, spatel, GGanesh.
lebedev.ri added a project: LLVM.
Herald added subscribers: jfb, gbedwell, javed.absar.

Following in footsteps of not-total-failure of the first schedule profile
produced with the new next-gen tools like llvm-exegesis (BdVer2 (Piledriver), D52779 <https://reviews.llvm.org/D52779>),
let's continue the trend.

Here i present the scheduler model for AMD K10 CPU.
Much like with D52779 <https://reviews.llvm.org/D52779>, this is pretty much exclusively based on llvm-exegesis,
with some cross-referencing with some other sources (Agner, AMD SOG).

The time doesn't stand still, llvm-exegesis saw many improvements since
i've originally started looking into BdVer2 model, so this time around it took
not 6 months but just ~3 weeks :S

This is by no means perfect. But i'm actually going to claim that it is in
a comparable or better shape than the BdVer2 model was at the time of commit.

I didn't do any really heavy benchmarking, but i did use "internal" public real-world benchmark
i understand - RawSpeed raw image decoding library <https://github.com/darktable-org/rawspeed>.

| Aggregate      | Wall time change | Total CPU time change |
| min            | -18.4600%        | -15.7800%             |
| max            | 6.9000%          | 6.8900%               |
| median         | -0.9050%         | -0.8950%              |
| average        | -0.8623%         | -0.7703%              |
| sqrt(sum(x^2)) | 0.2624           | 0.2442                |
| cbrt(sum(x^3)) | -0.1775          | -0.1479               |
|

F9329673: graph-wall.png <https://reviews.llvm.org/F9329673>
F9329675: amd-barcelona-rawspeed-stats.txt <https://reviews.llvm.org/F9329675>
So looks like an improvement overall, with some regressions, not unexpectedly.

WARNING: i did not mess with sched model to make numbers good.

Some further cleanup will be needed for sure, i've put my eye on some inconsistencies in sched model,
but i don't feel like cleaning them up right away via `InstRW` because that will relieve immediate pressure
and may delay proper cleanup via splitting `SchedWrite` classes.

I shouldn't promise anything, but i'm hoping to look into AMD K8 afterwards.


Repository:
  rL LLVM

https://reviews.llvm.org/D63628

Files:
  docs/ReleaseNotes.rst
  include/llvm/TableGen/Record.h
  lib/Target/X86/X86.td
  lib/Target/X86/X86ScheduleBarcelona.td
  test/tools/llvm-mca/X86/Barcelona/clear-super-register-1.s
  test/tools/llvm-mca/X86/Barcelona/clear-super-register-2.s
  test/tools/llvm-mca/X86/Barcelona/dependency-breaking-cmp.s
  test/tools/llvm-mca/X86/Barcelona/dependency-breaking-pcmpeq.s
  test/tools/llvm-mca/X86/Barcelona/dependency-breaking-pcmpgt.s
  test/tools/llvm-mca/X86/Barcelona/dependency-breaking-sbb-1.s
  test/tools/llvm-mca/X86/Barcelona/dependency-breaking-sbb-2.s
  test/tools/llvm-mca/X86/Barcelona/int-to-fpu-forwarding-1.s
  test/tools/llvm-mca/X86/Barcelona/int-to-fpu-forwarding-2.s
  test/tools/llvm-mca/X86/Barcelona/int-to-fpu-forwarding-3.s
  test/tools/llvm-mca/X86/Barcelona/load-store-throughput.s
  test/tools/llvm-mca/X86/Barcelona/load-throughput.s
  test/tools/llvm-mca/X86/Barcelona/one-idioms.s
  test/tools/llvm-mca/X86/Barcelona/partial-reg-update-2.s
  test/tools/llvm-mca/X86/Barcelona/partial-reg-update-3.s
  test/tools/llvm-mca/X86/Barcelona/partial-reg-update-4.s
  test/tools/llvm-mca/X86/Barcelona/partial-reg-update-5.s
  test/tools/llvm-mca/X86/Barcelona/partial-reg-update-6.s
  test/tools/llvm-mca/X86/Barcelona/partial-reg-update-7.s
  test/tools/llvm-mca/X86/Barcelona/partial-reg-update.s
  test/tools/llvm-mca/X86/Barcelona/rcu-statistics.s
  test/tools/llvm-mca/X86/Barcelona/read-advance-1.s
  test/tools/llvm-mca/X86/Barcelona/read-advance-2.s
  test/tools/llvm-mca/X86/Barcelona/read-advance-3.s
  test/tools/llvm-mca/X86/Barcelona/reg-move-elimination-1.s
  test/tools/llvm-mca/X86/Barcelona/reg-move-elimination-2.s
  test/tools/llvm-mca/X86/Barcelona/reg-move-elimination-3.s
  test/tools/llvm-mca/X86/Barcelona/reg-move-elimination-4.s
  test/tools/llvm-mca/X86/Barcelona/reg-move-elimination-5.s
  test/tools/llvm-mca/X86/Barcelona/reg-move-elimination-6.s
  test/tools/llvm-mca/X86/Barcelona/resources-3dnow.s
  test/tools/llvm-mca/X86/Barcelona/resources-cmov.s
  test/tools/llvm-mca/X86/Barcelona/resources-cmpxchg.s
  test/tools/llvm-mca/X86/Barcelona/resources-lea.s
  test/tools/llvm-mca/X86/Barcelona/resources-lzcnt.s
  test/tools/llvm-mca/X86/Barcelona/resources-mmx.s
  test/tools/llvm-mca/X86/Barcelona/resources-popcnt.s
  test/tools/llvm-mca/X86/Barcelona/resources-prefetchw.s
  test/tools/llvm-mca/X86/Barcelona/resources-sse1.s
  test/tools/llvm-mca/X86/Barcelona/resources-sse2.s
  test/tools/llvm-mca/X86/Barcelona/resources-sse3.s
  test/tools/llvm-mca/X86/Barcelona/resources-sse4a.s
  test/tools/llvm-mca/X86/Barcelona/resources-x86_32.s
  test/tools/llvm-mca/X86/Barcelona/resources-x86_64.s
  test/tools/llvm-mca/X86/Barcelona/resources-x87.s
  test/tools/llvm-mca/X86/Barcelona/store-throughput.s
  test/tools/llvm-mca/X86/Barcelona/zero-idioms.s
  test/tools/llvm-mca/X86/cpus.s
  test/tools/llvm-mca/X86/read-after-ld-1.s
  test/tools/llvm-mca/X86/register-file-statistics.s
  test/tools/llvm-mca/X86/scheduler-queue-usage.s
  test/tools/llvm-mca/X86/sqrt-rsqrt-rcp-memop.s





More information about the llvm-commits mailing list