@@ -685,10 +685,6 @@ GEPIndicesAdaptor<ValueRange> GEPOp::getIndices() {
685685static Type extractVectorElementType (Type type) {
686686 if (auto vectorType = llvm::dyn_cast<VectorType>(type))
687687 return vectorType.getElementType ();
688- if (auto scalableVectorType = llvm::dyn_cast<LLVMScalableVectorType>(type))
689- return scalableVectorType.getElementType ();
690- if (auto fixedVectorType = llvm::dyn_cast<LLVMFixedVectorType>(type))
691- return fixedVectorType.getElementType ();
692688 return type;
693689}
694690
@@ -725,20 +721,18 @@ static void destructureIndices(Type currType, ArrayRef<GEPArg> indices,
725721 if (rawConstantIndices.size () == 1 || !currType)
726722 continue ;
727723
728- currType =
729- TypeSwitch<Type, Type>(currType)
730- .Case <VectorType, LLVMScalableVectorType, LLVMFixedVectorType,
731- LLVMArrayType>([](auto containerType) {
732- return containerType.getElementType ();
733- })
734- .Case ([&](LLVMStructType structType) -> Type {
735- int64_t memberIndex = rawConstantIndices.back ();
736- if (memberIndex >= 0 && static_cast <size_t >(memberIndex) <
737- structType.getBody ().size ())
738- return structType.getBody ()[memberIndex];
739- return nullptr ;
740- })
741- .Default (Type (nullptr ));
724+ currType = TypeSwitch<Type, Type>(currType)
725+ .Case <VectorType, LLVMArrayType>([](auto containerType) {
726+ return containerType.getElementType ();
727+ })
728+ .Case ([&](LLVMStructType structType) -> Type {
729+ int64_t memberIndex = rawConstantIndices.back ();
730+ if (memberIndex >= 0 && static_cast <size_t >(memberIndex) <
731+ structType.getBody ().size ())
732+ return structType.getBody ()[memberIndex];
733+ return nullptr ;
734+ })
735+ .Default (Type (nullptr ));
742736 }
743737}
744738
@@ -839,11 +833,11 @@ verifyStructIndices(Type baseGEPType, unsigned indexPos,
839833 return verifyStructIndices (elementTypes[gepIndex], indexPos + 1 ,
840834 indices, emitOpError);
841835 })
842- .Case <VectorType, LLVMScalableVectorType, LLVMFixedVectorType,
843- LLVMArrayType>( [&](auto containerType) -> LogicalResult {
844- return verifyStructIndices (containerType.getElementType (), indexPos + 1 ,
845- indices, emitOpError);
846- })
836+ .Case <VectorType, LLVMArrayType>(
837+ [&](auto containerType) -> LogicalResult {
838+ return verifyStructIndices (containerType.getElementType (),
839+ indexPos + 1 , indices, emitOpError);
840+ })
847841 .Default ([&](auto otherType) -> LogicalResult {
848842 return emitOpError ()
849843 << " type " << otherType << " cannot be indexed (index #"
@@ -3157,35 +3151,30 @@ OpFoldResult LLVM::ZeroOp::fold(FoldAdaptor) {
31573151// ===----------------------------------------------------------------------===//
31583152
31593153// / Compute the total number of elements in the given type, also taking into
3160- // / account nested types. Supported types are `VectorType`, `LLVMArrayType` and
3161- // / `LLVMFixedVectorType`. Everything else is treated as a scalar.
3154+ // / account nested types. Supported types are `VectorType` and `LLVMArrayType`.
3155+ // / Everything else is treated as a scalar.
31623156static int64_t getNumElements (Type t) {
3163- if (auto vecType = dyn_cast<VectorType>(t))
3157+ if (auto vecType = dyn_cast<VectorType>(t)) {
3158+ assert (!vecType.isScalable () &&
3159+ " number of elements of a scalable vector type is unknown" );
31643160 return vecType.getNumElements () * getNumElements (vecType.getElementType ());
3161+ }
31653162 if (auto arrayType = dyn_cast<LLVM::LLVMArrayType>(t))
31663163 return arrayType.getNumElements () *
31673164 getNumElements (arrayType.getElementType ());
3168- if (auto vecType = dyn_cast<LLVMFixedVectorType>(t))
3169- return vecType.getNumElements () * getNumElements (vecType.getElementType ());
3170- assert (!isa<LLVM::LLVMScalableVectorType>(t) &&
3171- " number of elements of a scalable vector type is unknown" );
31723165 return 1 ;
31733166}
31743167
31753168// / Check if the given type is a scalable vector type or a vector/array type
31763169// / that contains a nested scalable vector type.
31773170static bool hasScalableVectorType (Type t) {
3178- if (isa<LLVM::LLVMScalableVectorType>(t))
3179- return true ;
31803171 if (auto vecType = dyn_cast<VectorType>(t)) {
31813172 if (vecType.isScalable ())
31823173 return true ;
31833174 return hasScalableVectorType (vecType.getElementType ());
31843175 }
31853176 if (auto arrayType = dyn_cast<LLVM::LLVMArrayType>(t))
31863177 return hasScalableVectorType (arrayType.getElementType ());
3187- if (auto vecType = dyn_cast<LLVMFixedVectorType>(t))
3188- return hasScalableVectorType (vecType.getElementType ());
31893178 return false ;
31903179}
31913180
@@ -3265,8 +3254,7 @@ LogicalResult LLVM::ConstantOp::verify() {
32653254 << " scalable vector type requires a splat attribute" ;
32663255 return success ();
32673256 }
3268- if (!isa<VectorType, LLVM::LLVMArrayType, LLVM::LLVMFixedVectorType>(
3269- getType ()))
3257+ if (!isa<VectorType, LLVM::LLVMArrayType>(getType ()))
32703258 return emitOpError () << " expected vector or array type" ;
32713259 // The number of elements of the attribute and the type must match.
32723260 int64_t attrNumElements;
@@ -3515,8 +3503,7 @@ LogicalResult LLVM::BitcastOp::verify() {
35153503 if (!resultType)
35163504 return success ();
35173505
3518- auto isVector =
3519- llvm::IsaPred<VectorType, LLVMScalableVectorType, LLVMFixedVectorType>;
3506+ auto isVector = llvm::IsaPred<VectorType>;
35203507
35213508 // Due to bitcast requiring both operands to be of the same size, it is not
35223509 // possible for only one of the two to be a pointer of vectors.
@@ -3982,7 +3969,6 @@ void LLVMDialect::initialize() {
39823969
39833970 // clang-format off
39843971 addTypes<LLVMVoidType,
3985- LLVMPPCFP128Type,
39863972 LLVMTokenType,
39873973 LLVMLabelType,
39883974 LLVMMetadataType>();
0 commit comments