[llvm-commits] [llvm] r110456 - /llvm/trunk/lib/Analysis/AliasAnalysis.cpp
Dan Gohman
gohman at apple.com
Fri Aug 6 11:11:28 PDT 2010
Author: djg
Date: Fri Aug 6 13:11:28 2010
New Revision: 110456
URL: http://llvm.org/viewvc/llvm-project?rev=110456&view=rev
Log:
Be more conservative in the face of volatile.
Modified:
llvm/trunk/lib/Analysis/AliasAnalysis.cpp
Modified: llvm/trunk/lib/Analysis/AliasAnalysis.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/AliasAnalysis.cpp?rev=110456&r1=110455&r2=110456&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/AliasAnalysis.cpp (original)
+++ llvm/trunk/lib/Analysis/AliasAnalysis.cpp Fri Aug 6 13:11:28 2010
@@ -195,31 +195,31 @@
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))
More information about the llvm-commits
mailing list