mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-26 23:32:58 +00:00
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:
parent
1928236514
commit
fea0b8b666
@ -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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user