[llvm-commits] [llvm] r110090 - in /llvm/trunk: include/llvm/Analysis/AliasAnalysis.h lib/Analysis/Lint.cpp lib/Analysis/MemoryDependenceAnalysis.cpp
Dan Gohman
gohman at apple.com
Mon Aug 2 17:56:30 PDT 2010
Author: djg
Date: Mon Aug 2 19:56:30 2010
New Revision: 110090
URL: http://llvm.org/viewvc/llvm-project?rev=110090&view=rev
Log:
Add a convenient form of AliasAnalysis::alias for the case where the sizes
are unknown.
Modified:
llvm/trunk/include/llvm/Analysis/AliasAnalysis.h
llvm/trunk/lib/Analysis/Lint.cpp
llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp
Modified: llvm/trunk/include/llvm/Analysis/AliasAnalysis.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/AliasAnalysis.h?rev=110090&r1=110089&r2=110090&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Analysis/AliasAnalysis.h (original)
+++ llvm/trunk/include/llvm/Analysis/AliasAnalysis.h Mon Aug 2 19:56:30 2010
@@ -94,6 +94,11 @@
virtual AliasResult alias(const Value *V1, unsigned V1Size,
const Value *V2, unsigned V2Size);
+ /// alias - A convenience wrapper for the case where the sizes are unknown.
+ AliasResult alias(const Value *V1, const Value *V2) {
+ return alias(V1, ~0u, V2, ~0u);
+ }
+
/// isNoAlias - A trivial helper function to check to see if the specified
/// pointers are no-alias.
bool isNoAlias(const Value *V1, unsigned V1Size,
Modified: llvm/trunk/lib/Analysis/Lint.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/Lint.cpp?rev=110090&r1=110089&r2=110090&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/Lint.cpp (original)
+++ llvm/trunk/lib/Analysis/Lint.cpp Mon Aug 2 19:56:30 2010
@@ -246,8 +246,7 @@
// where nothing is known.
if (Formal->hasNoAliasAttr() && Actual->getType()->isPointerTy())
for (CallSite::arg_iterator BI = CS.arg_begin(); BI != AE; ++BI) {
- Assert1(AI == BI ||
- AA->alias(*AI, ~0u, *BI, ~0u) != AliasAnalysis::MustAlias,
+ Assert1(AI == BI || AA->alias(*AI, *BI) != AliasAnalysis::MustAlias,
"Unusual: noalias argument aliases another argument", &I);
}
Modified: llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp?rev=110090&r1=110089&r2=110090&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp (original)
+++ llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp Mon Aug 2 19:56:30 2010
@@ -195,8 +195,7 @@
// FIXME: This only considers queries directly on the invariant-tagged
// pointer, not on query pointers that are indexed off of them. It'd
// be nice to handle that at some point.
- AliasAnalysis::AliasResult R =
- AA->alias(II->getArgOperand(2), ~0U, MemPtr, ~0U);
+ AliasAnalysis::AliasResult R = AA->alias(II->getArgOperand(2), MemPtr);
if (R == AliasAnalysis::MustAlias) {
InvariantTag = II->getArgOperand(0);
continue;
@@ -208,8 +207,7 @@
// FIXME: This only considers queries directly on the invariant-tagged
// pointer, not on query pointers that are indexed off of them. It'd
// be nice to handle that at some point.
- AliasAnalysis::AliasResult R =
- AA->alias(II->getArgOperand(1), ~0U, MemPtr, ~0U);
+ AliasAnalysis::AliasResult R = AA->alias(II->getArgOperand(1), MemPtr);
if (R == AliasAnalysis::MustAlias)
return MemDepResult::getDef(II);
}
More information about the llvm-commits
mailing list