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 void runAnalysis (mlir::AnalysisManager &am)
 Run the StructAnalysisTy struct analysis on all child structs.
 
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.
 
ResultMap::iterator begin ()
 
ResultMap::iterator end ()
 
ResultMap::const_iterator cbegin () const
 
ResultMap::const_iterator cend () const
 
const mlir::DataFlowSolver & getSolver () const
 

Protected Member Functions

virtual void initializeSolver (mlir::DataFlowSolver &solver)=0
 Initialize the shared dataflow solver with any common analyses required by the contained struct analyses.
 
virtual Context getContext ()=0
 Create and return a valid 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.
 

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 119 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 131 of file AnalysisWrappers.h.

Member Function Documentation

◆ begin()

template<typename Result, typename Context, StructAnalysisType< Result, Context > StructAnalysisTy>
ResultMap::iterator llzk::ModuleAnalysis< Result, Context, StructAnalysisTy >::begin ( )
inline

Definition at line 154 of file AnalysisWrappers.h.

◆ cbegin()

template<typename Result, typename Context, StructAnalysisType< Result, Context > StructAnalysisTy>
ResultMap::const_iterator llzk::ModuleAnalysis< Result, Context, StructAnalysisTy >::cbegin ( ) const
inline

Definition at line 156 of file AnalysisWrappers.h.

◆ cend()

template<typename Result, typename Context, StructAnalysisType< Result, Context > StructAnalysisTy>
ResultMap::const_iterator llzk::ModuleAnalysis< Result, Context, StructAnalysisTy >::cend ( ) const
inline

Definition at line 157 of file AnalysisWrappers.h.

◆ 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 175 of file AnalysisWrappers.h.

◆ end()

template<typename Result, typename Context, StructAnalysisType< Result, Context > StructAnalysisTy>
ResultMap::iterator llzk::ModuleAnalysis< Result, Context, StructAnalysisTy >::end ( )
inline

Definition at line 155 of file AnalysisWrappers.h.

◆ getContext()

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

Create and return a valid Context object.

This function is called once by constructChildAnalyses and the resulting Context is passed to each child struct analysis run by this module analysis.

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

◆ 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 149 of file AnalysisWrappers.h.

◆ getSolver()

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

Definition at line 159 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 146 of file AnalysisWrappers.h.

◆ initializeSolver()

template<typename Result, typename Context, StructAnalysisType< Result, Context > StructAnalysisTy>
virtual void llzk::ModuleAnalysis< Result, Context, StructAnalysisTy >::initializeSolver ( mlir::DataFlowSolver & solver)
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 143 of file AnalysisWrappers.h.


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