summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/AliasAnalysis.cpp
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2010-06-29 00:50:39 +0000
committerDan Gohman <gohman@apple.com>2010-06-29 00:50:39 +0000
commit0824affeff262cf33685dd231e857360f366d327 (patch)
tree6284f1e6f2c3f8f997e1b689d5b8c5825d098df8 /llvm/lib/Analysis/AliasAnalysis.cpp
parentd6a091a4d4db147e4aecc610b1aa9b9cd2b1813d (diff)
downloadbcm5719-llvm-0824affeff262cf33685dd231e857360f366d327.tar.gz
bcm5719-llvm-0824affeff262cf33685dd231e857360f366d327.zip
Add an Intraprocedural form of BasicAliasAnalysis, which aims to
properly handles instructions and arguments defined in different functions, or across recursive function iterations. llvm-svn: 107109
Diffstat (limited to 'llvm/lib/Analysis/AliasAnalysis.cpp')
-rw-r--r--llvm/lib/Analysis/AliasAnalysis.cpp16
1 files changed, 10 insertions, 6 deletions
diff --git a/llvm/lib/Analysis/AliasAnalysis.cpp b/llvm/lib/Analysis/AliasAnalysis.cpp
index 371dcafa9f3..d9fe2f74072 100644
--- a/llvm/lib/Analysis/AliasAnalysis.cpp
+++ b/llvm/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;
}
OpenPOWER on IntegriCloud