AMDGPU: Scavenge register instead of findUnusedReg
authorMatt Arsenault <Matthew.Arsenault@amd.com>
Thu, 14 Mar 2019 14:19:01 +0000 (14:19 +0000)
committerMatt Arsenault <Matthew.Arsenault@amd.com>
Thu, 14 Mar 2019 14:19:01 +0000 (14:19 +0000)
llvm-svn: 356149

llvm/lib/Target/AMDGPU/SIRegisterInfo.cpp

index 11b03c288a360c7feeb0e2b65aba6aa00df6431a..726e73c7f250e35f7be55c11e6548549f1bea90e 100644 (file)
@@ -564,7 +564,7 @@ void SIRegisterInfo::buildSpillLoadStore(MachineBasicBlock::iterator MI,
     // We don't have access to the register scavenger if this function is called
     // during  PEI::scavengeFrameVirtualRegs().
     if (RS)
-      SOffset = RS->FindUnusedReg(&AMDGPU::SGPR_32RegClass);
+      SOffset = RS->scavengeRegister(&AMDGPU::SGPR_32RegClass, 0, false);
 
     if (SOffset == AMDGPU::NoRegister) {
       // There are no free SGPRs, and since we are in the process of spilling