diff options
Diffstat (limited to 'llvm/lib/Analysis/ValueTracking.cpp')
-rw-r--r-- | llvm/lib/Analysis/ValueTracking.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/lib/Analysis/ValueTracking.cpp b/llvm/lib/Analysis/ValueTracking.cpp index 0520ce5..650990d 100644 --- a/llvm/lib/Analysis/ValueTracking.cpp +++ b/llvm/lib/Analysis/ValueTracking.cpp @@ -4551,6 +4551,13 @@ bool llvm::isGuaranteedNotToBeUndefOrPoison(const Value *V) { return true; } + if (auto I = dyn_cast<Instruction>(V)) { + if (programUndefinedIfFullPoison(I) && I->getType()->isIntegerTy(1)) + // Note: once we have an agreement that poison is a value-wise concept, + // we can remove the isIntegerTy(1) constraint. + return true; + } + return false; } |