[llvm] [AMDGPU] Compiler should synthesize private buffer resource descriptor from flat_scratch_init (PR #79586)

Scott Linder via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 6 11:25:54 PST 2024


slinder1 wrote:

> > (Sorry for adding more nits after initial review)
> > I'm a bit confused about the goal; does this patch just pave the way to actually stop requesting the preloaded RSRC in some cases in the future?
> 
> Yep. It currently avoids using the preloaded RSRC if the FlatScratchInit is available as RSRC low 64 bits repeat the FlatScratchInit and the hi 64 bits are known const value. However, I still have no idea how to instruct runtime not to set s[0:3] up with the preloaded values in case the whole 128 bits are effectively synthesized in a compile time.

Ah, makes sense; I'm assuming you've seen this, but just in case we do ENABLE_SGPR_PRIVATE_SEGMENT_BUFFER (see https://llvm.org/docs/AMDGPUUsage.html#code-object-v3-kernel-descriptor) which might help. If this simply doesn't work (or isn't always available) then I'm similarly not certain how one achieves this uniformly.

Also, linking to AMDGPUUsage reminded me that we do document the initial SRSRC setup at https://llvm.org/docs/AMDGPUUsage.html#private-segment-buffer . Would you be able to update that as part of the patch? It lives at `llvm/docs/AMDGPUUsage.rst`. At the very least a FIXME/WARNING in there would be good so we don't mislead anyone while we work out the specifics.




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


More information about the llvm-commits mailing list