LLZK 0.1.0
Veridise's ZK Language IR
Loading...
Searching...
No Matches
llzk::StructAnalysis< Result, Context > Class Template Referenceabstract

This is the base class for a dataflow analysis designed to run on a single struct (i.e., a single component). More...

#include <AnalysisWrappers.h>

Public Member Functions

 StructAnalysis (mlir::Operation *op)
 Assert that this analysis is being run on a StructDefOp and initializes the analysis with the current StructDefOp and its parent ModuleOp.
 
virtual mlir::LogicalResult runAnalysis (mlir::DataFlowSolver &solver, mlir::AnalysisManager &moduleAnalysisManager, Context &ctx)=0
 Perform the analysis and construct the Result output.
 
bool constructed () const
 Query if the analysis has constructed a Result object.
 
const Result & getResult () const
 Access the result iff it has been created.
 

Protected Member Functions

mlir::ModuleOp getModule () const
 Get the ModuleOp that is the parent of the StructDefOp that is under analysis.
 
component::StructDefOp getStruct () const
 Get the current StructDefOp that is under analysis.
 
void setResult (Result &&r)
 Initialize the final Result object.
 

Detailed Description

template<typename Result, typename Context>
class llzk::StructAnalysis< Result, Context >

This is the base class for a dataflow analysis designed to run on a single struct (i.e., a single component).

Template Parameters
ResultThe output of the analysis.
ContextAny module-level information or configuration needed to run this analysis.

Definition at line 42 of file AnalysisWrappers.h.

Constructor & Destructor Documentation

◆ StructAnalysis()

template<typename Result, typename Context>
llzk::StructAnalysis< Result, Context >::StructAnalysis ( mlir::Operation * op)
inline

Assert that this analysis is being run on a StructDefOp and initializes the analysis with the current StructDefOp and its parent ModuleOp.

Parameters
opThe presumed StructDefOp.

Definition at line 47 of file AnalysisWrappers.h.

Member Function Documentation

◆ constructed()

template<typename Result, typename Context>
bool llzk::StructAnalysis< Result, Context >::constructed ( ) const
inline

Query if the analysis has constructed a Result object.

Definition at line 79 of file AnalysisWrappers.h.

◆ getModule()

template<typename Result, typename Context>
mlir::ModuleOp llzk::StructAnalysis< Result, Context >::getModule ( ) const
inlineprotected

Get the ModuleOp that is the parent of the StructDefOp that is under analysis.

Definition at line 89 of file AnalysisWrappers.h.

◆ getResult()

template<typename Result, typename Context>
const Result & llzk::StructAnalysis< Result, Context >::getResult ( ) const
inline

Access the result iff it has been created.

Definition at line 82 of file AnalysisWrappers.h.

◆ getStruct()

template<typename Result, typename Context>
component::StructDefOp llzk::StructAnalysis< Result, Context >::getStruct ( ) const
inlineprotected

Get the current StructDefOp that is under analysis.

Definition at line 92 of file AnalysisWrappers.h.

◆ runAnalysis()

template<typename Result, typename Context>
virtual mlir::LogicalResult llzk::StructAnalysis< Result, Context >::runAnalysis ( mlir::DataFlowSolver & solver,
mlir::AnalysisManager & moduleAnalysisManager,
Context & ctx )
pure virtual

Perform the analysis and construct the Result output.

Parameters
solverThe pre-configured dataflow solver. This solver should already have a liveness analysis run, otherwise this analysis may be a no-op.
moduleAnalysisManagerThe analysis manager of the top-level module. By giving the struct analysis a reference to the module's analysis manager, we can query analyses of other structs by querying for a child analysis. Otherwise, a struct's analysis manager cannot query for the analyses of other operations unless they are nested within the struct.
ctxThe Context given to the analysis. This is presumed to have been created by the StructAnalysis's parent ModuleAnalysis.
Returns
mlir::success() if the analysis ran without errors, and a mlir::failure() otherwise.

Implemented in llzk::ConstraintDependencyGraphStructAnalysis, and llzk::StructIntervalAnalysis.

◆ setResult()

template<typename Result, typename Context>
void llzk::StructAnalysis< Result, Context >::setResult ( Result && r)
inlineprotected

Initialize the final Result object.

Definition at line 95 of file AnalysisWrappers.h.


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