diff options
author | Michael Kuperstein <michael.m.kuperstein@intel.com> | 2013-05-28 08:17:48 +0000 |
---|---|---|
committer | Michael Kuperstein <michael.m.kuperstein@intel.com> | 2013-05-28 08:17:48 +0000 |
commit | f3e663af3961dfbe0c647474aa92e8fb957fb2ac (patch) | |
tree | f74daec7b29625647486ea9ca0236044034f25fb /llvm/lib/Analysis/AliasAnalysis.cpp | |
parent | 9f82df295e59bcdef10b93e541b164ebccfe6bb2 (diff) | |
download | bcm5719-llvm-f3e663af3961dfbe0c647474aa92e8fb957fb2ac.tar.gz bcm5719-llvm-f3e663af3961dfbe0c647474aa92e8fb957fb2ac.zip |
Make BasicAliasAnalysis recognize the fact a noalias argument cannot alias another argument, even if the other argument is not itself marked noalias.
llvm-svn: 182755
Diffstat (limited to 'llvm/lib/Analysis/AliasAnalysis.cpp')
-rw-r--r-- | llvm/lib/Analysis/AliasAnalysis.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/llvm/lib/Analysis/AliasAnalysis.cpp b/llvm/lib/Analysis/AliasAnalysis.cpp index 210b80ab63e..3454ce0be2b 100644 --- a/llvm/lib/Analysis/AliasAnalysis.cpp +++ b/llvm/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) |