LLZK 3.0.0
An open-source IR for Zero Knowledge (ZK) circuits
Loading...
Searching...
No Matches

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

#include <ConstraintDependencyGraph.h>

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

Public Types

using Lattice = SourceRefLattice
using OperandValues = mlir::DenseMap<mlir::Value, const Lattice *>
using Base = dataflow::SparseForwardDataFlowAnalysis<Lattice>

Public Member Functions

mlir::LogicalResult visitOperation (mlir::Operation *op, mlir::ArrayRef< const Lattice * > operands, mlir::ArrayRef< Lattice * > results) override
 Propagate SourceRef lattice values from operands to results.
void visitExternalCall (mlir::CallOpInterface call, mlir::ArrayRef< const Lattice * > argumentLattices, mlir::ArrayRef< Lattice * > resultLattices) override
 Visit a call operation to an externally defined function given the lattices of its arguments.
 SparseForwardDataFlowAnalysis (mlir::DataFlowSolver &s)
Public Member Functions inherited from llzk::dataflow::SparseForwardDataFlowAnalysis< SourceRefLattice >
 SparseForwardDataFlowAnalysis (mlir::DataFlowSolver &s)
virtual void visitNonControlFlowArguments (mlir::Operation *, const mlir::RegionSuccessor &successor, mlir::ArrayRef< SourceRefLattice * > 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.

Static Public Member Functions

static const LatticegetLattice (mlir::DataFlowSolver &solver, mlir::Value val)
static SourceRefLatticeValue getValueState (mlir::DataFlowSolver &solver, mlir::Value val)
static mlir::FailureOr< SourceRefLatticeValuegetWriteTargetState (mlir::DataFlowSolver &solver, mlir::Operation *op)

Protected Member Functions

void setToEntryState (Lattice *lattice) override
 Set the given lattice element(s) at control-flow entry point(s).
Protected Member Functions inherited from llzk::dataflow::SparseForwardDataFlowAnalysis< SourceRefLattice >
SourceRefLatticegetLatticeElement (mlir::Value value) override
 Get the lattice element for a value.
const SourceRefLatticegetLatticeElementFor (mlir::ProgramPoint *point, mlir::Value value)
 Get the lattice element for a value and create a dependency on the provided program point.
void setAllToEntryStates (mlir::ArrayRef< SourceRefLattice * > lattices)
Protected Member Functions inherited from llzk::dataflow::AbstractSparseForwardDataFlowAnalysis
 AbstractSparseForwardDataFlowAnalysis (mlir::DataFlowSolver &s)

Static Protected Member Functions

static mlir::ChangeResult fallbackOpUpdate (mlir::Operation *op, const OperandValues &operandVals, mlir::ArrayRef< Lattice * > results)
static SourceRefLatticeValue arraySubdivisionOpUpdate (array::ArrayAccessOpInterface op, const OperandValues &operandVals)

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.

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 36 of file ConstraintDependencyGraph.h.

Member Typedef Documentation

◆ Base

◆ Lattice

◆ OperandValues

using llzk::SourceRefAnalysis::OperandValues = mlir::DenseMap<mlir::Value, const Lattice *>

Definition at line 39 of file ConstraintDependencyGraph.h.

Member Function Documentation

◆ arraySubdivisionOpUpdate()

SourceRefLatticeValue llzk::SourceRefAnalysis::arraySubdivisionOpUpdate ( array::ArrayAccessOpInterface op,
const OperandValues & operandVals )
staticprotected

Definition at line 294 of file ConstraintDependencyGraph.cpp.

◆ fallbackOpUpdate()

ChangeResult llzk::SourceRefAnalysis::fallbackOpUpdate ( mlir::Operation * op,
const OperandValues & operandVals,
mlir::ArrayRef< Lattice * > results )
staticprotected

Definition at line 280 of file ConstraintDependencyGraph.cpp.

◆ getLattice()

const SourceRefAnalysis::Lattice * llzk::SourceRefAnalysis::getLattice ( mlir::DataFlowSolver & solver,
mlir::Value val )
static

Definition at line 44 of file ConstraintDependencyGraph.cpp.

◆ getValueState()

SourceRefLatticeValue llzk::SourceRefAnalysis::getValueState ( mlir::DataFlowSolver & solver,
mlir::Value val )
static

Definition at line 48 of file ConstraintDependencyGraph.cpp.

◆ getWriteTargetState()

mlir::FailureOr< SourceRefLatticeValue > llzk::SourceRefAnalysis::getWriteTargetState ( mlir::DataFlowSolver & solver,
mlir::Operation * op )
static

Definition at line 56 of file ConstraintDependencyGraph.cpp.

◆ setToEntryState()

void llzk::SourceRefAnalysis::setToEntryState ( Lattice * lattice)
overrideprotectedvirtual

Set the given lattice element(s) at control-flow entry point(s).

Implements llzk::dataflow::SparseForwardDataFlowAnalysis< SourceRefLattice >.

Definition at line 123 of file ConstraintDependencyGraph.cpp.

◆ SparseForwardDataFlowAnalysis()

llzk::dataflow::SparseForwardDataFlowAnalysis< Lattice >::SparseForwardDataFlowAnalysis ( mlir::DataFlowSolver & s)
inlineexplicit

Definition at line 133 of file SparseAnalysis.h.

◆ visitExternalCall()

void llzk::SourceRefAnalysis::visitExternalCall ( mlir::CallOpInterface ,
mlir::ArrayRef< const Lattice * > ,
mlir::ArrayRef< Lattice * > resultLattices )
overridevirtual

Visit a call operation to an externally defined function given the lattices of its arguments.

Reimplemented from llzk::dataflow::SparseForwardDataFlowAnalysis< SourceRefLattice >.

Definition at line 220 of file ConstraintDependencyGraph.cpp.

◆ visitOperation()

LogicalResult llzk::SourceRefAnalysis::visitOperation ( mlir::Operation * op,
mlir::ArrayRef< const Lattice * > operands,
mlir::ArrayRef< Lattice * > results )
overridevirtual

Propagate SourceRef lattice values from operands to results.

Parameters
op

Implements llzk::dataflow::SparseForwardDataFlowAnalysis< SourceRefLattice >.

Definition at line 139 of file ConstraintDependencyGraph.cpp.


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