Goes a bit further than rL372743 which added the early out - elements should be Constant so use cast<Constant> instead (and rely on the assert if anything fails).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373321
91177308-0d34-0410-b5e6-
96231b3b80d8
ConstantInt::get(Ty, i));
Constant *V2Element = ConstantExpr::getExtractElement(V2,
ConstantInt::get(Ty, i));
- Constant *Cond = dyn_cast<Constant>(CondV->getOperand(i));
- if (!Cond) break;
+ auto *Cond = cast<Constant>(CondV->getOperand(i));
if (V1Element == V2Element) {
V = V1Element;
} else if (isa<UndefValue>(Cond)) {