R600: Verify all instructions in the AsmPrinter on debug builds

Make a call to R600's implementation of verifyInstruction() to
check that instructions are only using legal operands.

llvm-svn: 202544
This commit is contained in:
Tom Stellard 2014-02-28 21:36:41 +00:00
parent d61a1c3360
commit 9b9e926481
1 changed files with 7 additions and 0 deletions

View File

@ -69,6 +69,13 @@ void AMDGPUMCInstLower::lower(const MachineInstr *MI, MCInst &OutMI) const {
void AMDGPUAsmPrinter::EmitInstruction(const MachineInstr *MI) {
AMDGPUMCInstLower MCInstLowering(OutContext);
#ifdef _DEBUG
StringRef Err;
if (!TM.getInstrInfo()->verifyInstruction(MI, Err)) {
errs() << "Warning: Illegal instruction detected: " << Err << "\n";
MI->dump();
}
#endif
if (MI->isBundle()) {
const MachineBasicBlock *MBB = MI->getParent();
MachineBasicBlock::const_instr_iterator I = MI;