mirror of
https://github.com/RPCS3/llvm.git
synced 2025-02-01 16:22:41 +00:00
simplify this logic.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60189 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
d2f0db1b19
commit
cb03f8547d
@ -39,12 +39,14 @@ namespace {
|
||||
DeadInstElimination() : BasicBlockPass(intptr_t(&ID)) {}
|
||||
virtual bool runOnBasicBlock(BasicBlock &BB) {
|
||||
bool Changed = false;
|
||||
for (BasicBlock::iterator DI = BB.begin(); DI != BB.end(); )
|
||||
if (dceInstruction(DI)) {
|
||||
for (BasicBlock::iterator DI = BB.begin(); DI != BB.end(); ) {
|
||||
Instruction *Inst = DI++;
|
||||
if (isInstructionTriviallyDead(Inst)) {
|
||||
Inst->eraseFromParent();
|
||||
Changed = true;
|
||||
++DIEEliminated;
|
||||
} else
|
||||
++DI;
|
||||
}
|
||||
}
|
||||
return Changed;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user