diff options
author | Dan Gohman <gohman@apple.com> | 2010-06-29 00:50:39 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2010-06-29 00:50:39 +0000 |
commit | 6be2bd516a3022721480f8fee6986617baf0944f (patch) | |
tree | deebad2d32c6059180d4c443324a8d94d816ef5f /lib/Analysis/AliasAnalysis.cpp | |
parent | 4548260ab57319273f24d25bf8d6a7eeda6fe0f6 (diff) |
Add an Intraprocedural form of BasicAliasAnalysis, which aims to
properly handles instructions and arguments defined in different
functions, or across recursive function iterations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107109 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/AliasAnalysis.cpp')
-rw-r--r-- | lib/Analysis/AliasAnalysis.cpp | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/lib/Analysis/AliasAnalysis.cpp b/lib/Analysis/AliasAnalysis.cpp index 371dcafa9f..d9fe2f7407 100644 --- a/lib/Analysis/AliasAnalysis.cpp +++ b/lib/Analysis/AliasAnalysis.cpp @@ -229,16 +229,20 @@ bool llvm::isNoAliasCall(const Value *V) { /// identifiable object. This returns true for: /// Global Variables and Functions (but not Global Aliases) /// Allocas and Mallocs -/// ByVal and NoAlias Arguments -/// NoAlias returns +/// ByVal and NoAlias Arguments, if Interprocedural is false +/// NoAlias returns, if Interprocedural is false /// -bool llvm::isIdentifiedObject(const Value *V) { - if (isa<AllocaInst>(V) || isNoAliasCall(V)) +bool llvm::isIdentifiedObject(const Value *V, bool Interprocedural) { + if (isa<AllocaInst>(V)) return true; if (isa<GlobalValue>(V) && !isa<GlobalAlias>(V)) return true; - if (const Argument *A = dyn_cast<Argument>(V)) - return A->hasNoAliasAttr() || A->hasByValAttr(); + if (!Interprocedural) { + if (isNoAliasCall(V)) + return true; + if (const Argument *A = dyn_cast<Argument>(V)) + return A->hasNoAliasAttr() || A->hasByValAttr(); + } return false; } |