[llvm] r295239 - AMDGPU: Replace assert with report_fatal_error
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Wed Feb 15 13:50:34 PST 2017
Author: arsenm
Date: Wed Feb 15 15:50:34 2017
New Revision: 295239
URL: http://llvm.org/viewvc/llvm-project?rev=295239&view=rev
Log:
AMDGPU: Replace assert with report_fatal_error
Also use a more refined condition.
Added:
llvm/trunk/test/MC/Disassembler/AMDGPU/si-support.txt
Modified:
llvm/trunk/lib/Target/AMDGPU/Disassembler/AMDGPUDisassembler.cpp
Modified: llvm/trunk/lib/Target/AMDGPU/Disassembler/AMDGPUDisassembler.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AMDGPU/Disassembler/AMDGPUDisassembler.cpp?rev=295239&r1=295238&r2=295239&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AMDGPU/Disassembler/AMDGPUDisassembler.cpp (original)
+++ llvm/trunk/lib/Target/AMDGPU/Disassembler/AMDGPUDisassembler.cpp Wed Feb 15 15:50:34 2017
@@ -138,7 +138,8 @@ DecodeStatus AMDGPUDisassembler::getInst
CommentStream = &CS;
// ToDo: AMDGPUDisassembler supports only VI ISA.
- assert(AMDGPU::isVI(STI) && "Can disassemble only VI ISA.");
+ if (!STI.getFeatureBits()[AMDGPU::FeatureGCN3Encoding])
+ report_fatal_error("Disassembly not yet supported for subtarget");
const unsigned MaxInstBytesNum = (std::min)((size_t)8, Bytes_.size());
Bytes = Bytes_.slice(0, MaxInstBytesNum);
Added: llvm/trunk/test/MC/Disassembler/AMDGPU/si-support.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/Disassembler/AMDGPU/si-support.txt?rev=295239&view=auto
==============================================================================
--- llvm/trunk/test/MC/Disassembler/AMDGPU/si-support.txt (added)
+++ llvm/trunk/test/MC/Disassembler/AMDGPU/si-support.txt Wed Feb 15 15:50:34 2017
@@ -0,0 +1,4 @@
+# RUN: not llvm-mc -arch=amdgcn -mcpu=tahiti -disassemble < %s 2>&1 | FileCheck %s
+
+# CHECK: LLVM ERROR: Disassembly not yet supported for subtarget
+0x00 0x00 0x00 0x7e
More information about the llvm-commits
mailing list