[clang] [CIR] Upstream initial support for fixed size VectorType (PR #136488)
Henrich Lauko via cfe-commits
cfe-commits at lists.llvm.org
Mon Apr 21 00:42:23 PDT 2025
================
@@ -307,6 +307,26 @@ def CIR_ArrayType : CIR_Type<"Array", "array",
}];
}
+//===----------------------------------------------------------------------===//
+// VectorType (fixed size)
+//===----------------------------------------------------------------------===//
+
+def CIR_VectorType : CIR_Type<"Vector", "vector",
+ [DeclareTypeInterfaceMethods<DataLayoutTypeInterface>]> {
+
+ let summary = "CIR vector type";
+ let description = [{
+ `cir.vector' represents fixed-size vector types. The parameters are the
+ element type and the number of elements.
+ }];
+
+ let parameters = (ins "mlir::Type":$eltType, "uint64_t":$size);
+
+ let assemblyFormat = [{
+ `<` $eltType `x` $size `>`
+ }];
+}
----------------
xlauko wrote:
This should probably provide `let genVerifyDecl = 1`, to check that `elementType` is supported element type and that size is nonzero? See similar implementation of `LLVMFixedVectorType::verify`.
https://github.com/llvm/llvm-project/pull/136488
More information about the cfe-commits
mailing list