If MI is deleted then remove it from the set. If a new MI is created, it could
authorNick Lewycky <nicholas@mxc.ca>
Thu, 13 Oct 2011 02:16:18 +0000 (02:16 +0000)
committerNick Lewycky <nicholas@mxc.ca>
Thu, 13 Oct 2011 02:16:18 +0000 (02:16 +0000)
have the same address as the one we deleted, and we don't want that in the set
yet. Noticed by inspection.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141849 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/PeepholeOptimizer.cpp

index 8edc8b6fe099eec167be3d344cf9677cd6b5e31d..bbc7ce2d0a4245d7e567b6fcf4f08efa75e6ff49 100644 (file)
@@ -433,6 +433,7 @@ bool PeepholeOptimizer::runOnMachineFunction(MachineFunction &MF) {
       if (MCID.isBitcast()) {
         if (OptimizeBitcastInstr(MI, MBB)) {
           // MI is deleted.
+          LocalMIs.erase(MI);
           Changed = true;
           MII = First ? I->begin() : llvm::next(PMII);
           continue;
@@ -440,6 +441,7 @@ bool PeepholeOptimizer::runOnMachineFunction(MachineFunction &MF) {
       } else if (MCID.isCompare()) {
         if (OptimizeCmpInstr(MI, MBB)) {
           // MI is deleted.
+          LocalMIs.erase(MI);
           Changed = true;
           MII = First ? I->begin() : llvm::next(PMII);
           continue;