From: Dale Johannesen Date: Tue, 3 Mar 2009 23:30:00 +0000 (+0000) Subject: Marking debug info intrinsics as not touching memory X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=127a7936dea7b86e5cad337ad4b537bc115c2588;p=oota-llvm.git Marking debug info intrinsics as not touching memory caused them to be considered trivially dead. Fix this. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65979 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Transforms/Utils/Local.cpp b/lib/Transforms/Utils/Local.cpp index 38809e5e1d7..d2cbec0226e 100644 --- a/lib/Transforms/Utils/Local.cpp +++ b/lib/Transforms/Utils/Local.cpp @@ -159,6 +159,9 @@ bool llvm::ConstantFoldTerminator(BasicBlock *BB) { bool llvm::isInstructionTriviallyDead(Instruction *I) { if (!I->use_empty() || isa(I)) return false; + // We don't want debug info removed by anything this general. + if (isa(I)) return false; + if (!I->mayWriteToMemory()) return true;