[llvm] [AMDGPU] Keep scavenger FI out of SGPR spill stack ID (PR #197628)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Thu May 14 01:25:25 PDT 2026


https://github.com/arsenm commented:

PrologEpilogInserter should not be processing SGPR spills as spills to VGPR, and they need to go through the memory VGPR path. 

I see 2 problems here:

1. This particular instance is failing on a frame index used by s_lshl3_add_u32. There is a missed optimization here. This can have special case handling in eliminateFrameIndex like we do for add. This would avoid the need for a spill in this instance. 
2. The current stack ID management is hacky. Code just creates the stack ID, and then the ID is lazily assigned when accessed. It would make much more sense if the stack ID was set at frame index creation time. Then the spill lowering logic could switch between the to-VGPR and to-memory case based on the stack ID. You seem to be trying to figure out based on other context how the spill needs to be handled 


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


More information about the llvm-commits mailing list