AMDGPU/GlobalISel: Add copyCost for VGPR->SGPR copies

Patch by Tom Stellard

llvm-svn: 326467
This commit is contained in:
Matt Arsenault 2018-03-01 19:09:25 +00:00
parent 3f6a204eaa
commit 51b0b20023
1 changed files with 7 additions and 4 deletions

View File

@ -50,10 +50,13 @@ AMDGPURegisterBankInfo::AMDGPURegisterBankInfo(const TargetRegisterInfo &TRI)
}
unsigned AMDGPURegisterBankInfo::copyCost(const RegisterBank &A,
const RegisterBank &B,
unsigned AMDGPURegisterBankInfo::copyCost(const RegisterBank &Dst,
const RegisterBank &Src,
unsigned Size) const {
return RegisterBankInfo::copyCost(A, B, Size);
if (Dst.getID() == AMDGPU::SGPRRegBankID &&
Src.getID() == AMDGPU::VGPRRegBankID)
return std::numeric_limits<unsigned>::max();
return RegisterBankInfo::copyCost(Dst, Src, Size);
}
const RegisterBank &AMDGPURegisterBankInfo::getRegBankFromRegClass(