[MemCpyOpt] Add helper to erase instructions (NFC)
Next to erasing the instruction, we also always want to remove
it from MSSA and MD. Use a common function to do so.
This is a refactoring split out from D26739.
nikic on Oct 2 2020, 11:42 AM.Authored by