Zap dead instructions harder.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122645 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Duncan Sands 2010-12-31 16:17:54 +00:00
parent 1928236514
commit fea0b8b666

View File

@ -83,13 +83,8 @@ namespace {
// Finally, run over the function zapping any dead instructions.
for (Function::iterator BB = F.begin(), E = F.end(); BB != E; ++BB)
for (BasicBlock::iterator BI = BB->begin(), BE = BB->end(); BI != BE;) {
Instruction *I = BI++;
if (isInstructionTriviallyDead(I)) {
I->eraseFromParent();
Changed = true;
}
}
for (BasicBlock::iterator BI = BB->begin(), BE = BB->end(); BI != BE;)
Changed |= RecursivelyDeleteTriviallyDeadInstructions(BI++);
return Changed;
}