aboutsummaryrefslogtreecommitdiff
path: root/llvm/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
commit6b4671b2089e0d34aa9d9f1388f28b8eee4b0459 (patch)
tree297aaea571bf772d645a8c833bafeb635f22e1cd /llvm/lib/Analysis/AliasAnalysis.cpp
parent23976df6f20da29f87e464d29885b39e027fa010 (diff)
downloadllvm-6b4671b2089e0d34aa9d9f1388f28b8eee4b0459.zip
llvm-6b4671b2089e0d34aa9d9f1388f28b8eee4b0459.tar.gz
llvm-6b4671b2089e0d34aa9d9f1388f28b8eee4b0459.tar.bz2
Be more conservative in the face of volatile.
llvm-svn: 110456
Diffstat (limited to 'llvm/lib/Analysis/AliasAnalysis.cpp')
-rw-r--r--llvm/lib/Analysis/AliasAnalysis.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/llvm/lib/Analysis/AliasAnalysis.cpp b/llvm/lib/Analysis/AliasAnalysis.cpp
index 6dd79b4..0b15334 100644
--- a/llvm/lib/Analysis/AliasAnalysis.cpp
+++ b/llvm/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))