[llvm] [AMDGPU] Move kernarg preload logic to AMDGPU Attributor (PR #123547)

Austin Kerbow via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 7 12:52:04 PST 2025


kerbowa wrote:

> >  I had a PR up to make AMDGPULowerKernelArguments a module pass, but I think the consensus was that it made sense to unify all the inreg/preload kernarg functionality here.
> 
> 
> 
> I remember that PR. I think that should be the way to go.
> 
> 
> 
> IIUC, @arsenm did mention in https://github.com/llvm/llvm-project/pull/101609 (which is indeed something about `inreg`) that we can probably move the logic _there_, but at that time I thought it runs part of the attributor iterations. I'm not sure if that is a good idea to pile everything in this file.

See also this comment here: https://github.com/llvm/llvm-project/pull/112790#discussion_r1874858127

Eventually it may be possible to do some optimization where we drop the kernarg segment pointer or other optimization in callees related to kernel arguments that requires attributor iterations.

Right now this needs to run after because the number of free user SGPRs depends on attributes on kernels calculated here.

Which parts are you thinking should move, because if it goes back to AMDGPULowerKernelArguments I think everything should move there including the kernel inreg stuff?

https://github.com/llvm/llvm-project/pull/123547


More information about the llvm-commits mailing list