aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Analysis/ValueTracking.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Analysis/ValueTracking.cpp')
-rw-r--r--llvm/lib/Analysis/ValueTracking.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/Analysis/ValueTracking.cpp b/llvm/lib/Analysis/ValueTracking.cpp
index f80ec73..e547447 100644
--- a/llvm/lib/Analysis/ValueTracking.cpp
+++ b/llvm/lib/Analysis/ValueTracking.cpp
@@ -4693,8 +4693,9 @@ bool llvm::isGuaranteedNotToBeUndefOrPoison(const Value *V,
if (isa<UndefValue>(C) || isa<ConstantExpr>(C))
return false;
- // TODO: Add ConstantFP and pointers.
- if (isa<ConstantInt>(C) || isa<GlobalVariable>(C) )
+ // TODO: Add ConstantFP.
+ if (isa<ConstantInt>(C) || isa<GlobalVariable>(C) ||
+ isa<ConstantPointerNull>(C))
return true;
if (C->getType()->isVectorTy())