LLZK 0.1.0
An open-source IR for Zero Knowledge (ZK) circuits
Loading...
Searching...
No Matches
POD.h File Reference
#include "llzk-c/Support.h"
#include <mlir-c/BuiltinAttributes.h>
#include <mlir-c/IR.h>
#include <mlir-c/Support.h>
#include <stdint.h>
Include dependency graph for POD.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  LlzkRecordValue

Typedefs

typedef struct LlzkRecordValue LlzkRecordValue

Functions

 MLIR_DECLARE_CAPI_DIALECT_REGISTRATION (POD, llzk__pod)
MLIR_CAPI_EXPORTED MlirAttribute llzkRecordAttrGet (MlirStringRef name, MlirType type)
 Creates a new llzk::pod::RecordAttr.
 LLZK_DECLARE_ATTR_ISA (RecordAttr)
 Returns true if the attribute is an llzk::pod::RecordAttr.
MLIR_CAPI_EXPORTED MlirStringRef llzkRecordAttrGetName (MlirAttribute attr)
 Returns the name of the record.
MLIR_CAPI_EXPORTED MlirAttribute llzkRecordAttrGetNameSym (MlirAttribute attr)
 Returns the name of the record as a flat symbol attribute.
MLIR_CAPI_EXPORTED MlirType llzkRecordAttrGetType (MlirAttribute attr)
 Returns the type of the record.
MLIR_CAPI_EXPORTED MlirType llzkPodTypeGet (MlirContext context, intptr_t nRecords, MlirAttribute const *records)
 Creates an llzk::pod::PodType using a list of attributes as records.
MLIR_CAPI_EXPORTED MlirType llzkPodTypeGetFromInitialValues (MlirContext context, intptr_t nRecords, LlzkRecordValue const *records)
 Creates an llzk::pod::PodType using a list of values for inferring the records.
 LLZK_DECLARE_TYPE_ISA (PodType)
 Returns true if the type is an llzk::pod::PodType.
MLIR_CAPI_EXPORTED intptr_t llzkPodTypeGetNumRecords (MlirType type)
 Returns the number of records in the struct.
MLIR_CAPI_EXPORTED void llzkPodTypeGetRecords (MlirType type, MlirAttribute *dst)
 Writes the records into the given array that must have been previously allocated with enough space.
MLIR_CAPI_EXPORTED MlirAttribute llzkPodTypeGetNthRecord (MlirType type, intptr_t n)
 Returns the n-th record in the struct.
MLIR_CAPI_EXPORTED MlirType llzkPodTypeLookupRecord (MlirType type, MlirStringRef name)
 Lookups a record type by name.
MLIR_CAPI_EXPORTED MlirType llzkPodTypeLookupRecordWithinLocation (MlirType type, MlirStringRef name, MlirLocation loc)
 Lookups a record type by name.
MLIR_CAPI_EXPORTED MlirType llzkPodTypeLookupRecordWithinOperation (MlirType type, MlirStringRef name, MlirOperation op)
 Lookups a record type by name.
 LLZK_DECLARE_SUFFIX_OP_BUILD_METHOD (NewPodOp, InferredFromInitialValues, intptr_t nValues, LlzkRecordValue const *values)
 Creates a NewPodOp from a list of initialization values.
 LLZK_DECLARE_OP_BUILD_METHOD (NewPodOp, MlirType type, intptr_t nValues, LlzkRecordValue const *values)
 Creates a NewPodOp from a list of initialization values and a PodType.
 LLZK_DECLARE_SUFFIX_OP_BUILD_METHOD (NewPodOp, WithMapOperands, MlirType type, intptr_t nValues, LlzkRecordValue const *values, LlzkAffineMapOperandsBuilder mapOperands)
 Creates a NewPodOp with a list of initialization values, a PodType, and map operands.
 LLZK_DECLARE_OP_ISA (NewPodOp)
 Returns true if the op is a llzk::pod::NewPodOp.
 LLZK_DECLARE_OP_ISA (ReadPodOp)
 Returns true if the op is a llzk::pod::ReadPodOp.
 LLZK_DECLARE_OP_ISA (WritePodOp)
 Returns true if the op is a llzk::pod::WritePodOp.

Typedef Documentation

◆ LlzkRecordValue

typedef struct LlzkRecordValue LlzkRecordValue

Function Documentation

◆ LLZK_DECLARE_ATTR_ISA()

LLZK_DECLARE_ATTR_ISA ( RecordAttr )

Returns true if the attribute is an llzk::pod::RecordAttr.

◆ LLZK_DECLARE_OP_BUILD_METHOD()

LLZK_DECLARE_OP_BUILD_METHOD ( NewPodOp ,
MlirType type,
intptr_t nValues,
LlzkRecordValue const * values )

Creates a NewPodOp from a list of initialization values and a PodType.

The initial values can partially initialize the struct.

◆ LLZK_DECLARE_OP_ISA() [1/3]

LLZK_DECLARE_OP_ISA ( NewPodOp )

Returns true if the op is a llzk::pod::NewPodOp.

◆ LLZK_DECLARE_OP_ISA() [2/3]

