LLZK 2.0.0
An open-source IR for Zero Knowledge (ZK) circuits
Loading...
Searching...
No Matches
Poly.cpp File Reference
#include "llzk-c/Dialect/Poly.h"
#include "llzk/CAPI/Builder.h"
#include "llzk/CAPI/Support.h"
#include "llzk/Dialect/Polymorphic/IR/Dialect.h"
#include "llzk/Dialect/Polymorphic/IR/Ops.h"
#include "llzk/Dialect/Polymorphic/IR/Types.h"
#include "llzk/Dialect/Polymorphic/Transforms/TransformationPasses.h"
#include "llzk/Util/Compare.h"
#include <mlir-c/Pass.h>
#include <mlir/CAPI/AffineExpr.h>
#include <mlir/CAPI/AffineMap.h>
#include <mlir/CAPI/Pass.h>
#include <mlir/CAPI/Registration.h>
#include <mlir/CAPI/Wrap.h>
#include <mlir/IR/BuiltinAttributes.h>
#include <mlir/Support/LLVM.h>
#include "llzk/Dialect/Polymorphic/IR/Ops.capi.cpp.inc"
#include "llzk/Dialect/Polymorphic/IR/Types.capi.cpp.inc"
#include "llzk/Dialect/Polymorphic/Transforms/TransformationPasses.capi.cpp.inc"
Include dependency graph for Poly.cpp:

Go to the source code of this file.

Functions

MlirType llzkPoly_TypeVarTypeGetFromStringRef (MlirContext ctx, MlirStringRef name)
 Creates a llzk::polymorphic::TypeVarType.
MlirType llzkPoly_TypeVarTypeGetFromAttr (MlirAttribute attrWrapper)
 Creates a llzk::polymorphic::TypeVarType from either a StringAttr or a FlatSymbolRefAttr.
MlirBlock llzkPoly_TemplateOpGetBody (MlirOperation op)
 Returns the single body Block within the TemplateOp's Region.
bool llzkPoly_TemplateOpHasConstParamOps (MlirOperation op)
 Returns true if the TemplateOp has any TemplateParamOp children.
intptr_t llzkPoly_TemplateOpNumConstParamOps (MlirOperation op)
 Returns the number of TemplateParamOp children in the TemplateOp.
void llzkPoly_TemplateOpGetConstParamNames (MlirOperation op, MlirAttribute *dst)
 Writes into the destination buffer the names of all TemplateParamOp children as FlatSymbolRefAttr attributes, in definition order.
bool llzkPoly_TemplateOpHasConstParamNamed (MlirOperation op, MlirStringRef find)
 Returns true if the TemplateOp has a TemplateParamOp with the given name.
bool llzkPoly_TemplateOpHasConstExprOps (MlirOperation op)
 Returns true if the TemplateOp has any TemplateExprOp children.
intptr_t llzkPoly_TemplateOpNumConstExprOps (MlirOperation op)
 Returns the number of TemplateExprOp children in the TemplateOp.
void llzkPoly_TemplateOpGetConstExprNames (MlirOperation op, MlirAttribute *dst)
 Writes into the destination buffer the names of all TemplateExprOp children as FlatSymbolRefAttr attributes, in definition order.
bool llzkPoly_TemplateOpHasConstExprNamed (MlirOperation op, MlirStringRef find)
 Returns true if the TemplateOp has a TemplateExprOp with the given name.
 LLZK_DEFINE_OP_BUILD_METHOD (Poly, ApplyMapOp, MlirAttribute map, MlirValueRange mapOperands)
 LLZK_DEFINE_SUFFIX_OP_BUILD_METHOD (Poly, ApplyMapOp, WithAffineMap, MlirAffineMap map, MlirValueRange mapOperands)
 LLZK_DEFINE_SUFFIX_OP_BUILD_METHOD (Poly, ApplyMapOp, WithAffineExpr, MlirAffineExpr expr, MlirValueRange mapOperands)
intptr_t llzkPoly_ApplyMapOpGetNumDimOperands (MlirOperation op)
 Returns the number of operands that correspond to dimensions in the affine map.
void llzkPoly_ApplyMapOpGetDimOperands (MlirOperation op, MlirValue *dst)
 Writes into the destination buffer the operands that correspond to dimensions in the affine map.
intptr_t llzkPoly_ApplyMapOpGetNumSymbolOperands (MlirOperation op)
 Returns the number of operands that correspond to symbols in the affine map.
void llzkPoly_ApplyMapOpGetSymbolOperands (MlirOperation op, MlirValue *dst)
 Writes into the destination buffer the operands that correspond to symbols in the affine map.

Function Documentation

◆ LLZK_DEFINE_OP_BUILD_METHOD()

LLZK_DEFINE_OP_BUILD_METHOD ( Poly ,
ApplyMapOp ,
MlirAttribute map,
MlirValueRange mapOperands )

Definition at line 109 of file Poly.cpp.

◆ LLZK_DEFINE_SUFFIX_OP_BUILD_METHOD() [1/2]

LLZK_DEFINE_SUFFIX_OP_BUILD_METHOD ( Poly ,
ApplyMapOp ,
WithAffineExpr ,
MlirAffineExpr expr,
MlirValueRange mapOperands )

Definition at line 131 of file Poly.cpp.

