[AMDGPU] Remove dead frame indices after sgpr spill.
authorhsmahesha <mahesha.comp@gmail.com>
Tue, 12 Oct 2021 04:28:34 +0000 (09:58 +0530)
committerhsmahesha <mahesha.comp@gmail.com>
Tue, 12 Oct 2021 04:28:49 +0000 (09:58 +0530)
commit52cb3af08c2ac917557d67bbbf8a91cb80bed6fc
tree5ff092ef67ee5a5419639aca8c599461bcc79ab3
parent325d000765eaaf547e775d4018ec8c92cb65a768
[AMDGPU] Remove dead frame indices after sgpr spill.

All those frame indices which are dead after sgpr spill should be removed from
the function frame. Othewise, there is a side effect such as re-mapping of free
frame index ids by the later pass(es) like "stack slot coloring" which in turn
could mess-up with the book keeping of "frame index to VGPR lane".

Reviewed By: cdevadas

Differential Revision: https://reviews.llvm.org/D111150
llvm/lib/Target/AMDGPU/SILowerSGPRSpills.cpp
llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.cpp
llvm/lib/Target/AMDGPU/SIRegisterInfo.cpp
llvm/test/CodeGen/AMDGPU/sgpr-spill-incorrect-fi-bookkeeping-bug.ll [new file with mode: 0644]