diff options
author | Nick Lewycky <nicholas@mxc.ca> | 2011-10-13 02:16:18 +0000 |
---|---|---|
committer | Nick Lewycky <nicholas@mxc.ca> | 2011-10-13 02:16:18 +0000 |
commit | 594a54582119b51f1b2764b58f381ed0068068f6 (patch) | |
tree | 65be8987604c02b920371d526e4cc24d11235781 /llvm/lib/CodeGen/PeepholeOptimizer.cpp | |
parent | 213fdb8bf64da2d8845fc65c97b0eddf53765123 (diff) | |
download | bcm5719-llvm-594a54582119b51f1b2764b58f381ed0068068f6.tar.gz bcm5719-llvm-594a54582119b51f1b2764b58f381ed0068068f6.zip |
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.
llvm-svn: 141849
Diffstat (limited to 'llvm/lib/CodeGen/PeepholeOptimizer.cpp')
-rw-r--r-- | llvm/lib/CodeGen/PeepholeOptimizer.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/PeepholeOptimizer.cpp b/llvm/lib/CodeGen/PeepholeOptimizer.cpp index 8edc8b6fe09..bbc7ce2d0a4 100644 --- a/llvm/lib/CodeGen/PeepholeOptimizer.cpp +++ b/llvm/lib/CodeGen/PeepholeOptimizer.cpp @@ -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; |