Do the LDS frame calculation once, in the IR pass, instead of repeating the work in the backend.
Prior to this patch:
The IR lowering pass sets up a per-kernel LDS frame and annotates the variables with absolute_symbol
metadata so that the assembler can build lookup tables out of it. There is a fragile association between
kernel functions and named structs which is used to recompute the frame layout in the backend, with
fatal_errors catching inconsistencies in the second calculation.
After this patch:
The IR lowering pass additionally sets a frame size attribute on kernels. The backend uses the same
absolute_symbol metadata that the assembler uses to place objects within that frame size.
As a transient state, in this patch, the backend _also_ recomputes the frame to check the values are
right, though it doesn't do anything with that information. A following patch will delete the redundant
checks. This is mostly so that CI will provide more comprehensive correctness checking and to improve
signal to noise in this diff.
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.