[LiveIntervals] Fix asan debug build failures
authorJay Foad <jay.foad@amd.com>
Fri, 24 Sep 2021 17:43:17 +0000 (18:43 +0100)
committerJay Foad <jay.foad@amd.com>
Fri, 24 Sep 2021 18:14:57 +0000 (19:14 +0100)
commitac51ad24a75c02152f8ece943d65de9a1c4e947a
treec06fdd69f726dc6712152094a3e93b9cae51dd4e
parentff0b62dd8898e58df297f76285a7e613d745db3e
[LiveIntervals] Fix asan debug build failures

Call RemoveMachineInstrFromMaps before erasing instrs.
repairIntervalsInRange will do this for you after erasing the
instruction, but it's not safe to rely on it because assertions in
SlotIndexes::removeMachineInstrFromMaps refer to fields in the erased
instruction.

This fixes asan buildbot failures caused by D110328.
llvm/lib/CodeGen/TwoAddressInstructionPass.cpp