LLZK 2.0.0
An open-source IR for Zero Knowledge (ZK) circuits
Loading...
Searching...
No Matches
Poly.h File Reference
#include "llzk-c/Support.h"
#include <mlir-c/AffineExpr.h>
#include <mlir-c/AffineMap.h>
#include <mlir-c/IR.h>
#include <mlir-c/Support.h>
#include "llzk/Dialect/Polymorphic/IR/Ops.capi.h.inc"
#include "llzk/Dialect/Polymorphic/IR/Types.capi.h.inc"
#include "llzk/Dialect/Polymorphic/Transforms/TransformationPasses.capi.h.inc"
Include dependency graph for Poly.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

 MLIR_DECLARE_CAPI_DIALECT_REGISTRATION (Polymorphic, llzk__polymorphic)
 Get reference to the LLZK poly dialect.
MLIR_CAPI_EXPORTED MlirType llzkPoly_TypeVarTypeGetFromStringRef (MlirContext context, MlirStringRef value)
 Creates a llzk::polymorphic::TypeVarType.
MLIR_CAPI_EXPORTED MlirType llzkPoly_TypeVarTypeGetFromAttr (MlirAttribute value)
 Creates a llzk::polymorphic::TypeVarType from either a StringAttr or a FlatSymbolRefAttr.
MLIR_CAPI_EXPORTED MlirBlock llzkPoly_TemplateOpGetBody (MlirOperation op)
 Returns the single body Block within the TemplateOp's Region.
MLIR_CAPI_EXPORTED bool llzkPoly_TemplateOpHasConstParamOps (MlirOperation op)
 Returns true if the TemplateOp has any TemplateParamOp children.
MLIR_CAPI_EXPORTED intptr_t llzkPoly_TemplateOpNumConstParamOps (MlirOperation op)
 Returns the number of TemplateParamOp children in the TemplateOp.
MLIR_CAPI_EXPORTED void llzkPoly_TemplateOpGetConstParamNames (MlirOperation op, MlirAttribute *dst)
 Writes into the destination buffer the names of all TemplateParamOp children as FlatSymbolRefAttr attributes, in definition order.
MLIR_CAPI_EXPORTED bool llzkPoly_TemplateOpHasConstParamNamed (MlirOperation op, MlirStringRef find)
 Returns true if the TemplateOp has a TemplateParamOp with the given name.
MLIR_CAPI_EXPORTED bool llzkPoly_TemplateOpHasConstExprOps (MlirOperation op)
 Returns true if the TemplateOp has any TemplateExprOp children.
MLIR_CAPI_EXPORTED intptr_t llzkPoly_TemplateOpNumConstExprOps (MlirOperation op)
 Returns the number of TemplateExprOp children in the TemplateOp.
MLIR_CAPI_EXPORTED void llzkPoly_TemplateOpGetConstExprNames (MlirOperation op, MlirAttribute *dst)
 Writes into the destination buffer the names of all TemplateExprOp children as FlatSymbolRefAttr attributes, in definition order.
MLIR_CAPI_EXPORTED bool llzkPoly_TemplateOpHasConstExprNamed (MlirOperation op, MlirStringRef find)
 Returns true if the TemplateOp has a TemplateExprOp with the given name.
 LLZK_DECLARE_OP_BUILD_METHOD (Poly, ApplyMapOp, MlirAttribute affineMapAttr, MlirValueRange operands)
 Creates an ApplyMapOp with the given attribute that has to be of type AffineMapAttr.
 LLZK_DECLARE_SUFFIX_OP_BUILD_METHOD (Poly, ApplyMapOp, WithAffineMap, MlirAffineMap affineMap, MlirValueRange operands)
 Creates an ApplyMapOp with the given affine map.
 LLZK_DECLARE_SUFFIX_OP_BUILD_METHOD (Poly, ApplyMapOp, WithAffineExpr, MlirAffineExpr affineExpr, MlirValueRange operands)
 Creates an ApplyMapOp with the given affine expression.
MLIR_CAPI_EXPORTED intptr_t llzkPoly_ApplyMapOpGetNumDimOperands (MlirOperation op)
 Returns the number of operands that correspond to dimensions in the affine map.
MLIR_CAPI_EXPORTED void llzkPoly_ApplyMapOpGetDimOperands (MlirOperation op, MlirValue *dst)
 Writes into the destination buffer the operands that correspond to dimensions in the affine map.
MLIR_CAPI_EXPORTED intptr_t llzkPoly_ApplyMapOpGetNumSymbolOperands (MlirOperation op)
 Returns the number of operands that correspond to symbols in the affine map.
MLIR_CAPI_EXPORTED 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_DECLARE_OP_BUILD_METHOD()

LLZK_DECLARE_OP_BUILD_METHOD ( Poly ,
ApplyMapOp ,
MlirAttribute affineMapAttr,
MlirValueRange operands )

Creates an ApplyMapOp with the given attribute that has to be of type AffineMapAttr.

◆ LLZK_DECLARE_SUFFIX_OP_BUILD_METHOD() [1/2]

LLZK_DECLARE_SUFFIX_OP_BUILD_METHOD ( Poly ,
ApplyMapOp ,
WithAffineExpr ,
MlirAffineExpr affineExpr,
MlirValueRange operands )

Creates an ApplyMapOp with the given affine expression.

◆ LLZK_DECLARE_SUFFIX_OP_BUILD_METHOD() [2/2]

LLZK_DECLARE_SUFFIX_OP_BUILD_METHOD ( Poly ,
ApplyMapOp ,
WithAffineMap ,
MlirAffineMap affineMap,
MlirValueRange operands )

Creates an ApplyMapOp with the given affine map.

◆ llzkPoly_ApplyMapOpGetDimOperands()

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

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

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

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

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

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

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

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

MLIR_CAPI_EXPORTED bool llzkPoly_TemplateOpHasConstExprOps ( MlirOperation op)

Returns true if the TemplateOp has any TemplateExprOp children.

Definition at line 89 of file Poly.cpp.

◆ llzkPoly_TemplateOpHasConstParamNamed()

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

MLIR_CAPI_EXPORTED bool llzkPoly_TemplateOpHasConstParamOps ( MlirOperation op)

Returns true if the TemplateOp has any TemplateParamOp children.

Definition at line 73 of file Poly.cpp.

◆ llzkPoly_TemplateOpNumConstExprOps()

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

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

MLIR_CAPI_EXPORTED MlirType llzkPoly_TypeVarTypeGetFromAttr ( MlirAttribute value)

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

Definition at line 51 of file Poly.cpp.

◆ llzkPoly_TypeVarTypeGetFromStringRef()

MLIR_CAPI_EXPORTED MlirType llzkPoly_TypeVarTypeGetFromStringRef ( MlirContext context,
MlirStringRef value )

Creates a llzk::polymorphic::TypeVarType.

Definition at line 47 of file Poly.cpp.

◆ MLIR_DECLARE_CAPI_DIALECT_REGISTRATION()

MLIR_DECLARE_CAPI_DIALECT_REGISTRATION ( Polymorphic ,
llzk__polymorphic  )

Get reference to the LLZK poly dialect.