conservatively say that volatile stores read memory.
authorChris Lattner <sabre@nondot.org>
Thu, 8 May 2008 21:58:49 +0000 (21:58 +0000)
committerChris Lattner <sabre@nondot.org>
Thu, 8 May 2008 21:58:49 +0000 (21:58 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50872 91177308-0d34-0410-b5e6-96231b3b80d8

lib/VMCore/Instruction.cpp

index a446cc20a9384a33e184fc2d0eb390e9e5e88cef..2316b486898222414b05853233f9ab44e2d12535 100644 (file)
@@ -226,13 +226,14 @@ bool Instruction::mayReadFromMemory() const {
   default: return false;
   case Instruction::Free:
   case Instruction::VAArg:
+  case Instruction::Load:
     return true;
   case Instruction::Call:
     return !cast<CallInst>(this)->doesNotAccessMemory();
   case Instruction::Invoke:
     return !cast<InvokeInst>(this)->doesNotAccessMemory();
-  case Instruction::Load:
-    return true;
+  case Instruction::Store:
+    return cast<StoreInst>(this)->isVolatile();
   }
 }