diff --git a/llvm/lib/Analysis/ValueTracking.cpp b/llvm/lib/Analysis/ValueTracking.cpp --- a/llvm/lib/Analysis/ValueTracking.cpp +++ b/llvm/lib/Analysis/ValueTracking.cpp @@ -4708,11 +4708,18 @@ case Instruction::SRem: return I->getOperand(1); + case Instruction::Call: + if (auto *II = dyn_cast(I)) { + switch (II->getIntrinsicID()) { + case Intrinsic::assume: + return II->getArgOperand(0); + default: + return nullptr; + } + } + return nullptr; + default: - // Note: It's really tempting to think that a conditional branch or - // switch should be listed here, but that's incorrect. It's not - // branching off of poison which is UB, it is executing a side effecting - // instruction which follows the branch. return nullptr; } }