mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-04-12 19:38:50 +00:00
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
This commit is contained in:
parent
213fdb8bf6
commit
594a545821
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user