[llvm] 845b93e - [LiveIntervals] Fix another asan debug build failure

Jay Foad via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 28 03:20:37 PDT 2021


Author: Jay Foad
Date: 2021-09-28T11:09:38+01:00
New Revision: 845b93e692b6a83685b8c0943562ab7ccc5f3b94

URL: https://github.com/llvm/llvm-project/commit/845b93e692b6a83685b8c0943562ab7ccc5f3b94
DIFF: https://github.com/llvm/llvm-project/commit/845b93e692b6a83685b8c0943562ab7ccc5f3b94.diff

LOG: [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.

Added: 
    

Modified: 
    llvm/lib/CodeGen/TwoAddressInstructionPass.cpp

Removed: 
    


################################################################################
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.


        


More information about the llvm-commits mailing list