summaryrefslogtreecommitdiff
path: root/lib/Analysis/AliasAnalysis.cpp
diff options
context:
space:
mode:
authorMichael Kuperstein <michael.m.kuperstein@intel.com>2013-05-28 08:17:48 +0000
committerMichael Kuperstein <michael.m.kuperstein@intel.com>2013-05-28 08:17:48 +0000
commit9f5de6dadcdb9922ad8c8135a29e4abccec11671 (patch)
treed66d776783b8a00eca7d1fd2a59651d522a72b66 /lib/Analysis/AliasAnalysis.cpp
parentaf10fe63c6b0246635e50f480abbf3d679f69246 (diff)
Make BasicAliasAnalysis recognize the fact a noalias argument cannot alias another argument, even if the other argument is not itself marked noalias.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182755 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/AliasAnalysis.cpp')
-rw-r--r--lib/Analysis/AliasAnalysis.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/Analysis/AliasAnalysis.cpp b/lib/Analysis/AliasAnalysis.cpp
index 210b80ab63e..3454ce0be2b 100644
--- a/lib/Analysis/AliasAnalysis.cpp
+++ b/lib/Analysis/AliasAnalysis.cpp
@@ -537,6 +537,15 @@ bool llvm::isNoAliasCall(const Value *V) {
return false;
}
+/// isNoAliasArgument - Return true if this is an argument with the noalias
+/// attribute.
+bool llvm::isNoAliasArgument(const Value *V)
+{
+ if (const Argument *A = dyn_cast<Argument>(V))
+ return A->hasNoAliasAttr();
+ return false;
+}
+
/// isIdentifiedObject - Return true if this pointer refers to a distinct and
/// identifiable object. This returns true for:
/// Global Variables and Functions (but not Global Aliases)