Index: llvm/lib/IR/Function.cpp =================================================================== --- llvm/lib/IR/Function.cpp +++ llvm/lib/IR/Function.cpp @@ -1180,7 +1180,7 @@ case IITDescriptor::Quad: return !Ty->isFP128Ty(); case IITDescriptor::Integer: return !Ty->isIntegerTy(D.Integer_Width); case IITDescriptor::Vector: { - VectorType *VT = dyn_cast(Ty); + FixedVectorType *VT = dyn_cast(Ty); return !VT || VT->getNumElements() != D.Vector_Width || matchIntrinsicType(VT->getElementType(), Infos, ArgTys, DeferredChecks, IsDeferredCheck); @@ -1357,7 +1357,11 @@ case IITDescriptor::ScalableVecArgument: { if (!isa(Ty)) return true; - return matchIntrinsicType(Ty, Infos, ArgTys, DeferredChecks, + ScalableVectorType *STy = cast(Ty); + unsigned MinElts = STy->getElementCount().Min; + FixedVectorType *FVTy = + FixedVectorType::get(STy->getElementType(), MinElts); + return matchIntrinsicType(FVTy, Infos, ArgTys, DeferredChecks, IsDeferredCheck); } case IITDescriptor::VecOfBitcastsToInt: {