diff options
author | Nikita Popov <npopov@redhat.com> | 2023-12-04 11:13:48 +0100 |
---|---|---|
committer | Nikita Popov <npopov@redhat.com> | 2023-12-04 12:04:41 +0100 |
commit | 4275da2278b146189268b1040b749fa9f3a7bdcc (patch) | |
tree | 8176cf165d8cf03f0a7389ffee68622da0824630 /llvm/lib/Analysis/LazyValueInfo.cpp | |
parent | 5c672d87ea5e63bf5e218c871228b62358e1ba51 (diff) | |
download | llvm-4275da2278b146189268b1040b749fa9f3a7bdcc.zip llvm-4275da2278b146189268b1040b749fa9f3a7bdcc.tar.gz llvm-4275da2278b146189268b1040b749fa9f3a7bdcc.tar.bz2 |
[ValueTracking] Add isGuaranteedNotToBeUndef() variant (NFC)
We have a bunch of places where we have to guard against undef
to avoid multi-use issues, but would be fine with poison. Use a
different function for these to make it clear, and to indicate that
this check can be removed once we no longer support undef. I've
replaced some of the obvious cases, but there's probably more.
For now, the implementation is the same as UndefOrPoison, it just
has a more precise name.
Diffstat (limited to 'llvm/lib/Analysis/LazyValueInfo.cpp')
-rw-r--r-- | llvm/lib/Analysis/LazyValueInfo.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Analysis/LazyValueInfo.cpp b/llvm/lib/Analysis/LazyValueInfo.cpp index 3c2f26e..b708ee0 100644 --- a/llvm/lib/Analysis/LazyValueInfo.cpp +++ b/llvm/lib/Analysis/LazyValueInfo.cpp @@ -880,7 +880,7 @@ LazyValueInfoImpl::solveBlockValueSelect(SelectInst *SI, BasicBlock *BB) { Value *Cond = SI->getCondition(); // If the value is undef, a different value may be chosen in // the select condition. - if (isGuaranteedNotToBeUndefOrPoison(Cond, AC)) { + if (isGuaranteedNotToBeUndef(Cond, AC)) { TrueVal = intersect(TrueVal, getValueFromCondition(SI->getTrueValue(), Cond, true)); FalseVal = intersect( @@ -1719,7 +1719,7 @@ ConstantRange LazyValueInfo::getConstantRangeAtUse(const Use &U, if (auto *SI = dyn_cast<SelectInst>(CurrI)) { // If the value is undef, a different value may be chosen in // the select condition and at use. - if (!isGuaranteedNotToBeUndefOrPoison(SI->getCondition(), AC)) + if (!isGuaranteedNotToBeUndef(SI->getCondition(), AC)) break; if (CurrU->getOperandNo() == 1) CondVal = getValueFromCondition(V, SI->getCondition(), true); |