I took a quick look at the rest of the uses of eraseInstruction, it seems like this is the only other place where a salvage makes sense. As a follow up we might convert this to the 'OrMarkUndef' variant (or fold that into this patch).
What about other uses of the salvageDebugInfo(), such as:
llvm/lib/Transforms/Scalar/GVN.cpp llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp llvm/lib/Transforms/Scalar/DCE.cpp
should we address them as well? If so, that should be a different patch.