mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-26 04:32:44 +01:00
AMDGPU: Remove error on call in AsmPrinter
Partial revert of r301938 which is making it harder to split patches up. llvm-svn: 304418
This commit is contained in:
parent
d5a85185d2
commit
d9495dca77
@ -503,40 +503,37 @@ AMDGPUAsmPrinter::SIFunctionResourceInfo AMDGPUAsmPrinter::analyzeResourceUsage(
|
||||
Info.HasDynamicallySizedStack = FrameInfo.hasVarSizedObjects();
|
||||
Info.PrivateSegmentSize = FrameInfo.getStackSize();
|
||||
|
||||
if (!FrameInfo.hasCalls()) {
|
||||
Info.UsesVCC = MRI.isPhysRegUsed(AMDGPU::VCC_LO) ||
|
||||
MRI.isPhysRegUsed(AMDGPU::VCC_HI);
|
||||
|
||||
// If there are no calls, MachineRegisterInfo can tell us the used register
|
||||
// count easily.
|
||||
Info.UsesVCC = MRI.isPhysRegUsed(AMDGPU::VCC_LO) ||
|
||||
MRI.isPhysRegUsed(AMDGPU::VCC_HI);
|
||||
|
||||
MCPhysReg HighestVGPRReg = AMDGPU::NoRegister;
|
||||
for (MCPhysReg Reg : reverse(AMDGPU::VGPR_32RegClass.getRegisters())) {
|
||||
if (MRI.isPhysRegUsed(Reg)) {
|
||||
HighestVGPRReg = Reg;
|
||||
break;
|
||||
}
|
||||
// If there are no calls, MachineRegisterInfo can tell us the used register
|
||||
// count easily.
|
||||
|
||||
MCPhysReg HighestVGPRReg = AMDGPU::NoRegister;
|
||||
for (MCPhysReg Reg : reverse(AMDGPU::VGPR_32RegClass.getRegisters())) {
|
||||
if (MRI.isPhysRegUsed(Reg)) {
|
||||
HighestVGPRReg = Reg;
|
||||
break;
|
||||
}
|
||||
|
||||
MCPhysReg HighestSGPRReg = AMDGPU::NoRegister;
|
||||
for (MCPhysReg Reg : reverse(AMDGPU::SGPR_32RegClass.getRegisters())) {
|
||||
if (MRI.isPhysRegUsed(Reg)) {
|
||||
HighestSGPRReg = Reg;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// We found the maximum register index. They start at 0, so add one to get the
|
||||
// number of registers.
|
||||
Info.NumVGPR = HighestVGPRReg == AMDGPU::NoRegister ? 0 :
|
||||
TRI.getHWRegIndex(HighestVGPRReg) + 1;
|
||||
Info.NumExplicitSGPR = HighestSGPRReg == AMDGPU::NoRegister ? 0 :
|
||||
TRI.getHWRegIndex(HighestSGPRReg) + 1;
|
||||
|
||||
return Info;
|
||||
}
|
||||
|
||||
llvm_unreachable("calls not implemented");
|
||||
MCPhysReg HighestSGPRReg = AMDGPU::NoRegister;
|
||||
for (MCPhysReg Reg : reverse(AMDGPU::SGPR_32RegClass.getRegisters())) {
|
||||
if (MRI.isPhysRegUsed(Reg)) {
|
||||
HighestSGPRReg = Reg;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// We found the maximum register index. They start at 0, so add one to get the
|
||||
// number of registers.
|
||||
Info.NumVGPR = HighestVGPRReg == AMDGPU::NoRegister ? 0 :
|
||||
TRI.getHWRegIndex(HighestVGPRReg) + 1;
|
||||
Info.NumExplicitSGPR = HighestSGPRReg == AMDGPU::NoRegister ? 0 :
|
||||
TRI.getHWRegIndex(HighestSGPRReg) + 1;
|
||||
|
||||
return Info;
|
||||
}
|
||||
|
||||
void AMDGPUAsmPrinter::getSIProgramInfo(SIProgramInfo &ProgInfo,
|
||||
|
Loading…
Reference in New Issue
Block a user