LLZK 0.1.0
Veridise's ZK Language IR
Loading...
Searching...
No Matches
llzk::array::ArrayType Class Reference
Inheritance diagram for llzk::array::ArrayType:
[legend]
Collaboration diagram for llzk::array::ArrayType:
[legend]

Public Member Functions

std::optional<::llvm::SmallVector<::mlir::ArrayAttr > > getSubelementIndices () const
 Return a list of all valid indices for this ArrayType.
 
bool hasRank () const
 Returns if this type is ranked, i.e., it has a known number of dimensions.
 
ArrayType cloneWith (std::optional<::llvm::ArrayRef< int64_t > > shape, ::mlir::Type elementType) const
 Clone this type with the given shape and element type.
 
ArrayType cloneWith (::mlir::Type elementType, std::optional<::llvm::ArrayRef<::mlir::Attribute > > dimensions=std::nullopt) const
 Clone this type with the given dimensions and element type.
 
void print (::mlir::AsmPrinter &odsPrinter) const
 
::mlir::Type getElementType () const
 
::llvm::ArrayRef<::mlir::Attribute > getDimensionSizes () const
 
::llvm::ArrayRef< int64_t > getShape () const
 
::std::optional<::llvm::DenseMap<::mlir::Attribute, ::mlir::Type > > getSubelementIndexMap () const
 Required by DestructurableTypeInterface / SROA pass.
 
::mlir::Type getTypeAtIndex (::mlir::Attribute index) const
 Required by DestructurableTypeInterface / SROA pass.
 

Static Public Member Functions

static ArrayType get (::mlir::Type elementType, ::llvm::ArrayRef<::mlir::Attribute > dimensionSizes)
 
static ArrayType getChecked (::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError, ::mlir::Type elementType, ::llvm::ArrayRef<::mlir::Attribute > dimensionSizes)
 
static ArrayType get (::mlir::Type elementType, ::llvm::ArrayRef< int64_t > shape)
 
static ArrayType getChecked (::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError, ::mlir::Type elementType, ::llvm::ArrayRef< int64_t > shape)
 
::mlir::LogicalResult verify (::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError, ::mlir::Type elementType, ::llvm::ArrayRef<::mlir::Attribute > dimensionSizes, ::llvm::ArrayRef< int64_t > shape)
 
static constexpr ::llvm::StringLiteral getMnemonic ()
 
::mlir::Type parse (::mlir::AsmParser &odsParser)
 

Static Public Attributes

static constexpr ::llvm::StringLiteral name = "array.type"
 

Detailed Description

Definition at line 23 of file Types.h.inc.

Member Function Documentation

◆ cloneWith() [1/2]

ArrayType llzk::array::ArrayType::cloneWith ( ::mlir::Type elementType,
std::optional<::llvm::ArrayRef<::mlir::Attribute > > dimensions = std::nullopt ) const

Clone this type with the given dimensions and element type.

If the provided dimensions are std::nullopt, the current dimensions of the type are used. Note: This is preferred over cloneWith(..int64_t..) because this Attribute version can carry more information than the int64_t which must default to kDynamic when the Attribute is anything other than an integer constant.

◆ cloneWith() [2/2]

ArrayType llzk::array::ArrayType::cloneWith ( std::optional<::llvm::ArrayRef< int64_t > > shape,
::mlir::Type elementType ) const

Clone this type with the given shape and element type.

If the provided shape is std::nullopt, the current shape of the type is used. Required by the ShapedTypeInterface interface.

◆ get() [1/2]

ArrayType llzk::array::ArrayType::get ( ::mlir::Type elementType,
::llvm::ArrayRef< int64_t > shape )
static

Definition at line 103 of file Types.cpp.inc.

◆ get() [2/2]

ArrayType llzk::array::ArrayType::get ( ::mlir::Type elementType,
::llvm::ArrayRef<::mlir::Attribute > dimensionSizes )
static

Definition at line 83 of file Types.cpp.inc.

◆ getChecked() [1/2]

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

Definition at line 112 of file Types.cpp.inc.

◆ getChecked() [2/2]

ArrayType llzk::array::ArrayType::getChecked ( ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError,
::mlir::Type elementType,
::llvm::ArrayRef<::mlir::Attribute > dimensionSizes )
static

Definition at line 93 of file Types.cpp.inc.

◆ getDimensionSizes()

llvm::ArrayRef<::mlir::Attribute > llzk::array::ArrayType::getDimensionSizes ( ) const

Definition at line 191 of file Types.cpp.inc.

◆ getElementType()

mlir::Type llzk::array::ArrayType::getElementType ( ) const

Definition at line 187 of file Types.cpp.inc.

◆ getMnemonic()

static constexpr ::llvm::StringLiteral llzk::array::ArrayType::getMnemonic ( )
inlinestatic

Definition at line 58 of file Types.h.inc.

◆ getShape()

llvm::ArrayRef< int64_t > llzk::array::ArrayType::getShape ( ) const

Definition at line 195 of file Types.cpp.inc.

◆ getSubelementIndexMap()

std::optional< DenseMap< Attribute, Type > > llzk::array::ArrayType::getSubelementIndexMap ( ) const

Required by DestructurableTypeInterface / SROA pass.

Definition at line 121 of file Types.cpp.

◆ getSubelementIndices()

std::optional< SmallVector< ArrayAttr > > llzk::array::ArrayType::getSubelementIndices ( ) const

Return a list of all valid indices for this ArrayType.

Definition at line 114 of file Types.cpp.

◆ getTypeAtIndex()

Type llzk::array::ArrayType::getTypeAtIndex ( ::mlir::Attribute index) const

Required by DestructurableTypeInterface / SROA pass.

Definition at line 129 of file Types.cpp.

◆ hasRank()

bool llzk::array::ArrayType::hasRank ( ) const
inline

Returns if this type is ranked, i.e., it has a known number of dimensions.

LLZK arrays are always ranked, i.e., the number of dimensions is known. Required by the ShapedTypeInterface interface.

Definition at line 38 of file Types.h.inc.

◆ parse()

mlir::Type llzk::array::ArrayType::parse ( ::mlir::AsmParser & odsParser)
static

Definition at line 121 of file Types.cpp.inc.

◆ print()

void llzk::array::ArrayType::print ( ::mlir::AsmPrinter & odsPrinter) const

Definition at line 173 of file Types.cpp.inc.

◆ verify()

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

Definition at line 76 of file Types.cpp.

Member Data Documentation

◆ name

::llvm::StringLiteral llzk::array::ArrayType::name = "array.type"
static

Definition at line 51 of file Types.h.inc.


The documentation for this class was generated from the following files: