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

An analysis wrapper that runs the given StructAnalysisTy struct analysis over all of the struct contained within the module. More...

#include <AnalysisWrappers.h>

Public Member Functions

 ModuleAnalysis (mlir::Operation *op)
 Asserts that the analysis is being run on a ModuleOp.
virtual ~ModuleAnalysis ()=default
virtual void runAnalysis (mlir::AnalysisManager &am)
 Run the StructAnalysisTy struct analysis on all child structs.
void ensureAnalysisRun (mlir::AnalysisManager &am)
 Runs the analysis if the results do not already exist.
bool constructed () const
 Check if the results of this analysis have been created for the currently available context.
bool hasResult (component::StructDefOp op) const
 Checks if op has a result contained in the current result map.
const Result & getResult (component::StructDefOp op) const
 Asserts that op has a result and returns it.
const StructResults & getCurrentResults () const
 Get the results for the current context.
mlir::DataFlowSolver & getSolver ()

Protected Member Functions

virtual void initializeSolver ()=0
 Initialize the shared dataflow solver with any common analyses required by the contained struct analyses.
virtual const Context & getContext () const =0
 Return the current Context object.
void constructChildAnalyses (mlir::AnalysisManager &am)
 Construct and run the StructAnalysisTy analyses on each StructDefOp contained in the ModuleOp that is being subjected to this analysis.

Protected Attributes

mlir::DataFlowSolver solver

Detailed Description

template<typename Result, typename Context, StructAnalysisType< Result, Context > StructAnalysisTy>
class llzk::ModuleAnalysis< Result, Context, StructAnalysisTy >

An analysis wrapper that runs the given StructAnalysisTy struct analysis over all of the struct contained within the module.

Through the use of the Context object, this analysis facilitates the sharing of common data and analyses across struct analyses.

Template Parameters
ResultThe result of each StructAnalysis.
ContextThe context shared between StructAnalysis analyses.
StructAnalysisTypeThe analysis run on all the contained module's structs.

Definition at line 136 of file AnalysisWrappers.h.

Constructor & Destructor Documentation

◆ ModuleAnalysis()

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

Asserts that the analysis is being run on a ModuleOp.

Note
Derived classes may also use the Analysis(mlir::Operation*, mlir::AnalysisManager&) constructor that is allowed by classes that are constructed using the AnalysisManager::getAnalysis<Analysis>() method.

Definition at line 154 of file AnalysisWrappers.h.

◆ ~ModuleAnalysis()

template<typename Result, typename Context, StructAnalysisType< Result, Context > StructAnalysisTy>
virtual llzk::ModuleAnalysis< Result, Context, StructAnalysisTy >::~ModuleAnalysis ( )
virtualdefault

Member Function Documentation

◆ constructChildAnalyses()

template<typename Result, typename Context, StructAnalysisType< Result, Context > StructAnalysisTy>
void llzk::ModuleAnalysis< Result, Context, StructAnalysisTy >::constructChildAnalyses ( mlir::AnalysisManager & am)
inlineprotected

Construct and run the StructAnalysisTy analyses on each StructDefOp contained in the ModuleOp that is being subjected to this analysis.

Parameters
amThe module's analysis manager.

Definition at line 214 of file AnalysisWrappers.h.

◆ constructed()

template<typename Result, typename Context, StructAnalysisType< Result, Context > StructAnalysisTy>
bool llzk::ModuleAnalysis< Result, Context, StructAnalysisTy >::constructed ( ) const
inline

Check if the results of this analysis have been created for the currently available context.

Definition at line 178 of file AnalysisWrappers.h.

◆ ensureAnalysisRun()

template<typename Result, typename Context, StructAnalysisType< Result, Context > StructAnalysisTy>
void llzk::ModuleAnalysis< Result, Context, StructAnalysisTy >::ensureAnalysisRun ( mlir::AnalysisManager & am)
inline

Runs the analysis if the results do not already exist.

Definition at line 170 of file AnalysisWrappers.h.

◆ getContext()

template<typename Result, typename Context, StructAnalysisType< Result, Context > StructAnalysisTy>
virtual const Context & llzk::ModuleAnalysis< Result, Context, StructAnalysisTy >::getContext ( ) const
protectedpure virtual

Return the current Context object.

The context contains parameters that configure or pass information to the analysis.

Implemented in llzk::ConstraintDependencyGraphModuleAnalysis, and llzk::ModuleIntervalAnalysis.

◆ getCurrentResults()

template<typename Result, typename Context, StructAnalysisType< Result, Context > StructAnalysisTy>
const StructResults & llzk::ModuleAnalysis< Result, Context, StructAnalysisTy >::getCurrentResults ( ) const
inline

Get the results for the current context.

Definition at line 192 of file AnalysisWrappers.h.

◆ getResult()

template<typename Result, typename Context, StructAnalysisType< Result, Context > StructAnalysisTy>
const Result & llzk::ModuleAnalysis< Result, Context, StructAnalysisTy >::getResult ( component::StructDefOp op) const
inline

Asserts that op has a result and returns it.

Definition at line 186 of file AnalysisWrappers.h.

◆ getSolver()

template<typename Result, typename Context, StructAnalysisType< Result, Context > StructAnalysisTy>
mlir::DataFlowSolver & llzk::ModuleAnalysis< Result, Context, StructAnalysisTy >::getSolver ( )
inline

Definition at line 197 of file AnalysisWrappers.h.

◆ hasResult()

template<typename Result, typename Context, StructAnalysisType< Result, Context > StructAnalysisTy>
bool llzk::ModuleAnalysis< Result, Context, StructAnalysisTy >::hasResult ( component::StructDefOp op) const
inline

Checks if op has a result contained in the current result map.

Definition at line 181 of file AnalysisWrappers.h.

◆ initializeSolver()

template<typename Result, typename Context, StructAnalysisType< Result, Context > StructAnalysisTy>
virtual void llzk::ModuleAnalysis< Result, Context, StructAnalysisTy >::initializeSolver ( )
protectedpure virtual

Initialize the shared dataflow solver with any common analyses required by the contained struct analyses.

Parameters
solver

Implemented in llzk::ConstraintDependencyGraphModuleAnalysis, and llzk::ModuleIntervalAnalysis.

◆ runAnalysis()

template<typename Result, typename Context, StructAnalysisType< Result, Context > StructAnalysisTy>
virtual void llzk::ModuleAnalysis< Result, Context, StructAnalysisTy >::runAnalysis ( mlir::AnalysisManager & am)
inlinevirtual

Run the StructAnalysisTy struct analysis on all child structs.

Parameters
amThe module-level analysis manager that will be passed to StructAnalysis::runAnalysis. This analysis manager should be the same analysis manager used to construct this analysis.

Definition at line 167 of file AnalysisWrappers.h.

Member Data Documentation

◆ solver

template<typename Result, typename Context, StructAnalysisType< Result, Context > StructAnalysisTy>
mlir::DataFlowSolver llzk::ModuleAnalysis< Result, Context, StructAnalysisTy >::solver
protected

Definition at line 200 of file AnalysisWrappers.h.


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