R600/SI: Handle VCC in SIRegisterInfo::getPhysRegSubReg()

This fixes a crash in an ocl conformance test.  The test requries
register spilling and is too big to include.

llvm-svn: 216216
This commit is contained in:
Tom Stellard 2014-08-21 20:40:50 +00:00
parent 33466a745e
commit 11aa80cc4a
1 changed files with 11 additions and 0 deletions

View File

@ -148,6 +148,17 @@ const TargetRegisterClass *SIRegisterInfo::getSubRegClass(
unsigned SIRegisterInfo::getPhysRegSubReg(unsigned Reg,
const TargetRegisterClass *SubRC,
unsigned Channel) const {
switch (Reg) {
case AMDGPU::VCC:
switch(Channel) {
case 0: return AMDGPU::VCC_LO;
case 1: return AMDGPU::VCC_HI;
default: llvm_unreachable("Invalid SubIdx for VCC");
}
break;
}
unsigned Index = getHWRegIndex(Reg);
return SubRC->getRegister(Index + Channel);
}