MLIR  20.0.0git
Public Member Functions | List of all members
mlir::detail::AnalysisMap Class Reference

This class represents a cache of analyses for a single operation. More...

#include "mlir/Pass/AnalysisManager.h"

Public Member Functions

 AnalysisMap (Operation *ir)
 
template<typename AnalysisT >
AnalysisT & getAnalysis (PassInstrumentor *pi, AnalysisManager &am)
 Get an analysis for the current IR unit, computing it if necessary. More...
 
template<typename AnalysisT , typename OpT >
std::enable_if_t< std::is_constructible< AnalysisT, OpT >::value||std::is_constructible< AnalysisT, OpT, AnalysisManager & >::value, AnalysisT & > getAnalysis (PassInstrumentor *pi, AnalysisManager &am)
 Get an analysis for the current IR unit assuming it's of specific derived operation type. More...
 
template<typename AnalysisT >
std::optional< std::reference_wrapper< AnalysisT > > getCachedAnalysis () const
 Get a cached analysis instance if one exists, otherwise return null. More...
 
OperationgetOperation () const
 Returns the operation that this analysis map represents. More...
 
void clear ()
 Clear any held analyses. More...
 
void invalidate (const PreservedAnalyses &pa)
 Invalidate any cached analyses based upon the given set of preserved analyses. More...
 

Detailed Description

This class represents a cache of analyses for a single operation.

All computation, caching, and invalidation of analyses takes place here.

Definition at line 137 of file AnalysisManager.h.

Constructor & Destructor Documentation

◆ AnalysisMap()

mlir::detail::AnalysisMap::AnalysisMap ( Operation ir)
inlineexplicit

Definition at line 151 of file AnalysisManager.h.

Member Function Documentation

◆ clear()

void mlir::detail::AnalysisMap::clear ( )
inline

Clear any held analyses.

Definition at line 183 of file AnalysisManager.h.

◆ getAnalysis() [1/2]

template<typename AnalysisT >
AnalysisT& mlir::detail::AnalysisMap::getAnalysis ( PassInstrumentor pi,
AnalysisManager am 
)
inline

Get an analysis for the current IR unit, computing it if necessary.

Definition at line 155 of file AnalysisManager.h.

◆ getAnalysis() [2/2]

template<typename AnalysisT , typename OpT >
std::enable_if_t< std::is_constructible<AnalysisT, OpT>::value || std::is_constructible<AnalysisT, OpT, AnalysisManager &>::value, AnalysisT &> mlir::detail::AnalysisMap::getAnalysis ( PassInstrumentor pi,
AnalysisManager am 
)
inline

Get an analysis for the current IR unit assuming it's of specific derived operation type.

Definition at line 166 of file AnalysisManager.h.

◆ getCachedAnalysis()

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

Get a cached analysis instance if one exists, otherwise return null.

Definition at line 172 of file AnalysisManager.h.

◆ getOperation()

Operation* mlir::detail::AnalysisMap::getOperation ( ) const
inline

Returns the operation that this analysis map represents.

Definition at line 180 of file AnalysisManager.h.

Referenced by mlir::detail::NestedAnalysisMap::getOperation().

◆ invalidate()

void mlir::detail::AnalysisMap::invalidate ( const PreservedAnalyses pa)
inline

Invalidate any cached analyses based upon the given set of preserved analyses.

Definition at line 187 of file AnalysisManager.h.

Referenced by mlir::detail::NestedAnalysisMap::invalidate().


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