From b82de426dee23c2c3b7e623f42166efff5b9751e Mon Sep 17 00:00:00 2001 From: Benjamin Kramer Date: Sun, 13 Jun 2010 14:35:54 +0000 Subject: [PATCH] SimplifyCFG: don't turn volatile stores to null/undef into unreachable. Fixes PR7369. llvm-svn: 105914 --- llvm/lib/Transforms/Scalar/SimplifyCFGPass.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/llvm/lib/Transforms/Scalar/SimplifyCFGPass.cpp b/llvm/lib/Transforms/Scalar/SimplifyCFGPass.cpp index 97441008c46c..49d93a2fcc27 100644 --- a/llvm/lib/Transforms/Scalar/SimplifyCFGPass.cpp +++ b/llvm/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) ||