Reapply "AMDGPU: Scavenge register instead of findUnusedReg"
authorMatt Arsenault <Matthew.Arsenault@amd.com>
Wed, 27 Mar 2019 17:31:29 +0000 (17:31 +0000)
committerMatt Arsenault <Matthew.Arsenault@amd.com>
Wed, 27 Mar 2019 17:31:29 +0000 (17:31 +0000)
commit7b14b2425d607a97629643fd6d84ee2e64f5554d
treeb675fc195667d734ec92569123300c61ca239e71
parent86e4fc050441dc3338b9d2f54d7263f14dc1a8be
Reapply "AMDGPU: Scavenge register instead of findUnusedReg"

This reapplies r356149, using the correct overload of findUnusedReg
which passes the current iterator.

This worked most of the time, because the scavenger iterator was moved
at the end of the frame index loop in PEI. This would fail if the
spill was the first instruction. This was further hidden by the fact
that the scavenger wasn't passed in for normal frame index
elimination.

llvm-svn: 357098
llvm/lib/Target/AMDGPU/SIRegisterInfo.cpp
llvm/test/CodeGen/AMDGPU/pei-reg-scavenger-position.mir [new file with mode: 0644]