From c7ff6c8029ac3595e87ea80ad7a08eafbcca52b1 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sun, 17 Oct 2004 23:45:06 +0000 Subject: [PATCH] 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 --- lib/Transforms/Scalar/ADCE.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/Transforms/Scalar/ADCE.cpp b/lib/Transforms/Scalar/ADCE.cpp index e1f228d6fab..22b4c347dcb 100644 --- a/lib/Transforms/Scalar/ADCE.cpp +++ b/lib/Transforms/Scalar/ADCE.cpp @@ -233,8 +233,9 @@ bool ADCE::doADCE() { markInstructionLive(I); } } else if (I->mayWriteToMemory() || isa(I) || - isa(I)) { - // Unreachable instructions are not marked intrinsically live here. + isa(I) || isa(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...