diff --git a/lib/Analysis/ValueTracking.cpp b/lib/Analysis/ValueTracking.cpp index 6b88cd05b2d..5b4c8102863 100644 --- a/lib/Analysis/ValueTracking.cpp +++ b/lib/Analysis/ValueTracking.cpp @@ -4529,6 +4529,13 @@ bool llvm::isGuaranteedNotToBeUndefOrPoison(const Value *V) { return true; } + if (auto II = dyn_cast(V)) { + if (llvm::all_of(II->operands(), [](const Value *V) { + return isGuaranteedNotToBeUndefOrPoison(V); + })) + return true; + } + return false; }