AMDGPU: Change unreachable into reported error
authorMatt Arsenault <Matthew.Arsenault@amd.com>
Wed, 17 Jun 2015 20:55:25 +0000 (20:55 +0000)
committerMatt Arsenault <Matthew.Arsenault@amd.com>
Wed, 17 Jun 2015 20:55:25 +0000 (20:55 +0000)
llvm-svn: 239943

llvm/lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp

index 29c2da6..afc6bcb 100644 (file)
@@ -338,8 +338,10 @@ void AMDGPUAsmPrinter::getSIProgramInfo(SIProgramInfo &ProgInfo,
   ProgInfo.NumSGPR = MaxSGPR + 1;
 
   if (STM.hasSGPRInitBug()) {
-    if (ProgInfo.NumSGPR > AMDGPUSubtarget::FIXED_SGPR_COUNT_FOR_INIT_BUG)
-      llvm_unreachable("Too many SGPRs used with the SGPR init bug");
+    if (ProgInfo.NumSGPR > AMDGPUSubtarget::FIXED_SGPR_COUNT_FOR_INIT_BUG) {
+      LLVMContext &Ctx = MF.getFunction()->getContext();
+      Ctx.emitError("too many SGPRs used with the SGPR init bug");
+    }
 
     ProgInfo.NumSGPR = AMDGPUSubtarget::FIXED_SGPR_COUNT_FOR_INIT_BUG;
   }