diff --git a/llvm/lib/IR/Function.cpp b/llvm/lib/IR/Function.cpp --- a/llvm/lib/IR/Function.cpp +++ b/llvm/lib/IR/Function.cpp @@ -1075,7 +1075,12 @@ return Tys[D.getOverloadArgNumber()]; case IITDescriptor::ScalableVecArgument: { auto *Ty = cast(DecodeFixedType(Infos, Tys, Context)); - return VectorType::get(Ty->getElementType(), {Ty->getNumElements(), true}); + if (isa(Ty)) + return Ty; + // FIXME: Explicit conversion from fixed to scalable vector. Can/should this + // happen? + return ScalableVectorType::get(Ty->getElementType(), + Ty->getElementCount().Min); } } llvm_unreachable("unhandled");