[PATCH] D115551: [AMDGPU] Do not reserve any VGPR for SGPR spills

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 10 17:38:30 PST 2022


arsenm added inline comments.


================
Comment at: llvm/test/CodeGen/AMDGPU/sgpr-spills-split-regalloc.ll:212
+
+define void @spill_sgpr_no_free_vgpr(<4 x i32> addrspace(1)* %out, <4 x i32> addrspace(1)* %in) #0 {
   %a = load <4 x i32>, <4 x i32> addrspace(1)* %in
----------------
ruiling wrote:
> I don't quite understand the patch, but this is an obvious regression. the generated code is pretty bad for this case. Is there any possible way to still use vgpr for sgpr spill for such kind of case?
It's -O0 so we basically don't care about the code quality at all, plus it's a torture test.

Since the register allocation is split now, it will try to use a VGPR if it can find a free one. With the current limitation that we have to reserve VGPRs for SGPR spills, and that the test heavily constrained the available VGPRs, it won't find a free one to use.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D115551



More information about the llvm-commits mailing list