[llvm-commits] [llvm] r122645 - /llvm/trunk/lib/Transforms/Utils/SimplifyInstructions.cpp
Duncan Sands
baldrick at free.fr
Fri Dec 31 08:17:54 PST 2010
Author: baldrick
Date: Fri Dec 31 10:17:54 2010
New Revision: 122645
URL: http://llvm.org/viewvc/llvm-project?rev=122645&view=rev
Log:
Zap dead instructions harder.
Modified:
llvm/trunk/lib/Transforms/Utils/SimplifyInstructions.cpp
Modified: llvm/trunk/lib/Transforms/Utils/SimplifyInstructions.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/SimplifyInstructions.cpp?rev=122645&r1=122644&r2=122645&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Utils/SimplifyInstructions.cpp (original)
+++ llvm/trunk/lib/Transforms/Utils/SimplifyInstructions.cpp Fri Dec 31 10:17:54 2010
@@ -83,13 +83,8 @@
// 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;
}
More information about the llvm-commits
mailing list