LLZK 0.1.0
An open-source IR for Zero Knowledge (ZK) circuits
Loading...
Searching...
No Matches
POD.cpp File Reference
#include "llzk/CAPI/Builder.h"
#include "llzk/CAPI/Support.h"
#include "llzk/Dialect/POD/IR/Ops.h"
#include "llzk/Dialect/POD/IR/Types.h"
#include "llzk-c/Dialect/POD.h"
#include "llzk-c/Support.h"
#include <mlir/CAPI/IR.h>
#include <mlir/CAPI/Registration.h>
#include <mlir/CAPI/Support.h>
#include <mlir/CAPI/Wrap.h>
#include <mlir/IR/Attributes.h>
#include <mlir/IR/Diagnostics.h>
#include <mlir/Support/LLVM.h>
#include <mlir-c/IR.h>
#include <llvm/ADT/STLExtras.h>
#include <llvm/ADT/SmallVectorExtras.h>
#include <cstdint>
Include dependency graph for POD.cpp:

Go to the source code of this file.

Functions

MlirAttribute llzkRecordAttrGet (MlirStringRef name, MlirType type)
 Creates a new llzk::pod::RecordAttr.
bool llzkAttributeIsARecordAttr (MlirAttribute attr)
MlirStringRef llzkRecordAttrGetName (MlirAttribute attr)
 Returns the name of the record.
MlirAttribute llzkRecordAttrGetNameSym (MlirAttribute attr)
 Returns the name of the record as a flat symbol attribute.
MlirType llzkRecordAttrGetType (MlirAttribute attr)
 Returns the type of the record.
MlirType llzkPodTypeGet (MlirContext context, intptr_t nRecords, MlirAttribute const *records)
 Creates an llzk::pod::PodType using a list of attributes as records.
MlirType llzkPodTypeGetFromInitialValues (MlirContext context, intptr_t nRecords, LlzkRecordValue const *records)
 Creates an llzk::pod::PodType using a list of values for inferring the records.
bool llzkTypeIsAPodType (MlirType type)
intptr_t llzkPodTypeGetNumRecords (MlirType type)
 Returns the number of records in the struct.
void llzkPodTypeGetRecords (MlirType type, MlirAttribute *dst)
 Writes the records into the given array that must have been previously allocated with enough space.
MlirAttribute llzkPodTypeGetNthRecord (MlirType type, intptr_t n)
 Returns the n-th record in the struct.
MlirType llzkPodTypeLookupRecord (MlirType type, MlirStringRef name)
 Lookups a record type by name.
MlirType llzkPodTypeLookupRecordWithinLocation (MlirType type, MlirStringRef name, MlirLocation loc)
 Lookups a record type by name.
MlirType llzkPodTypeLookupRecordWithinOperation (MlirType type, MlirStringRef name, MlirOperation op)
 Lookups a record type by name.
 LLZK_DEFINE_SUFFIX_OP_BUILD_METHOD (NewPodOp, InferredFromInitialValues, intptr_t nValues, LlzkRecordValue const *values)
 LLZK_DEFINE_OP_BUILD_METHOD (NewPodOp, MlirType type, intptr_t nValues, LlzkRecordValue const *values)
 LLZK_DEFINE_SUFFIX_OP_BUILD_METHOD (NewPodOp, WithMapOperands, MlirType type, intptr_t nValues, LlzkRecordValue const *values, LlzkAffineMapOperandsBuilder mapOperands)
bool llzkOperationIsANewPodOp (MlirOperation op)
bool llzkOperationIsAReadPodOp (MlirOperation op)
bool llzkOperationIsAWritePodOp (MlirOperation op)

Function Documentation

◆ LLZK_DEFINE_OP_BUILD_METHOD()

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

Definition at line 153 of file POD.cpp.

◆ LLZK_DEFINE_SUFFIX_OP_BUILD_METHOD() [1/2]

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

Definition at line 146 of file POD.cpp.

◆ LLZK_DEFINE_SUFFIX_OP_BUILD_METHOD() [2/2]

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

Definition at line 160 of file POD.cpp.

◆ llzkAttributeIsARecordAttr()

bool llzkAttributeIsARecordAttr ( MlirAttribute attr)

Definition at line 59 of file POD.cpp.

◆ llzkOperationIsANewPodOp()

bool llzkOperationIsANewPodOp ( MlirOperation op)

Definition at line 176 of file POD.cpp.

◆ llzkOperationIsAReadPodOp()

bool llzkOperationIsAReadPodOp ( MlirOperation op)

Definition at line 182 of file POD.cpp.

◆ llzkOperationIsAWritePodOp()

bool llzkOperationIsAWritePodOp ( MlirOperation op)

Definition at line 188 of file POD.cpp.

◆ llzkPodTypeGet()

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()

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()

MlirAttribute llzkPodTypeGetNthRecord ( MlirType type,
intptr_t n )

Returns the n-th record in the struct.

Definition at line 104 of file POD.cpp.

◆ llzkPodTypeGetNumRecords()

intptr_t llzkPodTypeGetNumRecords ( MlirType type)

Returns the number of records in the struct.

Definition at line 94 of file POD.cpp.

◆ llzkPodTypeGetRecords()

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()

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()

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()

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()

MlirAttribute llzkRecordAttrGet ( MlirStringRef name,
MlirType type )

Creates a new llzk::pod::RecordAttr.

Definition at line 54 of file POD.cpp.

◆ llzkRecordAttrGetName()

MlirStringRef llzkRecordAttrGetName ( MlirAttribute attr)

Returns the name of the record.

Definition at line 61 of file POD.cpp.

◆ llzkRecordAttrGetNameSym()

MlirAttribute llzkRecordAttrGetNameSym ( MlirAttribute attr)

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

Definition at line 65 of file POD.cpp.

◆ llzkRecordAttrGetType()

MlirType llzkRecordAttrGetType ( MlirAttribute attr)

Returns the type of the record.

Definition at line 69 of file POD.cpp.

◆ llzkTypeIsAPodType()

bool llzkTypeIsAPodType ( MlirType type)

Definition at line 92 of file POD.cpp.