diff --git a/llvm/lib/CodeGen/MachineFunction.cpp b/llvm/lib/CodeGen/MachineFunction.cpp --- a/llvm/lib/CodeGen/MachineFunction.cpp +++ b/llvm/lib/CodeGen/MachineFunction.cpp @@ -967,11 +967,10 @@ // MIR output. for (unsigned int I = 0; I < Old.getNumOperands(); ++I) { const auto &OldMO = Old.getOperand(I); - auto &NewMO = Old.getOperand(I); if (!OldMO.isReg() || !OldMO.isDef()) continue; - assert(NewMO.isDef()); + assert(Old.getOperand(I).isDef()); unsigned NewInstrNum = New.getDebugInstrNum(); makeDebugValueSubstitution(std::make_pair(OldInstrNum, I),