From a07c0778caff02a1048d9a8aeee685b6aa31f36f Mon Sep 17 00:00:00 2001 From: Tom Stellard Date: Thu, 21 Aug 2014 20:40:50 +0000 Subject: [PATCH] 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216216 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/R600/SIRegisterInfo.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lib/Target/R600/SIRegisterInfo.cpp b/lib/Target/R600/SIRegisterInfo.cpp index 2a9a2ac5dd6..531c5047f50 100644 --- a/lib/Target/R600/SIRegisterInfo.cpp +++ b/lib/Target/R600/SIRegisterInfo.cpp @@ -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); }