================ @@ -385,23 +580,50 @@ ABIArgInfo RISCVABIInfo::coerceVLSVector(QualType Ty) const { NumElts *= 8; break; default: - assert(VT->getVectorKind() == VectorKind::RVVFixedLengthData && + assert((VT->getVectorKind() == VectorKind::Generic || + VT->getVectorKind() == VectorKind::RVVFixedLengthData) && "Unexpected vector kind"); EltType = CGT.ConvertType(VT->getElementType()); } - // The MinNumElts is simplified from equation: - // NumElts / VScale = - // (EltSize * NumElts / (VScale * RVVBitsPerBlock)) - // * (RVVBitsPerBlock / EltSize) - llvm::ScalableVectorType *ResType = - llvm::ScalableVectorType::get(EltType, NumElts / VScale->first); + llvm::ScalableVectorType *ResType; + + if (ABIVLen == 0) { + // The MinNumElts is simplified from equation: + // NumElts / VScale = + // (EltSize * NumElts / (VScale * RVVBitsPerBlock)) + // * (RVVBitsPerBlock / EltSize) + ResType = llvm::ScalableVectorType::get(EltType, NumElts / VScale->first); + } else { + // If the corresponding extension is not supported, just make it an i32 + // vector. + const TargetInfo &TI = getContext().getTargetInfo(); + if ((EltType->isHalfTy() && !TI.hasFeature("zvfhmin")) || + (EltType->isBFloatTy() && !TI.hasFeature("zvfbfmin")) || + (EltType->isFloatTy() && !TI.hasFeature("zve32f")) || + (EltType->isDoubleTy() && !TI.hasFeature("zve64d")) || + EltType->isIntegerTy(128)) ---------------- 4vtomat wrote:
> What about i64 with Zve32* but not V or Zve64*? @kito-cheng and I discussed and thought all of type without corresponding feature support can be handled using i8 vector. https://github.com/llvm/llvm-project/pull/100346 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits