From 85a51e0060d1081571bd961eb5205cdaa2efbf5b Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Fri, 7 Sep 2007 05:33:03 +0000 Subject: Don't zap back to back volatile load/stores llvm-svn: 41759 --- llvm/lib/Transforms/Scalar/InstructionCombining.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'llvm/lib/Transforms/Scalar/InstructionCombining.cpp') diff --git a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp b/llvm/lib/Transforms/Scalar/InstructionCombining.cpp index 26df55531a8..f9abafa34c0 100644 --- a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp +++ b/llvm/lib/Transforms/Scalar/InstructionCombining.cpp @@ -9066,7 +9066,7 @@ Instruction *InstCombiner::visitStoreInst(StoreInst &SI) { // the pointer we're loading and is producing the pointer we're storing, // then *this* store is dead (X = load P; store X -> P). if (LoadInst *LI = dyn_cast(BBI)) { - if (LI == Val && LI->getOperand(0) == Ptr) { + if (LI == Val && LI->getOperand(0) == Ptr && !SI.isVolatile()) { EraseInstFromFunction(SI); ++NumCombined; return 0; -- cgit v1.2.3