This is an archive of the discontinued LLVM Phabricator instance.

[AMDGPU] Autogenerate register asm names
ClosedPublic

Authored by rampitec on Jul 16 2019, 4:09 PM.

Diff Detail

Repository
rL LLVM

Event Timeline

rampitec created this revision.Jul 16 2019, 4:09 PM

With that we can also simplify AMDGPUInstPrinter::printRegOperand(). Also the next step is to rename flat_scr into flat_scratch.

arsenm added inline comments.Jul 16 2019, 4:18 PM
lib/Target/AMDGPU/SIRegisterInfo.td
61 ↗(On Diff #210214)

So this generates too many names, and then the extra SGPR ones just don't work?

634 ↗(On Diff #210214)

This probably shouldn't have a set name, but should be Reg128

rampitec marked 2 inline comments as done.Jul 16 2019, 4:29 PM
rampitec added inline comments.
lib/Target/AMDGPU/SIRegisterInfo.td
61 ↗(On Diff #210214)

It generates a practical minimum of used names with exception of:

  1. It generates overflow names, like v[255:0]. We do not use overflow regs, but in fact we could.
  2. It generates dups for special registers, but there are not too much of them.

Generic names can be dropped in a separate patch in favor of Reg32, but that will be a separate huge tests update. I thought of that but do not want to mix everything into a single change. I am also not sure how mir will live with square brackets and colons.

634 ↗(On Diff #210214)

Thanks, Reg128 indeed.

arsenm accepted this revision.Jul 16 2019, 4:31 PM

LGTM

This revision is now accepted and ready to land.Jul 16 2019, 4:31 PM
rampitec updated this revision to Diff 210217.Jul 16 2019, 4:33 PM

Fixed Reg128.

This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptJul 16 2019, 4:44 PM