Index: lib/Target/ARM/ARMExpandPseudoInsts.cpp =================================================================== --- lib/Target/ARM/ARMExpandPseudoInsts.cpp +++ lib/Target/ARM/ARMExpandPseudoInsts.cpp @@ -666,6 +666,12 @@ llvm_unreachable("unhandled machine operand type"); } +static MachineOperand makeImplicit(const MachineOperand &MO) { + MachineOperand NewMO = MO; + NewMO.setImplicit(); + return NewMO; +} + void ARMExpandPseudo::ExpandMOV32BitImm(MachineBasicBlock &MBB, MachineBasicBlock::iterator &MBBI) { MachineInstr &MI = *MBBI; @@ -700,6 +706,8 @@ HI16->setMemRefs(MI.memoperands_begin(), MI.memoperands_end()); LO16.addImm(Pred).addReg(PredReg).add(condCodeOp()); HI16.addImm(Pred).addReg(PredReg).add(condCodeOp()); + if (isCC) + LO16.add(makeImplicit(MI.getOperand(1))); TransferImpOps(MI, LO16, HI16); MI.eraseFromParent(); return; @@ -753,6 +761,8 @@ if (RequiresBundling) finalizeBundle(MBB, LO16->getIterator(), MBBI->getIterator()); + if (isCC) + LO16.add(makeImplicit(MI.getOperand(1))); TransferImpOps(MI, LO16, HI16); MI.eraseFromParent(); } @@ -1067,7 +1077,8 @@ MI.getOperand(1).getReg()) .add(MI.getOperand(2)) .addImm(MI.getOperand(3).getImm()) // 'pred' - .add(MI.getOperand(4)); + .add(MI.getOperand(4)) + .add(makeImplicit(MI.getOperand(1))); MI.eraseFromParent(); return true; @@ -1080,7 +1091,8 @@ .add(MI.getOperand(2)) .addImm(MI.getOperand(3).getImm()) // 'pred' .add(MI.getOperand(4)) - .add(condCodeOp()); // 's' bit + .add(condCodeOp()) // 's' bit + .add(makeImplicit(MI.getOperand(1))); MI.eraseFromParent(); return true; @@ -1092,7 +1104,8 @@ .addImm(MI.getOperand(3).getImm()) .addImm(MI.getOperand(4).getImm()) // 'pred' .add(MI.getOperand(5)) - .add(condCodeOp()); // 's' bit + .add(condCodeOp()) // 's' bit + .add(makeImplicit(MI.getOperand(1))); MI.eraseFromParent(); return true; @@ -1105,7 +1118,8 @@ .addImm(MI.getOperand(4).getImm()) .addImm(MI.getOperand(5).getImm()) // 'pred' .add(MI.getOperand(6)) - .add(condCodeOp()); // 's' bit + .add(condCodeOp()) // 's' bit + .add(makeImplicit(MI.getOperand(1))); MI.eraseFromParent(); return true; @@ -1117,7 +1131,8 @@ MI.getOperand(1).getReg()) .addImm(MI.getOperand(2).getImm()) .addImm(MI.getOperand(3).getImm()) // 'pred' - .add(MI.getOperand(4)); + .add(MI.getOperand(4)) + .add(makeImplicit(MI.getOperand(1))); MI.eraseFromParent(); return true; } @@ -1129,7 +1144,8 @@ .addImm(MI.getOperand(2).getImm()) .addImm(MI.getOperand(3).getImm()) // 'pred' .add(MI.getOperand(4)) - .add(condCodeOp()); // 's' bit + .add(condCodeOp()) // 's' bit + .add(makeImplicit(MI.getOperand(1))); MI.eraseFromParent(); return true; @@ -1142,7 +1158,8 @@ .addImm(MI.getOperand(2).getImm()) .addImm(MI.getOperand(3).getImm()) // 'pred' .add(MI.getOperand(4)) - .add(condCodeOp()); // 's' bit + .add(condCodeOp()) // 's' bit + .add(makeImplicit(MI.getOperand(1))); MI.eraseFromParent(); return true; @@ -1165,7 +1182,8 @@ .addImm(MI.getOperand(3).getImm()) .addImm(MI.getOperand(4).getImm()) // 'pred' .add(MI.getOperand(5)) - .add(condCodeOp()); // 's' bit + .add(condCodeOp()) // 's' bit + .add(makeImplicit(MI.getOperand(1))); MI.eraseFromParent(); return true; }