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

via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 8 07:27:39 PST 2024


alex-t wrote:

> As it stands, this PR is pointless and just increases the instruction count for no benefit. The point was to prune out the resource descriptor in the kernel user SGPRs, which this isn't doing yet. All of the kernel uses of s[0:3] should be removed and shifted down by 4 SGPRs

We had a long email conversation regarding this. Let's try one more time.
My question is - how did you intend to get rid of the using s[0:3]?
The buffer_load/store instructions require V# in 4 adjacent SGPRs. How are you supposed to save SGPRs on SRD uses? We could shorten the SGPRs live ranges by rematerializing the SRD before each use but we are not guaranteed to have free SGPRs after the regalloc is done. We could explicitly construct the SRD from the FlatScratrchInit SGPR pair on each use, but we still need two more SGPRs for the high 64  bits.


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


More information about the llvm-commits mailing list