LLZK 0.1.0
Veridise's ZK Language IR
Loading...
Searching...
No Matches
llzk::ConstrainRefAnalysis Class Reference

The dataflow analysis that computes the set of references that LLZK operations use and produce. More...

#include <ConstraintDependencyGraph.h>

Inheritance diagram for llzk::ConstrainRefAnalysis:
[legend]
Collaboration diagram for llzk::ConstrainRefAnalysis:
[legend]

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.
 
- Public Member Functions inherited from llzk::dataflow::DenseForwardDataFlowAnalysis< ConstrainRefLattice >
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.
 
- Public Member Functions inherited from llzk::dataflow::AbstractDenseForwardDataFlowAnalysis
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)
 
- Protected Member Functions inherited from llzk::dataflow::DenseForwardDataFlowAnalysis< ConstrainRefLattice >
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.
 
ConstrainRefLatticegetLattice (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.
 
- Protected Member Functions inherited from llzk::dataflow::AbstractDenseForwardDataFlowAnalysis
const AbstractDenseLatticegetLatticeFor (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

- Protected Attributes inherited from llzk::dataflow::AbstractDenseForwardDataFlowAnalysis
mlir::SymbolTableCollection tables
 LLZK: Added for use of symbol helper caching.
 

Detailed Description

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.

Member Function Documentation

◆ arraySubdivisionOpUpdate()

void llzk::ConstrainRefAnalysis::arraySubdivisionOpUpdate ( mlir::Operation * op,
const ConstrainRefLattice::ValueMap & operandVals,
const ConstrainRefLattice & before,
ConstrainRefLattice * after )
protected

Definition at line 201 of file ConstraintDependencyGraph.cpp.

◆ fallbackOpUpdate()

mlir::ChangeResult llzk::ConstrainRefAnalysis::fallbackOpUpdate ( mlir::Operation * op,
const ConstrainRefLattice::ValueMap & operandVals,
const ConstrainRefLattice & before,
ConstrainRefLattice * after )
protected

Definition at line 182 of file ConstraintDependencyGraph.cpp.

◆ setToEntryState()

void llzk::ConstrainRefAnalysis::setToEntryState ( ConstrainRefLattice * lattice)
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.

◆ visitCallControlFlowTransfer()

void llzk::ConstrainRefAnalysis::visitCallControlFlowTransfer ( mlir::CallOpInterface call,
dataflow::CallControlFlowAction action,
const ConstrainRefLattice & before,
ConstrainRefLattice * after )
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.

◆ visitOperation()

void llzk::ConstrainRefAnalysis::visitOperation ( mlir::Operation * op,
const ConstrainRefLattice & before,
ConstrainRefLattice * after )
overridevirtual

Propagate constrain reference lattice values from operands to results.

Parameters
op
before
after

Implements llzk::dataflow::DenseForwardDataFlowAnalysis< ConstrainRefLattice >.

Definition at line 126 of file ConstraintDependencyGraph.cpp.


The documentation for this class was generated from the following files: