Class ArrayType

Inheritance Relationships

Base Type

  • public mlir::Type::TypeBase< ArrayType, ::mlir::Type, detail::ArrayTypeStorage, ::mlir::ShapedType::Trait >

Class Documentation

class ArrayType : public mlir::Type::TypeBase<ArrayType, ::mlir::Type, detail::ArrayTypeStorage, ::mlir::ShapedType::Trait>

Public Functions

inline bool hasRank() const

For HLS, an array should always have rank.

inline ArrayType cloneWith(std::optional<ArrayRef<int64_t>> shape, Type elementType) const
void print(::mlir::AsmPrinter &odsPrinter) const

Prints an ArrayType in its assembly format <[shape x] type>.

Emits <, the dimension list, the element type, and >.

::llvm::ArrayRef<int64_t> getShape() const
Type getElementType() const

Public Static Functions

static ArrayType get(::mlir::MLIRContext *context, ::llvm::ArrayRef<int64_t> shape, Type elementType)
static ArrayType getChecked(::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError, ::mlir::MLIRContext *context, ::llvm::ArrayRef<int64_t> shape, Type elementType)
static ArrayType get(ArrayRef<int64_t> shape, Type elementType)

Creates an ArrayType with explicit shape and element type.

The shape defines the number of elements along each dimension. All dimensions must be static (non-negative). The elementType must be a scalar type.

static ArrayType getChecked(::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError, ArrayRef<int64_t> shape, Type elementType)
static ::llvm::LogicalResult verify(::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError, ::llvm::ArrayRef<int64_t> shape, Type elementType)

Verifies the invariants of an ArrayType.

Checks that elementType is a scalar (not a ShapedType) and that shape is non-empty and every dimension in it is non-negative (i.e. static).

static ::llvm::LogicalResult verifyInvariants(::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError, ::llvm::ArrayRef<int64_t> shape, Type elementType)
static inline constexpr ::llvm::StringLiteral getMnemonic()
static ::mlir::Type parse(::mlir::AsmParser &odsParser)

Parses an ArrayType from its assembly format <[shape x] type>

Expects a < delimiter, an optional dimension list (e.g. 2x3x), a scalar element type, and a closing >. Returns an empty Type on any parse failure.

Public Static Attributes

static constexpr ::llvm::StringLiteral name = "emithls.array"
static constexpr ::llvm::StringLiteral dialectName = "emithls"