diff --git a/llvm/lib/Target/VE/VEInstrInfo.cpp b/llvm/lib/Target/VE/VEInstrInfo.cpp index ddcfb9da8249..0624651ed03d 100644 --- a/llvm/lib/Target/VE/VEInstrInfo.cpp +++ b/llvm/lib/Target/VE/VEInstrInfo.cpp @@ -942,11 +942,11 @@ bool VEInstrInfo::expandPostRAPseudo(MachineInstr &MI) const { MachineInstrBuilder MIB = BuildMI(*MBB, MI, DL, get(VE::SVMmi), Dest).addReg(VMZ).addImm(Imm); MachineInstr *Inst = MIB.getInstr(); - MI.eraseFromParent(); if (KillSrc) { const TargetRegisterInfo *TRI = &getRegisterInfo(); Inst->addRegisterKilled(MI.getOperand(1).getReg(), TRI, true); } + MI.eraseFromParent(); return true; } case VE::VFMKyal: