This is an archive of the discontinued LLVM Phabricator instance.

[AMDGPU] Set optional PAL metadata
ClosedPublic

Authored by sebastian-ne on Jun 29 2021, 6:43 AM.

Details

Summary

Set informational fields in the .shader_functions table.

Also correct the documentation, .scratch_memory_size and .lds_size are
integers.

Diff Detail

Event Timeline

sebastian-ne created this revision.Jun 29 2021, 6:43 AM
sebastian-ne requested review of this revision.Jun 29 2021, 6:43 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 29 2021, 6:43 AM
foad added inline comments.Jun 29 2021, 6:54 AM
llvm/lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp
1406

Is this the number of vgprs that are actually used by the generated ISA? From the name "NumVGPRsForWavesPerEU" it sounds like it might be the maximum number that could be used while still achieving some specified occupancy.

sebastian-ne added inline comments.Jun 29 2021, 6:59 AM
llvm/lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp
1406

I’m not sure either by looking at the name.
But it seems to be the number of used registers, at least in the test case.
Also, this variable is used to set the normal .vgpr_count too (with normal, I mean the .vgpr_count that we already set, in contrast to the one in .shader_functions, which is added here).

sebastian-ne added inline comments.Jul 6 2021, 2:47 AM
llvm/lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp
1406

I looked a bit more, NumVGPRsForWavesPerEU is the amount of VGPRs used by the ISA, except if the function attribute amdgpu-waves-per-eu sets a *maximum* of waves per eu. Then NumVGPRsForWavesPerEU will be raised artificially, so that no more waves than specified fit in.
I guess this is a fair thing to do.
(For the record, if it is not obvious from the comments somewhere, .vgpr_count is only used by tools like RGP and does not affect actual execution.)

foad accepted this revision.Jul 6 2021, 2:54 AM
This revision is now accepted and ready to land.Jul 6 2021, 2:54 AM
This revision was landed with ongoing or failed builds.Jul 6 2021, 2:59 AM
This revision was automatically updated to reflect the committed changes.