From: Benjamin Kramer Date: Sun, 13 Jun 2010 14:35:54 +0000 (+0000) Subject: SimplifyCFG: don't turn volatile stores to null/undef into unreachable. Fixes PR7369. X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=c05cb8d561c1a6a4509f1e707ed281729e878c27;p=oota-llvm.git SimplifyCFG: don't turn volatile stores to null/undef into unreachable. Fixes PR7369. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@105914 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Transforms/Scalar/SimplifyCFGPass.cpp b/lib/Transforms/Scalar/SimplifyCFGPass.cpp index 97441008c46..49d93a2fcc2 100644 --- a/lib/Transforms/Scalar/SimplifyCFGPass.cpp +++ b/lib/Transforms/Scalar/SimplifyCFGPass.cpp @@ -137,6 +137,9 @@ static bool MarkAliveBlocks(BasicBlock *BB, // they should be changed to unreachable by passes that can't modify the // CFG. if (StoreInst *SI = dyn_cast(BBI)) { + // Don't touch volatile stores. + if (SI->isVolatile()) continue; + Value *Ptr = SI->getOperand(1); if (isa(Ptr) ||