summaryrefslogtreecommitdiffstats
path: root/lib/VMCore/Instruction.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2008-05-08 21:58:49 +0000
committerChris Lattner <sabre@nondot.org>2008-05-08 21:58:49 +0000
commit748118d8aa8a66597437e6970ab389c988bbdb8b (patch)
tree3714c22f29e8aa3e4b4f3c499f140eaa40ebb8c6 /lib/VMCore/Instruction.cpp
parent0561f78a14ea80feb210f9dadaf235e712358fc0 (diff)
downloadexternal_llvm-748118d8aa8a66597437e6970ab389c988bbdb8b.zip
external_llvm-748118d8aa8a66597437e6970ab389c988bbdb8b.tar.gz
external_llvm-748118d8aa8a66597437e6970ab389c988bbdb8b.tar.bz2
conservatively say that volatile stores read memory.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50872 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore/Instruction.cpp')
-rw-r--r--lib/VMCore/Instruction.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/VMCore/Instruction.cpp b/lib/VMCore/Instruction.cpp
index a446cc2..2316b48 100644
--- a/lib/VMCore/Instruction.cpp
+++ b/lib/VMCore/Instruction.cpp
@@ -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();
}
}