Skip to content

Commit

Permalink
AMDGPU: Fix clobbering SCC when expanding large offset spill pseudos
Browse files Browse the repository at this point in the history
If we had a large offset which required materializing in a register,
we would emit an s_add_i32, clobbering SCC. Start checking if SCC is
live, and instead use a VGPR offset. For MUBUF, we switch to using
offen. We would do this anyway in a normal load/store with a frame
index, but not for spills.

The same problem still exists in other contexts where we expand frame
indices.

The nasty edge case is when SGPRs are spilled to memory at a large
frame offset where SCC is also clobbered. This requires a second
scavenging index, and also required several patches in the scavenger
to correctly handle multiple recursive scavenge indexes.

An even nastier edge case we still don't support is if we don't have
any free SGPRs. If SCC is live and we don't have any free SGPRs to
save exec, we have no way of flipping exec back and forth without also
clobbering SCC.

Fixes: SWDEV-309419
  • Loading branch information
arsenm committed Feb 7, 2022
1 parent be826cf commit 3197306
Show file tree
Hide file tree
Showing 7 changed files with 8,385 additions and 39 deletions.

0 comments on commit 3197306

Please sign in to comment.