[PATCH] D102401: [AMDGPU] Allocate LDS globals in sorted order of their alignment and size.

Mahesha S via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 17 10:11:03 PDT 2021


hsmhsm added a comment.

In D102401#2763893 <https://reviews.llvm.org/D102401#2763893>, @arsenm wrote:

> In D102401#2763869 <https://reviews.llvm.org/D102401#2763869>, @hsmhsm wrote:
>
>> (1) infer and fix LDS alignment
>> (2) update the align attribute of LDS globals and LDS memory operations based on above (1)
>>
>> But, sorting of per kernel used LDS globals can be achieved only in codegen pass as did in this patch. The reason for this is - I do not see any neat way to pass some analysis result which is built in IR pass on top of IR to codegen pass.
>
> If you rewrite all the accesses relative to a single LDS global, there's nothing for codegen to sort.

But, do we have any immediate available neat solution(s) which will make sure that all the LDS globals which are used within a kernel  is replaced by single struct (or something else) instance? We are struggling with it for a long. Probably, if we solve that problem in near future, then this patch becomes kind of irrelavent and we can revert it at that point, until then, this patch is essential for the immediate need. But, probably let's move all the utility code from AMDGPUMachineFunction  to utility file.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D102401/new/

https://reviews.llvm.org/D102401



More information about the llvm-commits mailing list