@@ -307,6 +307,43 @@ def CIR_ArrayType : CIR_Type<"Array", "array",
307307 }];
308308}
309309
310+ //===----------------------------------------------------------------------===//
311+ // VectorType (fixed size)
312+ //===----------------------------------------------------------------------===//
313+
314+ def CIR_VectorType : CIR_Type<"Vector", "vector",
315+ [DeclareTypeInterfaceMethods<DataLayoutTypeInterface>]> {
316+
317+ let summary = "CIR vector type";
318+ let description = [{
319+ `!cir.vector' represents fixed-size vector types, parameterized
320+ by the element type and the number of elements.
321+
322+ Example:
323+
324+ ```mlir
325+ !cir.vector<!u64i x 2>
326+ !cir.vector<!cir.float x 4>
327+ ```
328+ }];
329+
330+ let parameters = (ins "mlir::Type":$elementType, "uint64_t":$size);
331+
332+ let assemblyFormat = [{
333+ `<` $size `x` $elementType `>`
334+ }];
335+
336+ let builders = [
337+ TypeBuilderWithInferredContext<(ins
338+ "mlir::Type":$elementType, "uint64_t":$size
339+ ), [{
340+ return $_get(elementType.getContext(), elementType, size);
341+ }]>,
342+ ];
343+
344+ let genVerifyDecl = 1;
345+ }
346+
310347//===----------------------------------------------------------------------===//
311348// FuncType
312349//===----------------------------------------------------------------------===//
@@ -533,8 +570,8 @@ def CIRRecordType : Type<
533570//===----------------------------------------------------------------------===//
534571
535572def CIR_AnyType : AnyTypeOf<[
536- CIR_VoidType, CIR_BoolType, CIR_ArrayType, CIR_IntType, CIR_AnyFloat ,
537- CIR_PointerType, CIR_FuncType, CIR_RecordType
573+ CIR_VoidType, CIR_BoolType, CIR_ArrayType, CIR_VectorType, CIR_IntType ,
574+ CIR_AnyFloat, CIR_PointerType, CIR_FuncType, CIR_RecordType
538575]>;
539576
540577#endif // MLIR_CIR_DIALECT_CIR_TYPES
0 commit comments