]> granicus.if.org Git - llvm/commit
AMDGPU: Handle frame index expansion with no free SGPRs pre gfx9
authorMatt Arsenault <Matthew.Arsenault@amd.com>
Wed, 4 Sep 2019 17:12:57 +0000 (17:12 +0000)
committerMatt Arsenault <Matthew.Arsenault@amd.com>
Wed, 4 Sep 2019 17:12:57 +0000 (17:12 +0000)
commit1305215be7e3d7b47569a49e90553041cc942f40
tree1290791b6e5a40f110f563a6b620e2a646ae2051
parent4830ba660b6a41743468cc77aab3bd41ddca505b
AMDGPU: Handle frame index expansion with no free SGPRs pre gfx9

Since an add instruction must produce an unused carry out, this
requires additional SGPRs. This can be avoided by keeping the entire
offset computation in SGPRs. If one SGPR is still available, this only
costs one extra mov. If none are available, the entire computation can
be done in place and reversed.

This does assume the use is a VGPR operand. This was already assumed,
and we currently only select frame indexes to VALU instructions. This
should probably be fixed at some point to handle more possible MIR.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370929 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/AMDGPU/SIInstrInfo.cpp
lib/Target/AMDGPU/SIRegisterInfo.cpp
test/CodeGen/AMDGPU/pei-scavenge-sgpr-carry-out.mir [new file with mode: 0644]