[llvm] r239943 - AMDGPU: Change unreachable into reported error

Matt Arsenault Matthew.Arsenault at amd.com
Wed Jun 17 13:55:25 PDT 2015


Author: arsenm
Date: Wed Jun 17 15:55:25 2015
New Revision: 239943

URL: http://llvm.org/viewvc/llvm-project?rev=239943&view=rev
Log:
AMDGPU: Change unreachable into reported error

Modified:
    llvm/trunk/lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp

Modified: llvm/trunk/lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp?rev=239943&r1=239942&r2=239943&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp (original)
+++ llvm/trunk/lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp Wed Jun 17 15:55:25 2015
@@ -338,8 +338,10 @@ void AMDGPUAsmPrinter::getSIProgramInfo(
   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;
   }





More information about the llvm-commits mailing list