summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorDan Gohman <dan433584@gmail.com>2013-01-31 02:40:59 +0000
committerDan Gohman <dan433584@gmail.com>2013-01-31 02:40:59 +0000
commit1b0f79de0af2b9c0cf71b4aa4d33cef039635897 (patch)
treee710b6d7d4dfea3f4b2720de03851e1593ae0bd3 /llvm/lib
parent3b4a02bf84f3fc9335dce6fe062e3b6643aa3172 (diff)
downloadbcm5719-llvm-1b0f79de0af2b9c0cf71b4aa4d33cef039635897.tar.gz
bcm5719-llvm-1b0f79de0af2b9c0cf71b4aa4d33cef039635897.zip
Move isKnownNonNull out of AliasAnalysis.h and into ValueTracking.cpp since
it isn't really an AliasAnalysis concept, and ValueTracking has similar things that it could plausibly share code with some day. llvm-svn: 174027
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Analysis/AliasAnalysis.cpp16
-rw-r--r--llvm/lib/Analysis/LazyValueInfo.cpp1
-rw-r--r--llvm/lib/Analysis/ValueTracking.cpp16
3 files changed, 16 insertions, 17 deletions
diff --git a/llvm/lib/Analysis/AliasAnalysis.cpp b/llvm/lib/Analysis/AliasAnalysis.cpp
index f32bd706982..210b80ab63e 100644
--- a/llvm/lib/Analysis/AliasAnalysis.cpp
+++ b/llvm/lib/Analysis/AliasAnalysis.cpp
@@ -555,19 +555,3 @@ bool llvm::isIdentifiedObject(const Value *V) {
return A->hasNoAliasAttr() || A->hasByValAttr();
return false;
}
-
-/// isKnownNonNull - Return true if we know that the specified value is never
-/// null.
-bool llvm::isKnownNonNull(const Value *V) {
- // Alloca never returns null, malloc might.
- if (isa<AllocaInst>(V)) return true;
-
- // A byval argument is never null.
- if (const Argument *A = dyn_cast<Argument>(V))
- return A->hasByValAttr();
-
- // Global values are not null unless extern weak.
- if (const GlobalValue *GV = dyn_cast<GlobalValue>(V))
- return !GV->hasExternalWeakLinkage();
- return false;
-}
diff --git a/llvm/lib/Analysis/LazyValueInfo.cpp b/llvm/lib/Analysis/LazyValueInfo.cpp
index 1c94d101d53..66b5e852c02 100644
--- a/llvm/lib/Analysis/LazyValueInfo.cpp
+++ b/llvm/lib/Analysis/LazyValueInfo.cpp
@@ -16,7 +16,6 @@
#include "llvm/Analysis/LazyValueInfo.h"
#include "llvm/ADT/DenseSet.h"
#include "llvm/ADT/STLExtras.h"
-#include "llvm/Analysis/AliasAnalysis.h"
#include "llvm/Analysis/ConstantFolding.h"
#include "llvm/Analysis/ValueTracking.h"
#include "llvm/IR/Constants.h"
diff --git a/llvm/lib/Analysis/ValueTracking.cpp b/llvm/lib/Analysis/ValueTracking.cpp
index 473ebc86174..8e3994e8f52 100644
--- a/llvm/lib/Analysis/ValueTracking.cpp
+++ b/llvm/lib/Analysis/ValueTracking.cpp
@@ -2014,3 +2014,19 @@ bool llvm::isSafeToSpeculativelyExecute(const Value *V,
return false; // Misc instructions which have effects
}
}
+
+/// isKnownNonNull - Return true if we know that the specified value is never
+/// null.
+bool llvm::isKnownNonNull(const Value *V) {
+ // Alloca never returns null, malloc might.
+ if (isa<AllocaInst>(V)) return true;
+
+ // A byval argument is never null.
+ if (const Argument *A = dyn_cast<Argument>(V))
+ return A->hasByValAttr();
+
+ // Global values are not null unless extern weak.
+ if (const GlobalValue *GV = dyn_cast<GlobalValue>(V))
+ return !GV->hasExternalWeakLinkage();
+ return false;
+}
OpenPOWER on IntegriCloud