Builds out a LLZK-compliant module and provides utilities for populating that module.
More...
|
| ModuleBuilder (mlir::ModuleOp m) |
|
mlir::Location | getUnknownLoc () |
|
ModuleBuilder & | insertEmptyStruct (std::string_view structName, mlir::Location loc, int numStructParams=-1) |
|
ModuleBuilder & | insertEmptyStruct (std::string_view structName, int numStructParams=-1) |
|
ModuleBuilder & | insertComputeOnlyStruct (std::string_view structName, mlir::Location structLoc, mlir::Location computeLoc) |
|
ModuleBuilder & | insertComputeOnlyStruct (std::string_view structName) |
|
ModuleBuilder & | insertConstrainOnlyStruct (std::string_view structName, mlir::Location structLoc, mlir::Location constrainLoc) |
|
ModuleBuilder & | insertConstrainOnlyStruct (std::string_view structName) |
|
ModuleBuilder & | insertFullStruct (std::string_view structName, mlir::Location structLoc, mlir::Location computeLoc, mlir::Location constrainLoc, int numStructParams=-1) |
|
ModuleBuilder & | insertFullStruct (std::string_view structName, int numStructParams=-1) |
| Inserts a struct with both compute and constrain functions.
|
|
ModuleBuilder & | insertComputeFn (llzk::component::StructDefOp op, mlir::Location loc) |
| compute returns the type of the struct that defines it.
|
|
ModuleBuilder & | insertComputeFn (std::string_view structName, mlir::Location loc) |
|
ModuleBuilder & | insertComputeFn (std::string_view structName) |
|
ModuleBuilder & | insertConstrainFn (llzk::component::StructDefOp op, mlir::Location loc) |
| constrain accepts the struct type as the first argument.
|
|
ModuleBuilder & | insertConstrainFn (std::string_view structName, mlir::Location loc) |
|
ModuleBuilder & | insertConstrainFn (std::string_view structName) |
|
ModuleBuilder & | insertComputeCall (llzk::component::StructDefOp caller, llzk::component::StructDefOp callee, mlir::Location callLoc) |
| Only requirement for compute is the call itself.
|
|
ModuleBuilder & | insertComputeCall (std::string_view caller, std::string_view callee, mlir::Location callLoc) |
|
ModuleBuilder & | insertComputeCall (std::string_view caller, std::string_view callee) |
|
ModuleBuilder & | insertConstrainCall (llzk::component::StructDefOp caller, llzk::component::StructDefOp callee, mlir::Location callLoc, mlir::Location fieldDefLoc) |
| To call a constraint function, you must:
|
|
ModuleBuilder & | insertConstrainCall (std::string_view caller, std::string_view callee, mlir::Location callLoc, mlir::Location fieldDefLoc) |
|
ModuleBuilder & | insertConstrainCall (std::string_view caller, std::string_view callee) |
|
ModuleBuilder & | insertGlobalFunc (std::string_view funcName, ::mlir::FunctionType type, mlir::Location loc) |
|
ModuleBuilder & | insertGlobalFunc (std::string_view funcName, ::mlir::FunctionType type) |
|
ModuleBuilder & | insertGlobalCall (function::FuncDefOp caller, std::string_view callee, mlir::Location callLoc) |
|
ModuleBuilder & | insertGlobalCall (function::FuncDefOp caller, std::string_view callee) |
|
mlir::ModuleOp & | getRootModule () |
| Get the top-level LLZK module.
|
|
mlir::FailureOr< llzk::component::StructDefOp > | getStruct (std::string_view structName) const |
|
mlir::FailureOr< function::FuncDefOp > | getComputeFn (std::string_view structName) const |
|
mlir::FailureOr< function::FuncDefOp > | getComputeFn (llzk::component::StructDefOp op) const |
|
mlir::FailureOr< function::FuncDefOp > | getConstrainFn (std::string_view structName) |
|
mlir::FailureOr< function::FuncDefOp > | getConstrainFn (llzk::component::StructDefOp op) |
|
mlir::FailureOr< function::FuncDefOp > | getGlobalFunc (std::string_view funcName) const |
|
bool | computeReachable (llzk::component::StructDefOp caller, llzk::component::StructDefOp callee) |
| Returns if the callee compute function is reachable by the caller by construction.
|
|
bool | computeReachable (std::string_view caller, std::string_view callee) |
|
bool | constrainReachable (llzk::component::StructDefOp caller, llzk::component::StructDefOp callee) |
| Returns if the callee compute function is reachable by the caller by construction.
|
|
bool | constrainReachable (std::string_view caller, std::string_view callee) |
|
Builds out a LLZK-compliant module and provides utilities for populating that module.
This class is designed to be used by front-ends looking to generate LLZK IR programmatically and is also a useful unit testing facility. TODO: this is a WIP, flesh this class out as needed.
Definition at line 41 of file Builders.h.