diff --git a/llvm/include/llvm/IR/PatternMatch.h b/llvm/include/llvm/IR/PatternMatch.h --- a/llvm/include/llvm/IR/PatternMatch.h +++ b/llvm/include/llvm/IR/PatternMatch.h @@ -333,6 +333,10 @@ if (const auto *CF = dyn_cast_or_null(C->getSplatValue())) return this->isValue(CF->getValueAPF()); + // Number of elements of a scalable vector unknown at compile time + if (isa(V->getType())) + return false; + // Non-splat vector constant: check each element for a match. unsigned NumElts = cast(V->getType())->getNumElements(); assert(NumElts != 0 && "Constant vector with no elements?");