summaryrefslogtreecommitdiff
path: root/lib/Analysis/AliasAnalysis.cpp
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2010-08-06 18:11:28 +0000
committerDan Gohman <gohman@apple.com>2010-08-06 18:11:28 +0000
commitb9db52dcbcf4279270eab972f3d560b4e5654260 (patch)
tree4c5e4bf62ce041649bd3ceae46c6335f4068d5cc /lib/Analysis/AliasAnalysis.cpp
parent9b8639c9bd98ae08d0fe3630e2d3421a9277564a (diff)
downloadllvm-b9db52dcbcf4279270eab972f3d560b4e5654260.tar.gz
llvm-b9db52dcbcf4279270eab972f3d560b4e5654260.tar.bz2
llvm-b9db52dcbcf4279270eab972f3d560b4e5654260.tar.xz
Be more conservative in the face of volatile.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110456 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/AliasAnalysis.cpp')
-rw-r--r--lib/Analysis/AliasAnalysis.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/Analysis/AliasAnalysis.cpp b/lib/Analysis/AliasAnalysis.cpp
index 6dd79b47b9..0b15334e14 100644
--- a/lib/Analysis/AliasAnalysis.cpp
+++ b/lib/Analysis/AliasAnalysis.cpp
@@ -195,31 +195,31 @@ AliasAnalysis::getModRefBehavior(const Function *F) {
AliasAnalysis::ModRefResult
AliasAnalysis::getModRefInfo(const LoadInst *L, const Value *P, unsigned Size) {
+ // Be conservative in the face of volatile.
+ if (L->isVolatile())
+ return ModRef;
+
// If the load address doesn't alias the given address, it doesn't read
// or write the specified memory.
if (!alias(L->getOperand(0), getTypeStoreSize(L->getType()), P, Size))
return NoModRef;
- // Be conservative in the face of volatile.
- if (L->isVolatile())
- return ModRef;
-
// Otherwise, a load just reads.
return Ref;
}
AliasAnalysis::ModRefResult
AliasAnalysis::getModRefInfo(const StoreInst *S, const Value *P, unsigned Size) {
+ // Be conservative in the face of volatile.
+ if (S->isVolatile())
+ return ModRef;
+
// If the store address cannot alias the pointer in question, then the
// specified memory cannot be modified by the store.
if (!alias(S->getOperand(1),
getTypeStoreSize(S->getOperand(0)->getType()), P, Size))
return NoModRef;
- // Be conservative in the face of volatile.
- if (S->isVolatile())
- return ModRef;
-
// If the pointer is a pointer to constant memory, then it could not have been
// modified by this store.
if (pointsToConstantMemory(P))