diff --git a/llvm/include/llvm/IR/DerivedTypes.h b/llvm/include/llvm/IR/DerivedTypes.h --- a/llvm/include/llvm/IR/DerivedTypes.h +++ b/llvm/include/llvm/IR/DerivedTypes.h @@ -552,6 +552,33 @@ return get(ElementType, FVTy->getNumElements()); } + static FixedVectorType *getInteger(FixedVectorType *VTy) { + return cast(VectorType::getInteger(VTy)); + } + + static FixedVectorType *getExtendedElementVectorType(FixedVectorType *VTy) { + return cast(VectorType::getExtendedElementVectorType(VTy)); + } + + static FixedVectorType *getTruncatedElementVectorType(FixedVectorType *VTy) { + return cast( + VectorType::getTruncatedElementVectorType(VTy)); + } + + static FixedVectorType *getSubdividedVectorType(FixedVectorType *VTy, + int NumSubdivs) { + return cast( + VectorType::getSubdividedVectorType(VTy, NumSubdivs)); + } + + static FixedVectorType *getHalfElementsVectorType(FixedVectorType *VTy) { + return cast(VectorType::getHalfElementsVectorType(VTy)); + } + + static FixedVectorType *getDoubleElementsVectorType(FixedVectorType *VTy) { + return cast(VectorType::getDoubleElementsVectorType(VTy)); + } + static bool classof(const Type *T) { return T->getTypeID() == FixedVectorTyID; } @@ -571,6 +598,39 @@ return get(ElementType, SVTy->getMinNumElements()); } + static ScalableVectorType *getInteger(ScalableVectorType *VTy) { + return cast(VectorType::getInteger(VTy)); + } + + static ScalableVectorType * + getExtendedElementVectorType(ScalableVectorType *VTy) { + return cast( + VectorType::getExtendedElementVectorType(VTy)); + } + + static ScalableVectorType * + getTruncatedElementVectorType(ScalableVectorType *VTy) { + return cast( + VectorType::getTruncatedElementVectorType(VTy)); + } + + static ScalableVectorType *getSubdividedVectorType(ScalableVectorType *VTy, + int NumSubdivs) { + return cast( + VectorType::getSubdividedVectorType(VTy, NumSubdivs)); + } + + static ScalableVectorType * + getHalfElementsVectorType(ScalableVectorType *VTy) { + return cast(VectorType::getHalfElementsVectorType(VTy)); + } + + static ScalableVectorType * + getDoubleElementsVectorType(ScalableVectorType *VTy) { + return cast( + VectorType::getDoubleElementsVectorType(VTy)); + } + /// Get the minimum number of elements in this vector. The actual number of /// elements in the vector is an integer multiple of this value. uint64_t getMinNumElements() const { return ElementQuantity; }