aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Analysis/ValueTracking.cpp
diff options
context:
space:
mode:
authorJuneyoung Lee <aqjune@gmail.com>2021-01-05 06:49:19 +0900
committerJuneyoung Lee <aqjune@gmail.com>2021-01-05 06:50:02 +0900
commitabbef2fd46d48a0d92d86f0c00fa2973f8ae2c85 (patch)
tree8a807a8b74c0414b136ffbc3035595df478a20cb /llvm/lib/Analysis/ValueTracking.cpp
parent8e293fe6ad06225d748bdb8a4414461451e33c16 (diff)
downloadllvm-abbef2fd46d48a0d92d86f0c00fa2973f8ae2c85.zip
llvm-abbef2fd46d48a0d92d86f0c00fa2973f8ae2c85.tar.gz
llvm-abbef2fd46d48a0d92d86f0c00fa2973f8ae2c85.tar.bz2
[ValueTracking] isGuaranteedNotToBePoison should return true on undef
This is a one-line fix to isGuaranteedNotToBePoison to return true if undef is given.
Diffstat (limited to 'llvm/lib/Analysis/ValueTracking.cpp')
-rw-r--r--llvm/lib/Analysis/ValueTracking.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Analysis/ValueTracking.cpp b/llvm/lib/Analysis/ValueTracking.cpp
index 303240d..e15d4f0 100644
--- a/llvm/lib/Analysis/ValueTracking.cpp
+++ b/llvm/lib/Analysis/ValueTracking.cpp
@@ -4888,7 +4888,7 @@ static bool isGuaranteedNotToBeUndefOrPoison(const Value *V,
if (auto *C = dyn_cast<Constant>(V)) {
if (isa<UndefValue>(C))
- return PoisonOnly;
+ return PoisonOnly && !isa<PoisonValue>(C);
if (isa<ConstantInt>(C) || isa<GlobalVariable>(C) || isa<ConstantFP>(V) ||
isa<ConstantPointerNull>(C) || isa<Function>(C))