NULL loads are only invalid in the default address space.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111972 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Analysis/LazyValueInfo.cpp b/lib/Analysis/LazyValueInfo.cpp
index 88fa15a..e4cd867 100644
--- a/lib/Analysis/LazyValueInfo.cpp
+++ b/lib/Analysis/LazyValueInfo.cpp
@@ -460,7 +460,7 @@
for (Value::use_iterator UI = Val->use_begin(), UE = Val->use_end();
UI != UE; ++UI) {
LoadInst *L = dyn_cast<LoadInst>(*UI);
- if (L && L->getParent() == BB) {
+ if (L && L->getParent() == BB && L->getPointerAddressSpace() == 0) {
return LVILatticeVal::getNot(ConstantPointerNull::get(PTy));
}
}