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

#include <IntervalAnalysis.h>

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

Public Member Functions

 IntervalDataFlowAnalysis (mlir::DataFlowSolver &solver, llvm::SMTSolverRef smt, const Field &f)
 
void visitCallControlFlowTransfer (mlir::CallOpInterface call, dataflow::CallControlFlowAction action, const Lattice &before, Lattice *after) override
 The interval analysis is intraprocedural only for now, so this control flow transfer function passes no data to the callee and sets the post-call state to that of the pre-call state (i.e., calls are ignored).
 
void visitOperation (mlir::Operation *op, const Lattice &before, Lattice *after) override
 Visit an operation with the dense lattice before its execution.
 
llvm::SMTExprRef getOrCreateSymbol (const ConstrainRef &r)
 Either return the existing SMT expression that corresponds to the ConstrainRef, or create one.
 
- Public Member Functions inherited from llzk::dataflow::DenseForwardDataFlowAnalysis< IntervalAnalysisLattice >
virtual void visitRegionBranchControlFlowTransfer (mlir::RegionBranchOpInterface branch, std::optional< unsigned > regionFrom, std::optional< unsigned > regionTo, const IntervalAnalysisLattice &before, IntervalAnalysisLattice *after)
 Hook for customizing the behavior of lattice propagation along the control flow edges between regions and their parent op.
 
virtual void visitRegionBranchControlFlowTransfer (mlir::RegionBranchOpInterface branch, std::optional< unsigned > regionFrom, std::optional< unsigned > regionTo, const IntervalAnalysisLattice &before, IntervalAnalysisLattice *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.
 

Additional Inherited Members

- Protected Member Functions inherited from llzk::dataflow::DenseForwardDataFlowAnalysis< IntervalAnalysisLattice >
IntervalAnalysisLatticegetLattice (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.
 
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.
 
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.
 
IntervalAnalysisLatticegetLattice (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.
 
- Protected Attributes inherited from llzk::dataflow::AbstractDenseForwardDataFlowAnalysis
mlir::SymbolTableCollection tables
 LLZK: Added for use of symbol helper caching.
 

Detailed Description

Definition at line 604 of file IntervalAnalysis.h.

Constructor & Destructor Documentation

◆ IntervalDataFlowAnalysis()

llzk::IntervalDataFlowAnalysis::IntervalDataFlowAnalysis ( mlir::DataFlowSolver & solver,
llvm::SMTSolverRef smt,
const Field & f )
inlineexplicit

Definition at line 614 of file IntervalAnalysis.h.

Member Function Documentation

◆ getOrCreateSymbol()

llvm::SMTExprRef llzk::IntervalDataFlowAnalysis::getOrCreateSymbol ( const ConstrainRef & r)

Either return the existing SMT expression that corresponds to the ConstrainRef, or create one.

Parameters
r
Returns

Definition at line 899 of file IntervalAnalysis.cpp.

◆ visitCallControlFlowTransfer()

void llzk::IntervalDataFlowAnalysis::visitCallControlFlowTransfer ( mlir::CallOpInterface call,
dataflow::CallControlFlowAction action,
const Lattice & before,
Lattice * after )
overridevirtual

The interval analysis is intraprocedural only for now, so this control flow transfer function passes no data to the callee and sets the post-call state to that of the pre-call state (i.e., calls are ignored).

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< IntervalAnalysisLattice >.

Definition at line 732 of file IntervalAnalysis.cpp.

◆ visitOperation()

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

Visit an operation with the dense lattice before its execution.

This function is expected to set the dense lattice after its execution and trigger change propagation in case of change.

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

Definition at line 776 of file IntervalAnalysis.cpp.


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