[llvm-commits] CVS: llvm/lib/Transforms/Scalar/ADCE.cpp
Chris Lattner
lattner at cs.uiuc.edu
Wed Sep 10 15:39:02 PDT 2003
Changes in directory llvm/lib/Transforms/Scalar:
ADCE.cpp updated: 1.59 -> 1.60
---
Log message:
Unwind instructions are intrinsically alive, just like returns
---
Diffs of the changes:
Index: llvm/lib/Transforms/Scalar/ADCE.cpp
diff -u llvm/lib/Transforms/Scalar/ADCE.cpp:1.59 llvm/lib/Transforms/Scalar/ADCE.cpp:1.60
--- llvm/lib/Transforms/Scalar/ADCE.cpp:1.59 Thu Aug 21 17:12:22 2003
+++ llvm/lib/Transforms/Scalar/ADCE.cpp Wed Sep 10 15:38:14 2003
@@ -84,8 +84,8 @@
}
inline void markTerminatorLive(const BasicBlock *BB) {
- DEBUG(std::cerr << "Terminat Live: " << BB->getTerminator());
- markInstructionLive((Instruction*)BB->getTerminator());
+ DEBUG(std::cerr << "Terminator Live: " << BB->getTerminator());
+ markInstructionLive(const_cast<TerminatorInst*>(BB->getTerminator()));
}
};
@@ -176,7 +176,7 @@
BBI != BBE; ++BBI) {
BasicBlock *BB = *BBI;
for (BasicBlock::iterator II = BB->begin(), EI = BB->end(); II != EI; ) {
- if (II->mayWriteToMemory() || II->getOpcode() == Instruction::Ret) {
+ if (II->mayWriteToMemory() || isa<ReturnInst>(II) || isa<UnwindInst>(II)){
markInstructionLive(II);
++II; // Increment the inst iterator if the inst wasn't deleted
} else if (isInstructionTriviallyDead(II)) {
More information about the llvm-commits
mailing list