From: Jay Foad Date: Tue, 28 Sep 2021 10:07:29 +0000 (+0100) Subject: [LiveIntervals] Fix another asan debug build failure X-Git-Tag: upstream/15.0.7~30317 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=845b93e692b6a83685b8c0943562ab7ccc5f3b94;p=platform%2Fupstream%2Fllvm.git [LiveIntervals] Fix another asan debug build failure 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 D110335. --- diff --git a/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp b/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp index a59c5b4d35cf..0fa580fb4c13 100644 --- a/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp +++ b/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp @@ -629,6 +629,8 @@ bool TwoAddressInstructionPass::convertInstTo3Addr( if (MO.isReg()) OrigRegs.push_back(MO.getReg()); } + + LIS->RemoveMachineInstrFromMaps(*mi); } MBB->erase(mi); // Nuke the old inst.