Getting ADCE to interact well with unreachable instructions seems like a nontrivial

exercise that I'm not interested in tackling right now.  Just punt and treat them
like unwind's.

This 'fixes' test/Regression/Transforms/ADCE/unreachable-function.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17106 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2004-10-17 23:45:06 +00:00
parent 559069d46d
commit c7ff6c8029

View File

@ -233,8 +233,9 @@ bool ADCE::doADCE() {
markInstructionLive(I);
}
} else if (I->mayWriteToMemory() || isa<ReturnInst>(I) ||
isa<UnwindInst>(I)) {
// Unreachable instructions are not marked intrinsically live here.
isa<UnwindInst>(I) || isa<UnreachableInst>(I)) {
// FIXME: Unreachable instructions should not be marked intrinsically
// live here.
markInstructionLive(I);
} else if (isInstructionTriviallyDead(I)) {
// Remove the instruction from it's basic block...