[llvm] r254332 - AMDGPU: Error if too many user SGPRs used
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Mon Nov 30 13:16:07 PST 2015
Author: arsenm
Date: Mon Nov 30 15:16:07 2015
New Revision: 254332
URL: http://llvm.org/viewvc/llvm-project?rev=254332&view=rev
Log:
AMDGPU: Error if too many user SGPRs used
Modified:
llvm/trunk/lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp
llvm/trunk/lib/Target/AMDGPU/AMDGPUSubtarget.h
Modified: llvm/trunk/lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp?rev=254332&r1=254331&r2=254332&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp (original)
+++ llvm/trunk/lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp Mon Nov 30 15:16:07 2015
@@ -401,6 +401,11 @@ void AMDGPUAsmPrinter::getSIProgramInfo(
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
Modified: llvm/trunk/lib/Target/AMDGPU/AMDGPUSubtarget.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AMDGPU/AMDGPUSubtarget.h?rev=254332&r1=254331&r2=254332&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AMDGPU/AMDGPUSubtarget.h (original)
+++ llvm/trunk/lib/Target/AMDGPU/AMDGPUSubtarget.h Mon Nov 30 15:16:07 2015
@@ -303,6 +303,9 @@ public:
return isAmdHsaOS() ? 0 : 36;
}
+ unsigned getMaxNumUserSGPRs() const {
+ return 16;
+ }
};
} // End namespace llvm
More information about the llvm-commits
mailing list