LLZK 3.0.0
An open-source IR for Zero Knowledge (ZK) circuits
Loading...
Searching...
No Matches
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.
::mlir::Type getSelectionType (size_t numIndices) const
 Return the type produced by selecting/removing numIndices leading 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)
::llvm::LogicalResult verify (::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError, ::mlir::Type elementType, ::llvm::ArrayRef<::mlir::Attribute > dimensionSizes, ::llvm::ArrayRef< int64_t > shape)
::llvm::LogicalResult verifyInvariants (::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"
static constexpr ::llvm::StringLiteral dialectName = "array"

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 109 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 118 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 96 of file Types.cpp.inc.

◆ getDimensionSizes()

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

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

◆ getElementType()

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

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

◆ getMnemonic()

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

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

◆ getSelectionType()

Type llzk::array::ArrayType::getSelectionType ( size_t numIndices) const

Return the type produced by selecting/removing numIndices leading dimensions.

Returns itself if numIndices is 0. Returns the element type if numIndices equals the rank of this type. Asserts if numIndices is greater than the rank of this type.

Definition at line 145 of file Types.cpp.

◆ getShape()

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

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

◆ getSubelementIndexMap()

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

Required by DestructurableTypeInterface / SROA pass.

Definition at line 120 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 113 of file Types.cpp.

◆ getTypeAtIndex()

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

Required by DestructurableTypeInterface / SROA pass.

Definition at line 128 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 133 of file Types.cpp.inc.

◆ print()

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

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

◆ verify()

::llvm::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

◆ verifyInvariants()

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

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

Member Data Documentation

◆ dialectName

::llvm::StringLiteral llzk::array::ArrayType::dialectName = "array"
static

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

◆ name

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

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


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