This is an archive of the discontinued LLVM Phabricator instance.

[AMDGPU] Add gfx602, gfx705, gfx805 targets
ClosedPublic

Authored by tpr on Oct 6 2020, 12:35 PM.

Details

Summary

At AMD, in an internal audit of our code, we found some corner cases
where we were not quite differentiating targets enough for some old
hardware. This commit is part of fixing that by adding three new
targets:

  • The "Oland" and "Hainan" variants of gfx601 are now split out into gfx602. LLPC (in the GPUOpen driver) and other front-ends could use that to avoid using the shaderZExport workaround on gfx602.
  • One variant of gfx703 is now split out into gfx705. LLPC and other front-ends could use that to avoid using the shaderSpiCsRegAllocFragmentation workaround on gfx705.
  • The "TongaPro" variant of gfx802 is now split out into gfx805. TongaPro has a faster 64-bit shift than its former friends in gfx802, and a subtarget feature could be set up for that to take advantage of it. This commit does not make that change; it just adds the target.

Change-Id: Ia901a7157eb2f73ccd9f25dbacec38427312377d

Diff Detail

Event Timeline

tpr created this revision.Oct 6 2020, 12:35 PM
tpr requested review of this revision.Oct 6 2020, 12:35 PM

Missing clang changes.

llvm/lib/Support/TargetParser.cpp
112

Don't we want to have it sorted?

t-tye added inline comments.Oct 6 2020, 7:15 PM
llvm/lib/Support/TargetParser.cpp
112

I would put them in order.

llvm/lib/Target/AMDGPU/GCNProcessors.td
31–53

Put in order.

foad added a subscriber: foad.Oct 7 2020, 12:37 AM
tpr added inline comments.Oct 7 2020, 1:58 AM
llvm/lib/Target/AMDGPU/GCNProcessors.td
31–53

What order do you want here?

t-tye added inline comments.Oct 7 2020, 2:01 AM
llvm/lib/Target/AMDGPU/GCNProcessors.td
31–53

Sorry, I missed that these were the names aliases for the same version so ignore this comment.

tpr updated this revision to Diff 296623.Oct 7 2020, 2:07 AM

V2: Add clang changes. Put TargetParser list in order.

Herald added a project: Restricted Project. · View Herald TranscriptOct 7 2020, 2:08 AM
tpr marked 3 inline comments as done.Oct 7 2020, 2:08 AM
tpr updated this revision to Diff 296648.Oct 7 2020, 5:37 AM

V3: AMDGCNGPUs table in TargetParser.cpp needs to be in GPUKind order,

so fix the GPUKind order.
This revision is now accepted and ready to land.Oct 7 2020, 11:01 AM
jhenderson added inline comments.Oct 8 2020, 1:00 AM
clang/lib/Basic/Cuda.cpp
1

(aside - this file seems to be missing the copyright header - probably should be fixed separately though)

llvm/tools/llvm-readobj/ELFDumper.cpp
1733

I'm not sure what exactly clang-format is complaining about here, but it might be worth reformatting this enum as requested, possibly as a separate commit, I don't mind.

This revision was landed with ongoing or failed builds.Oct 10 2020, 9:22 AM
This revision was automatically updated to reflect the committed changes.