AMDGPU: Merge if and switch

llvm-svn: 249082
This commit is contained in:
Matt Arsenault 2015-10-01 21:51:59 +00:00
parent db7f0ef367
commit d2c7589f93
1 changed files with 18 additions and 15 deletions

View File

@ -278,27 +278,30 @@ void AMDGPUAsmPrinter::getSIProgramInfo(SIProgramInfo &ProgInfo,
unsigned width = 0;
bool isSGPR = false;
if (!MO.isReg()) {
if (!MO.isReg())
continue;
}
unsigned reg = MO.getReg();
if (reg == AMDGPU::VCC || reg == AMDGPU::VCC_LO ||
reg == AMDGPU::VCC_HI) {
VCCUsed = true;
continue;
} else if (reg == AMDGPU::FLAT_SCR ||
reg == AMDGPU::FLAT_SCR_LO ||
reg == AMDGPU::FLAT_SCR_HI) {
FlatUsed = true;
continue;
}
unsigned reg = MO.getReg();
switch (reg) {
default: break;
case AMDGPU::SCC:
case AMDGPU::EXEC:
case AMDGPU::SCC:
case AMDGPU::M0:
continue;
case AMDGPU::VCC:
case AMDGPU::VCC_LO:
case AMDGPU::VCC_HI:
VCCUsed = true;
continue;
case AMDGPU::FLAT_SCR:
case AMDGPU::FLAT_SCR_LO:
case AMDGPU::FLAT_SCR_HI:
FlatUsed = true;
continue;
default:
break;
}
if (AMDGPU::SReg_32RegClass.contains(reg)) {