summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/LazyValueInfo.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Analysis/LazyValueInfo.cpp')
-rw-r--r--llvm/lib/Analysis/LazyValueInfo.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/llvm/lib/Analysis/LazyValueInfo.cpp b/llvm/lib/Analysis/LazyValueInfo.cpp
index e4cd867743a..31ca2de2836 100644
--- a/llvm/lib/Analysis/LazyValueInfo.cpp
+++ b/llvm/lib/Analysis/LazyValueInfo.cpp
@@ -457,10 +457,11 @@ LVILatticeVal LVIQuery::getBlockValue(BasicBlock *BB) {
// then we know that the pointer can't be NULL.
if (Val->getType()->isPointerTy()) {
const PointerType *PTy = cast<PointerType>(Val->getType());
- 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 && L->getPointerAddressSpace() == 0) {
+ for (BasicBlock::iterator BI = BB->begin(), BE = BB->end();BI != BE;++BI){
+ LoadInst *L = dyn_cast<LoadInst>(BI);
+ if (L && L->getPointerAddressSpace() == 0 &&
+ L->getPointerOperand()->getUnderlyingObject() ==
+ Val->getUnderlyingObject()) {
return LVILatticeVal::getNot(ConstantPointerNull::get(PTy));
}
}
OpenPOWER on IntegriCloud