diff --git a/llvm/lib/Target/Mips/MipsInstrInfo.cpp b/llvm/lib/Target/Mips/MipsInstrInfo.cpp index 8648aa0836693..3df62754e2140 100644 --- a/llvm/lib/Target/Mips/MipsInstrInfo.cpp +++ b/llvm/lib/Target/Mips/MipsInstrInfo.cpp @@ -708,6 +708,10 @@ bool MipsInstrInfo::isAsCheapAsAMove(const MachineInstr &MI) const { unsigned MipsInstrInfo::getInstSizeInBytes(const MachineInstr &MI) const { switch (MI.getOpcode()) { default: + if (MI.hasDelaySlot()) { + // instr + 1 nop + return MI.getDesc().getSize() + 4; + } return MI.getDesc().getSize(); case TargetOpcode::INLINEASM: case TargetOpcode::INLINEASM_BR: { // Inline Asm: Variable size.