mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-01 00:33:09 +00:00
Unwind instructions are intrinsically alive, just like returns
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8462 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
b884f597d6
commit
545a76ced8
@ -84,8 +84,8 @@ private:
|
|||||||
}
|
}
|
||||||
|
|
||||||
inline void markTerminatorLive(const BasicBlock *BB) {
|
inline void markTerminatorLive(const BasicBlock *BB) {
|
||||||
DEBUG(std::cerr << "Terminat Live: " << BB->getTerminator());
|
DEBUG(std::cerr << "Terminator Live: " << BB->getTerminator());
|
||||||
markInstructionLive((Instruction*)BB->getTerminator());
|
markInstructionLive(const_cast<TerminatorInst*>(BB->getTerminator()));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -176,7 +176,7 @@ bool ADCE::doADCE() {
|
|||||||
BBI != BBE; ++BBI) {
|
BBI != BBE; ++BBI) {
|
||||||
BasicBlock *BB = *BBI;
|
BasicBlock *BB = *BBI;
|
||||||
for (BasicBlock::iterator II = BB->begin(), EI = BB->end(); II != EI; ) {
|
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);
|
markInstructionLive(II);
|
||||||
++II; // Increment the inst iterator if the inst wasn't deleted
|
++II; // Increment the inst iterator if the inst wasn't deleted
|
||||||
} else if (isInstructionTriviallyDead(II)) {
|
} else if (isInstructionTriviallyDead(II)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user