summaryrefslogtreecommitdiffstats
path: root/llvm/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
commit954907aa6fc800447b992d98236e0effb26c0de6 (patch)
treece275ca923ce859ec38bf01308d162462895c374 /llvm/lib/VMCore/Instruction.cpp
parent93cea9fd1852da2ef4396eeef9edd92cc3907fda (diff)
downloadbcm5719-llvm-954907aa6fc800447b992d98236e0effb26c0de6.tar.gz
bcm5719-llvm-954907aa6fc800447b992d98236e0effb26c0de6.zip
conservatively say that volatile stores read memory.
llvm-svn: 50872
Diffstat (limited to 'llvm/lib/VMCore/Instruction.cpp')
-rw-r--r--llvm/lib/VMCore/Instruction.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/VMCore/Instruction.cpp b/llvm/lib/VMCore/Instruction.cpp
index a446cc20a93..2316b486898 100644
--- a/llvm/lib/VMCore/Instruction.cpp
+++ b/llvm/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();
}
}
OpenPOWER on IntegriCloud