Don't ignore the CPSR implicit def when lowering a MachineInstruction to an MCInst.
authorJim Grosbach <grosbach@apple.com>
Tue, 14 Sep 2010 20:41:27 +0000 (20:41 +0000)
committerJim Grosbach <grosbach@apple.com>
Tue, 14 Sep 2010 20:41:27 +0000 (20:41 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113847 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/ARM/ARMMCInstLower.cpp

index 5d840be46b393a18a89d8ca92311ac3edcbcf7c1..41af0889d78fe4d0198b7d96d9d0cccc08f0785d 100644 (file)
@@ -12,6 +12,7 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include "ARM.h"
 #include "ARMMCInstLower.h"
 //#include "llvm/CodeGen/MachineModuleInfoImpls.h"
 #include "llvm/CodeGen/AsmPrinter.h"
@@ -126,8 +127,8 @@ void ARMMCInstLower::Lower(const MachineInstr *MI, MCInst &OutMI) const {
       MI->dump();
       assert(0 && "unknown operand type");
     case MachineOperand::MO_Register:
-      // Ignore all implicit register operands.
-      if (MO.isImplicit()) continue;
+      // Ignore all non-CPSR implicit register operands.
+      if (MO.isImplicit() && MO.getReg() != ARM::CPSR) continue;
       assert(!MO.getSubReg() && "Subregs should be eliminated!");
       MCOp = MCOperand::CreateReg(MO.getReg());
       break;