LLZK 0.1.0
Veridise's ZK Language IR
|
The dataflow analysis that computes the set of references that LLZK operations use and produce. More...
#include <ConstraintDependencyGraph.h>
Public Member Functions | |
void | visitCallControlFlowTransfer (mlir::CallOpInterface call, dataflow::CallControlFlowAction action, const ConstrainRefLattice &before, ConstrainRefLattice *after) override |
Hook for customizing the behavior of lattice propagation along the call control flow edges. | |
void | visitOperation (mlir::Operation *op, const ConstrainRefLattice &before, ConstrainRefLattice *after) override |
Propagate constrain reference lattice values from operands to results. | |
![]() | |
virtual void | visitRegionBranchControlFlowTransfer (mlir::RegionBranchOpInterface branch, std::optional< unsigned > regionFrom, std::optional< unsigned > regionTo, const ConstrainRefLattice &before, ConstrainRefLattice *after) |
Hook for customizing the behavior of lattice propagation along the control flow edges between regions and their parent op. | |
![]() | |
mlir::LogicalResult | initialize (mlir::Operation *top) override |
Initialize the analysis by visiting every program point whose execution may modify the program state; that is, every operation and block. | |
mlir::LogicalResult | visit (mlir::ProgramPoint point) override |
Visit a program point that modifies the state of the program. | |
Protected Member Functions | |
void | setToEntryState (ConstrainRefLattice *lattice) override |
Set the dense lattice at control flow entry point and propagate an update if it changed. | |
mlir::ChangeResult | fallbackOpUpdate (mlir::Operation *op, const ConstrainRefLattice::ValueMap &operandVals, const ConstrainRefLattice &before, ConstrainRefLattice *after) |
void | arraySubdivisionOpUpdate (mlir::Operation *op, const ConstrainRefLattice::ValueMap &operandVals, const ConstrainRefLattice &before, ConstrainRefLattice *after) |
![]() | |
void | visitCallControlFlowTransfer (mlir::CallOpInterface call, CallControlFlowAction action, const AbstractDenseLattice &before, AbstractDenseLattice *after) final |
Propagate the dense lattice forward along the call control flow edge, which can be either entering or exiting the callee. | |
void | visitRegionBranchControlFlowTransfer (mlir::RegionBranchOpInterface branch, std::optional< unsigned > regionFrom, std::optional< unsigned > regionTo, const AbstractDenseLattice &before, AbstractDenseLattice *after) final |
Propagate the dense lattice forward along the control flow edge from regionFrom to regionTo regions of the branch operation. | |
ConstrainRefLattice * | getLattice (mlir::ProgramPoint point) override |
Get the dense lattice after this program point. | |
void | setToEntryState (AbstractDenseLattice *lattice) override |
Set the dense lattice at control flow entry point and propagate an update if it changed. | |
void | visitOperationImpl (mlir::Operation *op, const AbstractDenseLattice &before, AbstractDenseLattice *after) final |
Type-erased wrappers that convert the abstract dense lattice to a derived lattice and invoke the virtual hooks operating on the derived lattice. | |
![]() | |
const AbstractDenseLattice * | getLatticeFor (mlir::ProgramPoint dependent, mlir::ProgramPoint point) |
Get the dense lattice after the execution of the given program point and add it as a dependency to a program point. | |
void | join (AbstractDenseLattice *lhs, const AbstractDenseLattice &rhs) |
Join a lattice with another and propagate an update if it changed. | |
virtual void | processOperation (mlir::Operation *op) |
Visit an operation. | |
void | visitRegionBranchOperation (mlir::ProgramPoint point, mlir::RegionBranchOpInterface branch, AbstractDenseLattice *after) |
Visit a program point within a region branch operation with predecessors in it. | |
Additional Inherited Members | |
![]() | |
mlir::SymbolTableCollection | tables |
LLZK: Added for use of symbol helper caching. | |
The dataflow analysis that computes the set of references that LLZK operations use and produce.
The analysis is simple: any operation will simply output a union of its input references, regardless of what type of operation it performs, as the analysis is operator-insensitive.
Definition at line 34 of file ConstraintDependencyGraph.h.
|
protected |
Definition at line 201 of file ConstraintDependencyGraph.cpp.
|
protected |
Definition at line 182 of file ConstraintDependencyGraph.cpp.
|
inlineoverrideprotectedvirtual |
Set the dense lattice at control flow entry point and propagate an update if it changed.
Implements llzk::dataflow::DenseForwardDataFlowAnalysis< ConstrainRefLattice >.
Definition at line 52 of file ConstraintDependencyGraph.h.
|
overridevirtual |
Hook for customizing the behavior of lattice propagation along the call control flow edges.
Two types of (forward) propagation are possible here:
action == CallControlFlowAction::Enter
indicates that:before
is the state before the call operation;after
is the state at the beginning of the callee entry block;action == CallControlFlowAction::Exit
indicates that:before
is the state at the end of a callee exit block;after
is the state after the call operation. By default, the after
state is simply joined with the before
state. Concrete analyses can override this behavior or delegate to the parent call for the default behavior. Specifically, if the call
op may affect the lattice prior to entering the callee, the custom behavior can be added for action == CallControlFlowAction::Enter
. If the call
op may affect the lattice post exiting the callee, the custom behavior can be added for action == CallControlFlowAction::Exit
. action == CallControlFlowAction::Enter
indicates that:
before
is the state before the call operation;after
is the state at the beginning of the callee entry block;action == CallControlFlowAction::Exit
indicates that:
before
is the state at the end of a callee exit block;after
is the state after the call operation.action == CallControlFlowAction::External
indicates that:
before
is the state before the call operation.after
is the state after the call operation, since there is no callee body to enter into.Reimplemented from llzk::dataflow::DenseForwardDataFlowAnalysis< ConstrainRefLattice >.
Definition at line 38 of file ConstraintDependencyGraph.cpp.
|
overridevirtual |
Propagate constrain reference lattice values from operands to results.
op | |
before | |
after |
Implements llzk::dataflow::DenseForwardDataFlowAnalysis< ConstrainRefLattice >.
Definition at line 126 of file ConstraintDependencyGraph.cpp.