◆ LLZK_DEFINE_SUFFIX_OP_BUILD_METHOD() [2/2]

LLZK_DEFINE_SUFFIX_OP_BUILD_METHOD ( Poly ,
ApplyMapOp ,
WithAffineMap ,
MlirAffineMap map,
MlirValueRange mapOperands )

Definition at line 119 of file Poly.cpp.

◆ llzkPoly_ApplyMapOpGetDimOperands()

void llzkPoly_ApplyMapOpGetDimOperands ( MlirOperation op,
MlirValue * dst )

Writes into the destination buffer the operands that correspond to dimensions in the affine map.

The buffer needs to be preallocated first with the necessary amount and the caller is responsible of its lifetime. See llzkPoly_ApplyMapOpGetNumDimOperands.

Definition at line 165 of file Poly.cpp.

◆ llzkPoly_ApplyMapOpGetNumDimOperands()

intptr_t llzkPoly_ApplyMapOpGetNumDimOperands ( MlirOperation op)

Returns the number of operands that correspond to dimensions in the affine map.

Definition at line 158 of file Poly.cpp.

◆ llzkPoly_ApplyMapOpGetNumSymbolOperands()

intptr_t llzkPoly_ApplyMapOpGetNumSymbolOperands ( MlirOperation op)

Returns the number of operands that correspond to symbols in the affine map.

Definition at line 170 of file Poly.cpp.

◆ llzkPoly_ApplyMapOpGetSymbolOperands()

void llzkPoly_ApplyMapOpGetSymbolOperands ( MlirOperation op,
MlirValue * dst )

Writes into the destination buffer the operands that correspond to symbols in the affine map.

The buffer needs to be preallocated first with the necessary amount and the caller is responsible of its lifetime. See llzkPoly_ApplyMapOpGetNumSymbolOperands.

Definition at line 177 of file Poly.cpp.

◆ llzkPoly_TemplateOpGetBody()

MlirBlock llzkPoly_TemplateOpGetBody ( MlirOperation op)

Returns the single body Block within the TemplateOp's Region.

Definition at line 71 of file Poly.cpp.

◆ llzkPoly_TemplateOpGetConstExprNames()

void llzkPoly_TemplateOpGetConstExprNames ( MlirOperation op,
MlirAttribute * dst )

Writes into the destination buffer the names of all TemplateExprOp children as FlatSymbolRefAttr attributes, in definition order.

The buffer must be preallocated and the caller is responsible for its lifetime. See llzkPoly_TemplateOpNumConstExprOps.

Definition at line 97 of file Poly.cpp.

◆ llzkPoly_TemplateOpGetConstParamNames()

void llzkPoly_TemplateOpGetConstParamNames ( MlirOperation op,
MlirAttribute * dst )

Writes into the destination buffer the names of all TemplateParamOp children as FlatSymbolRefAttr attributes, in definition order.

The buffer must be preallocated and the caller is responsible for its lifetime. See llzkPoly_TemplateOpNumConstParamOps.

Definition at line 81 of file Poly.cpp.

◆ llzkPoly_TemplateOpHasConstExprNamed()

bool llzkPoly_TemplateOpHasConstExprNamed ( MlirOperation op,
MlirStringRef find )

Returns true if the TemplateOp has a TemplateExprOp with the given name.

Definition at line 101 of file Poly.cpp.

◆ llzkPoly_TemplateOpHasConstExprOps()

bool llzkPoly_TemplateOpHasConstExprOps ( MlirOperation op)

Returns true if the TemplateOp has any TemplateExprOp children.

Definition at line 89 of file Poly.cpp.

◆ llzkPoly_TemplateOpHasConstParamNamed()

bool llzkPoly_TemplateOpHasConstParamNamed ( MlirOperation op,
MlirStringRef find )

Returns true if the TemplateOp has a TemplateParamOp with the given name.

Definition at line 85 of file Poly.cpp.

◆ llzkPoly_TemplateOpHasConstParamOps()

bool llzkPoly_TemplateOpHasConstParamOps ( MlirOperation op)

Returns true if the TemplateOp has any TemplateParamOp children.

Definition at line 73 of file Poly.cpp.

◆ llzkPoly_TemplateOpNumConstExprOps()

intptr_t llzkPoly_TemplateOpNumConstExprOps ( MlirOperation op)

Returns the number of TemplateExprOp children in the TemplateOp.

Definition at line 93 of file Poly.cpp.

◆ llzkPoly_TemplateOpNumConstParamOps()

intptr_t llzkPoly_TemplateOpNumConstParamOps ( MlirOperation op)

Returns the number of TemplateParamOp children in the TemplateOp.

Definition at line 77 of file Poly.cpp.

◆ llzkPoly_TypeVarTypeGetFromAttr()

MlirType llzkPoly_TypeVarTypeGetFromAttr ( MlirAttribute attrWrapper)

Creates a llzk::polymorphic::TypeVarType from either a StringAttr or a FlatSymbolRefAttr.

Definition at line 51 of file Poly.cpp.

◆ llzkPoly_TypeVarTypeGetFromStringRef()

MlirType llzkPoly_TypeVarTypeGetFromStringRef ( MlirContext ctx,
MlirStringRef name )

Creates a llzk::polymorphic::TypeVarType.

Definition at line 47 of file Poly.cpp.