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 | dec1b10161a3bc1b49ab8d35e1bd6488486dfd4a (patch) | |
tree | 0f1b8a3cc397b3214adaa1b827776af5acdc0f40 /lib/CodeGen/PeepholeOptimizer.cpp | |
parent | ea3abd553668e272772f04ae1536034cd37e70d1 (diff) | |
download | external_llvm-dec1b10161a3bc1b49ab8d35e1bd6488486dfd4a.zip external_llvm-dec1b10161a3bc1b49ab8d35e1bd6488486dfd4a.tar.gz external_llvm-dec1b10161a3bc1b49ab8d35e1bd6488486dfd4a.tar.bz2 |
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141849 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/PeepholeOptimizer.cpp')
-rw-r--r-- | lib/CodeGen/PeepholeOptimizer.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/CodeGen/PeepholeOptimizer.cpp b/lib/CodeGen/PeepholeOptimizer.cpp index 8edc8b6..bbc7ce2 100644 --- a/lib/CodeGen/PeepholeOptimizer.cpp +++ b/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; |