[llvm-commits] [llvm] r141849 - /llvm/trunk/lib/CodeGen/PeepholeOptimizer.cpp

Nick Lewycky nicholas at mxc.ca
Wed Oct 12 19:16:18 PDT 2011


Author: nicholas
Date: Wed Oct 12 21:16:18 2011
New Revision: 141849

URL: http://llvm.org/viewvc/llvm-project?rev=141849&view=rev
Log:
If MI is deleted then remove it from the set. If a new MI is created, it could
have the same address as the one we deleted, and we don't want that in the set
yet. Noticed by inspection.

Modified:
    llvm/trunk/lib/CodeGen/PeepholeOptimizer.cpp

Modified: llvm/trunk/lib/CodeGen/PeepholeOptimizer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/PeepholeOptimizer.cpp?rev=141849&r1=141848&r2=141849&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/PeepholeOptimizer.cpp (original)
+++ llvm/trunk/lib/CodeGen/PeepholeOptimizer.cpp Wed Oct 12 21:16:18 2011
@@ -433,6 +433,7 @@
       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 @@
       } else if (MCID.isCompare()) {
         if (OptimizeCmpInstr(MI, MBB)) {
           // MI is deleted.
+          LocalMIs.erase(MI);
           Changed = true;
           MII = First ? I->begin() : llvm::next(PMII);
           continue;





More information about the llvm-commits mailing list