LLZK 0.1.0
Veridise's ZK Language IR
Loading...
Searching...
No Matches
llzk::dataflow::AbstractSparseForwardDataFlowAnalysis Class Referenceabstract

LLZK: This class has been ported from the MLIR DenseAnalysis utilities to allow for the use of custom LLZK symbol lookup logic. More...

#include <SparseAnalysis.h>

Inheritance diagram for llzk::dataflow::AbstractSparseForwardDataFlowAnalysis:
[legend]
Collaboration diagram for llzk::dataflow::AbstractSparseForwardDataFlowAnalysis:
[legend]

Public Member Functions

mlir::LogicalResult initialize (mlir::Operation *top) override
 Initialize the analysis by visiting every owner of an SSA value: all operations and blocks.
mlir::LogicalResult visit (mlir::ProgramPoint *point) override
 Visit a program point.

Protected Member Functions

 AbstractSparseForwardDataFlowAnalysis (mlir::DataFlowSolver &solver)
virtual mlir::LogicalResult visitOperationImpl (mlir::Operation *op, mlir::ArrayRef< const AbstractSparseLattice * > operandLattices, mlir::ArrayRef< AbstractSparseLattice * > resultLattices)=0
 The operation transfer function.
virtual void visitExternalCallImpl (mlir::CallOpInterface call, mlir::ArrayRef< const AbstractSparseLattice * > argumentLattices, mlir::ArrayRef< AbstractSparseLattice * > resultLattices)=0
 The transfer function for calls to external functions.
virtual void visitNonControlFlowArgumentsImpl (mlir::Operation *op, const mlir::RegionSuccessor &successor, mlir::ArrayRef< AbstractSparseLattice * > argLattices, unsigned firstIndex)=0
 Given an operation with 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.
virtual AbstractSparseLatticegetLatticeElement (mlir::Value value)=0
 Get the lattice element of a value.
const AbstractSparseLatticegetLatticeElementFor (mlir::ProgramPoint *point, mlir::Value value)
 Get a read-only lattice element for a value and add it as a dependency to a program point.
virtual void setToEntryState (AbstractSparseLattice *lattice)=0
 Set the given lattice element(s) at control flow entry point(s).
void setAllToEntryStates (mlir::ArrayRef< AbstractSparseLattice * > lattices)
void join (AbstractSparseLattice *lhs, const AbstractSparseLattice &rhs)
 Join the lattice element and propagate and update if it changed.

Protected Attributes

mlir::SymbolTableCollection tables
 LLZK: Added for use of symbol helper caching.

Detailed Description

LLZK: This class has been ported from the MLIR DenseAnalysis utilities to allow for the use of custom LLZK symbol lookup logic.

The class has been left as unmodified as possible, with explicit comments added where modifications have been made.

Base class for sparse forward data-flow analyses. A sparse analysis implements a transfer function on operations from the lattices of the operands to the lattices of the results. This analysis will propagate lattices across control-flow edges and the callgraph using liveness information.

Visit a program point in sparse forward data-flow analysis will invoke the transfer function of the operation preceding the program point iterator. Visit a program point at the begining of block will visit the block itself.

Definition at line 61 of file SparseAnalysis.h.

Constructor & Destructor Documentation

◆ AbstractSparseForwardDataFlowAnalysis()

llzk::dataflow::AbstractSparseForwardDataFlowAnalysis::AbstractSparseForwardDataFlowAnalysis ( mlir::DataFlowSolver & solver)
explicitprotected

Definition at line 51 of file SparseAnalysis.cpp.

Member Function Documentation

◆ getLatticeElement()

virtual AbstractSparseLattice * llzk::dataflow::AbstractSparseForwardDataFlowAnalysis::getLatticeElement ( mlir::Value value)
protectedpure virtual

◆ getLatticeElementFor()

const AbstractSparseLattice * llzk::dataflow::AbstractSparseForwardDataFlowAnalysis::getLatticeElementFor ( mlir::ProgramPoint * point,
mlir::Value value )
protected

Get a read-only lattice element for a value and add it as a dependency to a program point.

Definition at line 346 of file SparseAnalysis.cpp.

◆ initialize()

LogicalResult llzk::dataflow::AbstractSparseForwardDataFlowAnalysis::initialize ( mlir::Operation * top)
override

Initialize the analysis by visiting every owner of an SSA value: all operations and blocks.

Definition at line 56 of file SparseAnalysis.cpp.

◆ join()

void llzk::dataflow::AbstractSparseForwardDataFlowAnalysis::join ( AbstractSparseLattice * lhs,
const AbstractSparseLattice & rhs )
protected

Join the lattice element and propagate and update if it changed.

Definition at line 360 of file SparseAnalysis.cpp.

◆ setAllToEntryStates()

void llzk::dataflow::AbstractSparseForwardDataFlowAnalysis::setAllToEntryStates ( mlir::ArrayRef< AbstractSparseLattice * > lattices)
protected

Definition at line 352 of file SparseAnalysis.cpp.

◆ setToEntryState()

virtual void llzk::dataflow::AbstractSparseForwardDataFlowAnalysis::setToEntryState ( AbstractSparseLattice * lattice)
protectedpure virtual

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

◆ visit()

LogicalResult llzk::dataflow::AbstractSparseForwardDataFlowAnalysis::visit ( mlir::ProgramPoint * point)
override

Visit a program point.

If this is at beginning of block and all control-flow predecessors or callsites are known, then the arguments lattices are propagated from them. If this is after call operation or an operation with region control-flow, then its result lattices are set accordingly. Otherwise, the operation transfer function is invoked.

Definition at line 94 of file SparseAnalysis.cpp.

◆ visitExternalCallImpl()

virtual void llzk::dataflow::AbstractSparseForwardDataFlowAnalysis::visitExternalCallImpl ( mlir::CallOpInterface call,
mlir::ArrayRef< const AbstractSparseLattice * > argumentLattices,
mlir::ArrayRef< AbstractSparseLattice * > resultLattices )
protectedpure virtual

The transfer function for calls to external functions.

◆ visitNonControlFlowArgumentsImpl()

virtual void llzk::dataflow::AbstractSparseForwardDataFlowAnalysis::visitNonControlFlowArgumentsImpl ( mlir::Operation * op,
const mlir::RegionSuccessor & successor,
mlir::ArrayRef< AbstractSparseLattice * > argLattices,
unsigned firstIndex )
protectedpure virtual

Given an operation with 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).

◆ visitOperationImpl()

virtual mlir::LogicalResult llzk::dataflow::AbstractSparseForwardDataFlowAnalysis::visitOperationImpl ( mlir::Operation * op,
mlir::ArrayRef< const AbstractSparseLattice * > operandLattices,
mlir::ArrayRef< AbstractSparseLattice * > resultLattices )
protectedpure virtual

The operation transfer function.

Given the operand lattices, this function is expected to set the result lattices.

Member Data Documentation

◆ tables

mlir::SymbolTableCollection llzk::dataflow::AbstractSparseForwardDataFlowAnalysis::tables
protected

LLZK: Added for use of symbol helper caching.

Definition at line 114 of file SparseAnalysis.h.


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