diff --git a/llvm/include/llvm/CodeGen/MachineInstr.h b/llvm/include/llvm/CodeGen/MachineInstr.h index a157e9d39be3..795560108073 100644 --- a/llvm/include/llvm/CodeGen/MachineInstr.h +++ b/llvm/include/llvm/CodeGen/MachineInstr.h @@ -514,7 +514,7 @@ void MachineInstr::setImplicitRef(unsigned i, bool isDefAndUse) { assert(i < getNumImplicitRefs() && "setImplicitRef() out of range!"); - SetMachineOperandVal(i + getNumImplicitRefs(), + SetMachineOperandVal(i + getNumOperands(), MachineOperand::MO_VirtualRegister, V, isDef, isDefAndUse); }