diff --git a/llvm/lib/CodeGen/MachineCopyPropagation.cpp b/llvm/lib/CodeGen/MachineCopyPropagation.cpp --- a/llvm/lib/CodeGen/MachineCopyPropagation.cpp +++ b/llvm/lib/CodeGen/MachineCopyPropagation.cpp @@ -648,6 +648,10 @@ continue; } + // Ignore DBG_VALUEs + if (MI->isDebugValue()) + continue; + // Clobber any earlyclobber regs first. for (const MachineOperand &MO : MI->operands()) if (MO.isReg() && MO.isEarlyClobber()) { @@ -846,6 +850,10 @@ } } + // Ignore DBG_VALUEs + if (MI->isDebugValue()) + continue; + // Invalidate any earlyclobber regs first. for (const MachineOperand &MO : MI->operands()) if (MO.isReg() && MO.isEarlyClobber()) {