MLIR  19.0.0git
Public Types | Public Member Functions | Friends | List of all members
mlir::AnalysisManager Class Reference

This class represents an analysis manager for a particular operation instance. More...

#include "mlir/Pass/AnalysisManager.h"

Public Types

using PreservedAnalyses = detail::PreservedAnalyses
 

Public Member Functions

template<typename AnalysisT >
std::optional< std::reference_wrapper< AnalysisT > > getCachedParentAnalysis (Operation *parentOp) const
 Query for a cached analysis on the given parent operation. More...
 
template<typename AnalysisT >
AnalysisT & getAnalysis ()
 Query for the given analysis for the current operation. More...
 
template<typename AnalysisT , typename OpT >
AnalysisT & getAnalysis ()
 Query for the given analysis for the current operation of a specific derived operation type. More...
 
template<typename AnalysisT >
std::optional< std::reference_wrapper< AnalysisT > > getCachedAnalysis () const
 Query for a cached entry of the given analysis on the current operation. More...
 
template<typename AnalysisT >
AnalysisT & getChildAnalysis (Operation *op)
 Query for an analysis of a child operation, constructing it if necessary. More...
 
template<typename AnalysisT , typename OpT >
AnalysisT & getChildAnalysis (OpT child)
 Query for an analysis of a child operation of a specific derived operation type, constructing it if necessary. More...
 
template<typename AnalysisT >
std::optional< std::reference_wrapper< AnalysisT > > getCachedChildAnalysis (Operation *op) const
 Query for a cached analysis of a child operation, or return null. More...
 
AnalysisManager nest (Operation *op)
 Get an analysis manager for the given operation, which must be a proper descendant of the current operation represented by this analysis manager. More...
 
void invalidate (const PreservedAnalyses &pa)
 Invalidate any non preserved analyses,. More...
 
void clear ()
 Clear any held analyses. More...
 
PassInstrumentorgetPassInstrumentor () const
 Returns a pass instrumentation object for the current operation. More...
 

Friends

class ModuleAnalysisManager
 Allow access to the constructor. More...
 

Detailed Description

This class represents an analysis manager for a particular operation instance.

It is used to manage and cache analyses on the operation as well as those for child operations, via nested AnalysisManager instances accessible via 'slice'. This class is intended to be passed around by value, and cannot be constructed directly.

Definition at line 295 of file AnalysisManager.h.

Member Typedef Documentation

◆ PreservedAnalyses

Definition at line 300 of file AnalysisManager.h.

Member Function Documentation

◆ clear()

void mlir::AnalysisManager::clear ( )
inline

Clear any held analyses.

Definition at line 368 of file AnalysisManager.h.

◆ getAnalysis() [1/2]

template<typename AnalysisT >
AnalysisT& mlir::AnalysisManager::getAnalysis ( )
inline

Query for the given analysis for the current operation.

Definition at line 318 of file AnalysisManager.h.

References getPassInstrumentor().

Referenced by mlir::Pass::getAnalysis().

◆ getAnalysis() [2/2]

template<typename AnalysisT , typename OpT >
AnalysisT& mlir::AnalysisManager::getAnalysis ( )
inline

Query for the given analysis for the current operation of a specific derived operation type.

Definition at line 325 of file AnalysisManager.h.

References getPassInstrumentor().

◆ getCachedAnalysis()

template<typename AnalysisT >
std::optional<std::reference_wrapper<AnalysisT> > mlir::AnalysisManager::getCachedAnalysis ( ) const
inline

Query for a cached entry of the given analysis on the current operation.

Definition at line 332 of file AnalysisManager.h.

Referenced by mlir::Pass::getCachedAnalysis().

◆ getCachedChildAnalysis()

template<typename AnalysisT >
std::optional<std::reference_wrapper<AnalysisT> > mlir::AnalysisManager::getCachedChildAnalysis ( Operation op) const
inline

Query for a cached analysis of a child operation, or return null.

Definition at line 352 of file AnalysisManager.h.

Referenced by mlir::Pass::getCachedChildAnalysis().

◆ getCachedParentAnalysis()

template<typename AnalysisT >
std::optional<std::reference_wrapper<AnalysisT> > mlir::AnalysisManager::getCachedParentAnalysis ( Operation parentOp) const
inline

Query for a cached analysis on the given parent operation.

The analysis may not exist and if it does it may be out-of-date.

Definition at line 306 of file AnalysisManager.h.

References mlir::detail::NestedAnalysisMap::getParent().

Referenced by mlir::Pass::getCachedParentAnalysis().

◆ getChildAnalysis() [1/2]

template<typename AnalysisT >
AnalysisT& mlir::AnalysisManager::getChildAnalysis ( Operation op)
inline

Query for an analysis of a child operation, constructing it if necessary.

Definition at line 338 of file AnalysisManager.h.

Referenced by mlir::Pass::getChildAnalysis().

◆ getChildAnalysis() [2/2]

template<typename AnalysisT , typename OpT >
AnalysisT& mlir::AnalysisManager::getChildAnalysis ( OpT  child)
inline

Query for an analysis of a child operation of a specific derived operation type, constructing it if necessary.

Definition at line 345 of file AnalysisManager.h.

References nest().

◆ getPassInstrumentor()

PassInstrumentor* mlir::AnalysisManager::getPassInstrumentor ( ) const
inline

Returns a pass instrumentation object for the current operation.

This value may be null.

Definition at line 375 of file AnalysisManager.h.

Referenced by getAnalysis().

◆ invalidate()

void mlir::AnalysisManager::invalidate ( const PreservedAnalyses pa)
inline

Invalidate any non preserved analyses,.

Definition at line 365 of file AnalysisManager.h.

◆ nest()

AnalysisManager AnalysisManager::nest ( Operation op)

Get an analysis manager for the given operation, which must be a proper descendant of the current operation represented by this analysis manager.

Definition at line 906 of file Pass.cpp.

Referenced by getChildAnalysis().

Friends And Related Function Documentation

◆ ModuleAnalysisManager

Allow access to the constructor.

Definition at line 389 of file AnalysisManager.h.


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