llvm.org GIT mirror llvm / e47d475
Merging r263627: ------------------------------------------------------------------------ r263627 | michel.daenzer | 2016-03-16 02:10:42 -0700 (Wed, 16 Mar 2016) | 11 lines AMDGPU: Verify instructions in non-debug builds as well And emit an error if it fails. This prevents illegal instructions from getting sent to the GPU, which would potentially result in a hang. This is a candidate for the stable branch(es). Reviewed-by: Marek Olšák <marek.olsak@amd.com> ------------------------------------------------------------------------ git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_38@271724 91177308-0d34-0410-b5e6-96231b3b80d8 Tom Stellard 3 years ago
1 changed file(s) with 3 addition(s) and 3 deletion(s). Raw diff Collapse all Expand all
8787 const AMDGPUSubtarget &STI = MF->getSubtarget();
8888 AMDGPUMCInstLower MCInstLowering(OutContext, STI);
8989
90 #ifdef _DEBUG
9190 StringRef Err;
9291 if (!STI.getInstrInfo()->verifyInstruction(MI, Err)) {
93 errs() << "Warning: Illegal instruction detected: " << Err << "\n";
92 LLVMContext &C = MI->getParent()->getParent()->getFunction()->getContext();
93 C.emitError("Illegal instruction detected: " + Err);
9494 MI->dump();
9595 }
96 #endif
96
9797 if (MI->isBundle()) {
9898 const MachineBasicBlock *MBB = MI->getParent();
9999 MachineBasicBlock::const_instr_iterator I = ++MI->getIterator();