1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 11:42:57 +01:00

AMDGPU: Error if too many user SGPRs used

llvm-svn: 254332
This commit is contained in:
Matt Arsenault 2015-11-30 21:16:07 +00:00
parent 08cdb00306
commit 3cec06fabe
2 changed files with 8 additions and 0 deletions

View File

@ -401,6 +401,11 @@ void AMDGPUAsmPrinter::getSIProgramInfo(SIProgramInfo &ProgInfo,
ProgInfo.NumSGPR = AMDGPUSubtarget::FIXED_SGPR_COUNT_FOR_INIT_BUG;
}
if (MFI->NumUserSGPRs > STM.getMaxNumUserSGPRs()) {
LLVMContext &Ctx = MF.getFunction()->getContext();
Ctx.emitError("too many user SGPRs used");
}
ProgInfo.VGPRBlocks = (ProgInfo.NumVGPR - 1) / 4;
ProgInfo.SGPRBlocks = (ProgInfo.NumSGPR - 1) / 8;
// Set the value to initialize FP_ROUND and FP_DENORM parts of the mode

View File

@ -303,6 +303,9 @@ public:
return isAmdHsaOS() ? 0 : 36;
}
unsigned getMaxNumUserSGPRs() const {
return 16;
}
};
} // End namespace llvm