mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-05-22 03:39:03 +00:00
Erase dead instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30298 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
0f5e9b99fc
commit
cf2112a0a0
@ -593,8 +593,8 @@ Value *PredicateSimplifier::resolve(Value *V, const PropertySet &KP) {
|
|||||||
void PredicateSimplifier::visitBasicBlock(DTNodeType *DTNode,
|
void PredicateSimplifier::visitBasicBlock(DTNodeType *DTNode,
|
||||||
PropertySet &KnownProperties) {
|
PropertySet &KnownProperties) {
|
||||||
BasicBlock *BB = DTNode->getBlock();
|
BasicBlock *BB = DTNode->getBlock();
|
||||||
for (BasicBlock::iterator I = BB->begin(), E = BB->end(); I != E; ++I) {
|
for (BasicBlock::iterator I = BB->begin(), E = BB->end(); I != E;) {
|
||||||
visitInstruction(I, DTNode, KnownProperties);
|
visitInstruction(I++, DTNode, KnownProperties);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -612,6 +612,7 @@ void PredicateSimplifier::visitInstruction(Instruction *I,
|
|||||||
modified = true;
|
modified = true;
|
||||||
++NumInstruction;
|
++NumInstruction;
|
||||||
I->replaceAllUsesWith(V);
|
I->replaceAllUsesWith(V);
|
||||||
|
I->eraseFromParent();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user