|
LLZK 3.0.0
An open-source IR for Zero Knowledge (ZK) circuits
|
A sparse forward data-flow analysis for propagating SSA value lattices across the IR by implementing transfer functions for operations. More...
#include <SparseAnalysis.h>
Public Member Functions | |
| SparseForwardDataFlowAnalysis (mlir::DataFlowSolver &s) | |
| virtual mlir::LogicalResult | visitOperation (mlir::Operation *op, mlir::ArrayRef< const StateT * > operands, mlir::ArrayRef< StateT * > results)=0 |
| Visit an operation with the lattices of its operands. | |
| virtual void | visitExternalCall (mlir::CallOpInterface, mlir::ArrayRef< const StateT * >, mlir::ArrayRef< StateT * > resultLattices) |
| Visit a call operation to an externally defined function given the lattices of its arguments. | |
| virtual void | visitNonControlFlowArguments (mlir::Operation *, const mlir::RegionSuccessor &successor, mlir::ArrayRef< StateT * > argLattices, unsigned firstIndex) |
| Given an operation with possible region control-flow, the lattices of the operands, and a region successor, compute the lattice values for block arguments that are not accounted for by the branching control flow (ex. | |
| Public Member Functions inherited from llzk::dataflow::AbstractSparseForwardDataFlowAnalysis | |
| mlir::LogicalResult | initialize (mlir::Operation *top) override |
| Initialize the analysis while preserving the program-order visitation of the old LLZK sparse analysis port. | |
| mlir::LogicalResult | visit (mlir::ProgramPoint *point) override |
| Delegate block starts and result-producing operations to upstream MLIR. | |
Protected Member Functions | |
| StateT * | getLatticeElement (mlir::Value value) override |
| Get the lattice element for a value. | |
| const StateT * | getLatticeElementFor (mlir::ProgramPoint *point, mlir::Value value) |
| Get the lattice element for a value and create a dependency on the provided program point. | |
| virtual void | setToEntryState (StateT *lattice)=0 |
| Set the given lattice element(s) at control-flow entry point(s). | |
| void | setAllToEntryStates (mlir::ArrayRef< StateT * > lattices) |
| Protected Member Functions inherited from llzk::dataflow::AbstractSparseForwardDataFlowAnalysis | |
| AbstractSparseForwardDataFlowAnalysis (mlir::DataFlowSolver &s) | |
Additional Inherited Members | |
| Protected Attributes inherited from llzk::dataflow::AbstractSparseForwardDataFlowAnalysis | |
| mlir::SymbolTableCollection | tables |
| LLZK: Kept as a compatibility cache for analyses that derived from the old ported class and used this protected member. | |
A sparse forward data-flow analysis for propagating SSA value lattices across the IR by implementing transfer functions for operations.
StateT is expected to be a subclass of AbstractSparseLattice.
Definition at line 126 of file SparseAnalysis.h.
|
inlineexplicit |
Definition at line 133 of file SparseAnalysis.h.
|
inlineoverrideprotected |
Get the lattice element for a value.
Definition at line 168 of file SparseAnalysis.h.
|
inlineprotected |
Get the lattice element for a value and create a dependency on the provided program point.
Definition at line 172 of file SparseAnalysis.h.
|
inlineprotected |
Definition at line 180 of file SparseAnalysis.h.
|
protectedpure virtual |
Set the given lattice element(s) at control-flow entry point(s).
Implemented in llzk::SourceRefAnalysis.
|
inlinevirtual |
Visit a call operation to an externally defined function given the lattices of its arguments.
Reimplemented in llzk::SourceRefAnalysis.
Definition at line 145 of file SparseAnalysis.h.
|
inlinevirtual |
Given an operation with possible region control-flow, the lattices of the operands, and a region successor, compute the lattice values for block arguments that are not accounted for by the branching control flow (ex.
the bounds of loops). By default, this method marks all such lattice elements as having reached a pessimistic fixpoint. firstIndex is the index of the first element of argLattices that is set by control-flow.
Definition at line 158 of file SparseAnalysis.h.
|
pure virtual |
Visit an operation with the lattices of its operands.
This function is expected to set the lattices of the operation's results. LLZK also invokes this hook for live, non-call, non-region-branch operations with no results.
Implemented in llzk::IntervalDataFlowAnalysis, and llzk::SourceRefAnalysis.