MLIR 22.0.0git
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.
template<typename AnalysisT>
AnalysisT & getAnalysis ()
 Query for the given analysis for the current operation.
template<typename AnalysisT, typename OpT>
AnalysisT & getAnalysis ()
 Query for the given analysis for the current operation of a specific derived operation type.
template<typename AnalysisT>
std::optional< std::reference_wrapper< AnalysisT > > getCachedAnalysis () const
 Query for a cached entry of the given analysis on the current operation.
template<typename AnalysisT>
AnalysisT & getChildAnalysis (Operation *op)
 Query for an analysis of a child operation, constructing it if necessary.
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.
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.
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.
void invalidate (const PreservedAnalyses &pa)
 Invalidate any non preserved analyses,.
void clear ()
 Clear any held analyses.
PassInstrumentorgetPassInstrumentor () const
 Returns a pass instrumentation object for the current operation.

Friends

class ModuleAnalysisManager
 Allow access to the constructor.

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 292 of file AnalysisManager.h.

Member Typedef Documentation

◆ PreservedAnalyses

Member Function Documentation

◆ clear()

void mlir::AnalysisManager::clear ( )
inline

Clear any held analyses.

Definition at line 365 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 315 of file AnalysisManager.h.

References getPassInstrumentor().

Referenced by mlir::Pass::getAnalysis(), getChildAnalysis(), and getChildAnalysis().

◆ 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 322 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 329 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 349 of file AnalysisManager.h.

References mlir::Operation::getParentOp().

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 303 of file AnalysisManager.h.

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

Referenced by mlir::Pass::getCachedParentAnalysis(), and 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 335 of file AnalysisManager.h.

References getAnalysis(), and nest().

Referenced by mlir::Pass::getChildAnalysis(), and 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 342 of file AnalysisManager.h.

References getAnalysis(), and 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 372 of file AnalysisManager.h.

Referenced by getAnalysis().

◆ invalidate()

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

Invalidate any non preserved analyses,.

Definition at line 362 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 1127 of file Pass.cpp.

References mlir::Operation::getParentOp(), mlir::Operation::isProperAncestor(), and result.

Referenced by getChildAnalysis(), and getChildAnalysis().

◆ ModuleAnalysisManager

Allow access to the constructor.

Definition at line 386 of file AnalysisManager.h.

References ModuleAnalysisManager.

Referenced by ModuleAnalysisManager.


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