This is an archive of the discontinued LLVM Phabricator instance.

[AMDGPU] Add support for architected flat scratch
ClosedPublic

Authored by rampitec on May 13 2021, 12:00 PM.

Details

Summary

Add support for the readonly flat Scratch register initialized
by the SPI.

Diff Detail

Event Timeline

rampitec created this revision.May 13 2021, 12:00 PM
rampitec requested review of this revision.May 13 2021, 12:00 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 13 2021, 12:00 PM
Herald added a subscriber: wdng. · View Herald Transcript
rampitec updated this revision to Diff 345252.May 13 2021, 12:31 PM
t-tye added inline comments.May 13 2021, 2:07 PM
llvm/lib/Target/AMDGPU/SIFrameLowering.cpp
496–504

Does the architected flat scratch register pair also need to be made live in when scratch is enabled and architected flat scratch is supported?

rampitec added inline comments.May 13 2021, 2:12 PM
llvm/lib/Target/AMDGPU/SIFrameLowering.cpp
496–504

No, it does not. It is unallocatable anyway.

t-tye accepted this revision.May 13 2021, 2:38 PM

The documentation parts LGTM.

This revision is now accepted and ready to land.May 13 2021, 2:38 PM
arsenm added inline comments.May 13 2021, 4:08 PM
llvm/lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp
727–728

Presumably this is a reserved register which we wouldn't need to add to liveins?

rampitec marked an inline comment as done.May 13 2021, 4:16 PM
rampitec added inline comments.
llvm/lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp
727–728

It's not a flat scratch, that is SGPR to init it. We normally add the livein in the emitEntryFunctionFlatScratchInit().

kzhuravl accepted this revision.May 13 2021, 6:10 PM

LGTM, but please run clang-format, thanks!

rampitec updated this revision to Diff 345485.May 14 2021, 10:35 AM
rampitec marked an inline comment as done.

clang-formatted.

This revision was landed with ongoing or failed builds.May 14 2021, 10:53 AM
This revision was automatically updated to reflect the committed changes.