[PATCH] D155125: [amdgpu][lds] Introduce LDS frame size function attribute
Jon Chesterfield via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Jul 12 15:11:47 PDT 2023
JonChesterfield added a comment.
As a standalone patch, this makes the compiler slightly slower and introduces a fatal error where there previously wasn't one. I'd still like to land it ahead of removing allocateKnownAddressLDSGlobal as it's easier to sanity check the test changes in isolation.
================
Comment at: llvm/lib/Target/AMDGPU/AMDGPULowerModuleLDSPass.cpp:1210
{
const DataLayout &DL = M.getDataLayout();
----------------
Currently this frame layout is passed in as hoc fashion based on kernel structs having a name derived from the corresponding kernel.
However the backend doesn't actually need the exact frame layout because the globals also have absolute_address metadata on them.
Introduce an attribute (name chosen to be similar to amdgpu-gds-size) which records the frame size.
================
Comment at: llvm/lib/Target/AMDGPU/AMDGPUMachineFunction.cpp:124
if (isModuleEntryFunction()) {
----------------
This frame logic will be deleted in a subsequent patch, leaving only amdgpu-lds-size as the lookup. At that point it can probably move to the function constructor and this allocate known address function can be deleted.
In the first instance, add a fatal error if the different accounting have gone awry. Landing this patch (and watching it go through internal CI) is supporting evidence that the two data representations are equivalent.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D155125/new/
https://reviews.llvm.org/D155125
More information about the llvm-commits
mailing list