summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Stellard <thomas.stellard@amd.com>2014-02-28 21:36:41 +0000
committerTom Stellard <thomas.stellard@amd.com>2014-02-28 21:36:41 +0000
commit34faf78241efb8d60884f185cab4a0c132ee1df3 (patch)
treebcf7b1ec62b6c3a5e24126357bb0b8c212e16002
parent9f0d68f522ca0240b8e3dddb89e3e78099e1141e (diff)
downloadllvm-34faf78241efb8d60884f185cab4a0c132ee1df3.tar.gz
llvm-34faf78241efb8d60884f185cab4a0c132ee1df3.tar.bz2
llvm-34faf78241efb8d60884f185cab4a0c132ee1df3.tar.xz
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202544 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Target/R600/AMDGPUMCInstLower.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/Target/R600/AMDGPUMCInstLower.cpp b/lib/Target/R600/AMDGPUMCInstLower.cpp
index 4af535cdd1..2c9909ff9d 100644
--- a/lib/Target/R600/AMDGPUMCInstLower.cpp
+++ b/lib/Target/R600/AMDGPUMCInstLower.cpp
@@ -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;