LLZK_DECLARE_OP_ISA ( ReadPodOp )

Returns true if the op is a llzk::pod::ReadPodOp.

◆ LLZK_DECLARE_OP_ISA() [3/3]

LLZK_DECLARE_OP_ISA ( WritePodOp )

Returns true if the op is a llzk::pod::WritePodOp.

◆ LLZK_DECLARE_SUFFIX_OP_BUILD_METHOD() [1/2]

LLZK_DECLARE_SUFFIX_OP_BUILD_METHOD ( NewPodOp ,
InferredFromInitialValues ,
intptr_t nValues,
LlzkRecordValue const * values )

Creates a NewPodOp from a list of initialization values.

The type of the struct gets inferred from the initial values.

◆ LLZK_DECLARE_SUFFIX_OP_BUILD_METHOD() [2/2]

LLZK_DECLARE_SUFFIX_OP_BUILD_METHOD ( NewPodOp ,
WithMapOperands ,
MlirType type,
intptr_t nValues,
LlzkRecordValue const * values,
LlzkAffineMapOperandsBuilder mapOperands )

Creates a NewPodOp with a list of initialization values, a PodType, and map operands.

The initial values can partially initialize the struct.

◆ LLZK_DECLARE_TYPE_ISA()

LLZK_DECLARE_TYPE_ISA ( PodType )

Returns true if the type is an llzk::pod::PodType.

◆ llzkPodTypeGet()

MLIR_CAPI_EXPORTED MlirType llzkPodTypeGet ( MlirContext context,
intptr_t nRecords,
MlirAttribute const * records )

Creates an llzk::pod::PodType using a list of attributes as records.

Definition at line 77 of file POD.cpp.

◆ llzkPodTypeGetFromInitialValues()

MLIR_CAPI_EXPORTED MlirType llzkPodTypeGetFromInitialValues ( MlirContext context,
intptr_t nRecords,
LlzkRecordValue const * records )

Creates an llzk::pod::PodType using a list of values for inferring the records.

Definition at line 85 of file POD.cpp.

◆ llzkPodTypeGetNthRecord()

MLIR_CAPI_EXPORTED MlirAttribute llzkPodTypeGetNthRecord ( MlirType type,
intptr_t n )

Returns the n-th record in the struct.

Definition at line 104 of file POD.cpp.

◆ llzkPodTypeGetNumRecords()

MLIR_CAPI_EXPORTED intptr_t llzkPodTypeGetNumRecords ( MlirType type)

Returns the number of records in the struct.

Definition at line 94 of file POD.cpp.

◆ llzkPodTypeGetRecords()

MLIR_CAPI_EXPORTED void llzkPodTypeGetRecords ( MlirType type,
MlirAttribute * dst )

Writes the records into the given array that must have been previously allocated with enough space.

See llzkPodTypeGetNumRecords

Definition at line 98 of file POD.cpp.

◆ llzkPodTypeLookupRecord()

MLIR_CAPI_EXPORTED MlirType llzkPodTypeLookupRecord ( MlirType type,
MlirStringRef name )

Lookups a record type by name.

If the record is not found reports an error without any location information and the returned type is NULL.

Definition at line 119 of file POD.cpp.

◆ llzkPodTypeLookupRecordWithinLocation()

MLIR_CAPI_EXPORTED MlirType llzkPodTypeLookupRecordWithinLocation ( MlirType type,
MlirStringRef name,
MlirLocation loc )

Lookups a record type by name.

If the record is not found reports an error at the given location information and the returned type is NULL.

Definition at line 128 of file POD.cpp.

◆ llzkPodTypeLookupRecordWithinOperation()

MLIR_CAPI_EXPORTED MlirType llzkPodTypeLookupRecordWithinOperation ( MlirType type,
MlirStringRef name,
MlirOperation op )

Lookups a record type by name.

If the record is not found reports an error using the given operation for location information and the returned type is NULL.

Definition at line 136 of file POD.cpp.

◆ llzkRecordAttrGet()

MLIR_CAPI_EXPORTED MlirAttribute llzkRecordAttrGet ( MlirStringRef name,
MlirType type )

Creates a new llzk::pod::RecordAttr.

Definition at line 54 of file POD.cpp.

◆ llzkRecordAttrGetName()

MLIR_CAPI_EXPORTED MlirStringRef llzkRecordAttrGetName ( MlirAttribute attr)

Returns the name of the record.

Definition at line 61 of file POD.cpp.

◆ llzkRecordAttrGetNameSym()

MLIR_CAPI_EXPORTED MlirAttribute llzkRecordAttrGetNameSym ( MlirAttribute attr)

Returns the name of the record as a flat symbol attribute.

Definition at line 65 of file POD.cpp.

◆ llzkRecordAttrGetType()

MLIR_CAPI_EXPORTED MlirType llzkRecordAttrGetType ( MlirAttribute attr)

Returns the type of the record.

Definition at line 69 of file POD.cpp.

◆ MLIR_DECLARE_CAPI_DIALECT_REGISTRATION()

MLIR_DECLARE_CAPI_DIALECT_REGISTRATION ( POD ,
llzk__pod  )