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

An adaptor pass used to run operation passes over nested operations. More...

#include "Pass/PassDetail.h"

+ Inheritance diagram for mlir::detail::OpToOpPassAdaptor:

Public Member Functions

 OpToOpPassAdaptor (OpPassManager &&mgr)
 
 OpToOpPassAdaptor (const OpToOpPassAdaptor &rhs)=default
 
void runOnOperation (bool verifyPasses)
 Run the held pipeline over all operations. More...
 
void runOnOperation () override
 The polymorphic API that runs the pass over the currently held operation. More...
 
LogicalResult tryMergeInto (MLIRContext *ctx, OpToOpPassAdaptor &rhs)
 Try to merge the current pass adaptor into 'rhs'. More...
 
MutableArrayRef< OpPassManagergetPassManagers ()
 Returns the pass managers held by this adaptor. More...
 
void getDependentDialects (DialectRegistry &dialects) const override
 Populate the set of dependent dialects for the passes in the current adaptor. More...
 
MutableArrayRef< SmallVector< OpPassManager, 1 > > getParallelPassManagers ()
 Return the async pass managers held by this parallel adaptor. More...
 
std::string getAdaptorName ()
 Returns the adaptor pass name. More...
 
- Public Member Functions inherited from mlir::PassWrapper< OpToOpPassAdaptor, OperationPass<> >
 ~PassWrapper () override=default
 
- Public Member Functions inherited from mlir::OperationPass< OpT >
 ~OperationPass () override=default
 
- Public Member Functions inherited from mlir::Pass
virtual ~Pass ()=default
 
TypeID getTypeID () const
 Returns the unique identifier that corresponds to this pass. More...
 
const PassInfolookupPassInfo () const
 Returns the pass info for this pass, or null if unknown. More...
 
virtual StringRef getArgument () const
 Return the command line argument used when registering this pass. More...
 
virtual StringRef getDescription () const
 Return the command line description used when registering this pass. More...
 
std::optional< StringRef > getOpName () const
 Returns the name of the operation that this pass operates on, or std::nullopt if this is a generic OperationPass. More...
 
virtual LogicalResult initializeOptions (StringRef options, function_ref< LogicalResult(const Twine &)> errorHandler)
 Attempt to initialize the options of this pass from the given string. More...
 
void printAsTextualPipeline (raw_ostream &os)
 Prints out the pass in the textual representation of pipelines. More...
 
ArrayRef< Statistic * > getStatistics () const
 Returns the main statistics for this pass instance. More...
 
MutableArrayRef< Statistic * > getStatistics ()
 
const PassgetThreadingSibling () const
 Returns the thread sibling of this pass. More...
 
const PassgetThreadingSiblingOrThis () const
 Returns the thread sibling of this pass, or the pass itself it has no sibling. More...
 

Friends

class mlir::PassManager
 

Additional Inherited Members

- Static Public Member Functions inherited from mlir::PassWrapper< OpToOpPassAdaptor, OperationPass<> >
static bool classof (const Pass *pass)
 Support isa/dyn_cast functionality for the derived pass class. More...
 
- Protected Member Functions inherited from mlir::PassWrapper< OpToOpPassAdaptor, OperationPass<> >
 PassWrapper ()
 
 PassWrapper (const PassWrapper &)=default
 
 PassWrapper (PassWrapper &&)=delete
 
PassWrapperoperator= (const PassWrapper &)=delete
 
PassWrapperoperator= (PassWrapper &&)=delete
 
StringRef getName () const override
 Returns the derived pass name. More...
 
std::unique_ptr< PassclonePass () const override
 A clone method to create a copy of this pass. More...
 
- Protected Member Functions inherited from mlir::OperationPass< OpT >
 OperationPass (TypeID passID)
 
 OperationPass (const OperationPass &)=default
 
OperationPassoperator= (const OperationPass &)=delete
 
 OperationPass (OperationPass &&)=delete
 
OperationPassoperator= (OperationPass &&)=delete
 
bool canScheduleOn (RegisteredOperationName opName) const final
 Indicate if the current pass can be scheduled on the given operation type. More...
 
OpT getOperation ()
 Return the current operation being transformed. More...
 
template<typename AnalysisT >
AnalysisT & getAnalysis ()
 Query an analysis for the current operation of the specific derived operation type. More...
 
- Protected Member Functions inherited from mlir::Pass
 Pass (TypeID passID, std::optional< StringRef > opName=std::nullopt)
 
 Pass (const Pass &other)
 
Passoperator= (const Pass &)=delete
 
 Pass (Pass &&)=delete
 
Passoperator= (Pass &&)=delete
 
detail::PassExecutionStategetPassState ()
 Returns the current pass state. More...
 
MLIRContextgetContext ()
 Return the MLIR context for the current operation being transformed. More...
 
virtual LogicalResult initialize (MLIRContext *context)
 Initialize any complex state necessary for running this pass. More...
 
LogicalResult runPipeline (OpPassManager &pipeline, Operation *op)
 Schedule an arbitrary pass pipeline on the provided operation. More...
 
std::unique_ptr< Passclone () const
 A clone method to create a copy of this pass. More...
 
OperationgetOperation ()
 Return the current operation being transformed. More...
 
void signalPassFailure ()
 Signal that some invariant was broken when running. More...
 
template<typename AnalysisT >
AnalysisT & getAnalysis ()
 Query an analysis for the current ir unit. More...
 
template<typename AnalysisT , typename OpT >
AnalysisT & getAnalysis ()
 Query an analysis for the current ir unit of a specific derived operation type. More...
 
template<typename AnalysisT >
std::optional< std::reference_wrapper< AnalysisT > > getCachedAnalysis ()
 Query a cached instance of an analysis for the current ir unit if one exists. More...
 
void markAllAnalysesPreserved ()
 Mark all analyses as preserved. More...
 
template<typename... AnalysesT>
void markAnalysesPreserved ()
 Mark the provided analyses as preserved. More...
 
void markAnalysesPreserved (TypeID id)
 
template<typename AnalysisT >
std::optional< std::reference_wrapper< AnalysisT > > getCachedParentAnalysis (Operation *parent)
 Returns the analysis for the given parent operation if it exists. More...
 
template<typename AnalysisT >
std::optional< std::reference_wrapper< AnalysisT > > getCachedParentAnalysis ()
 Returns the analysis for the parent operation if it exists. More...
 
template<typename AnalysisT >
std::optional< std::reference_wrapper< AnalysisT > > getCachedChildAnalysis (Operation *child)
 Returns the analysis for the given child operation if it exists. More...
 
template<typename AnalysisT >
AnalysisT & getChildAnalysis (Operation *child)
 Returns the analysis for the given child operation, or creates it if it doesn't exist. More...
 
template<typename AnalysisT , typename OpTy >
AnalysisT & getChildAnalysis (OpTy child)
 Returns the analysis for the given child operation of specific derived operation type, or creates it if it doesn't exist. More...
 
AnalysisManager getAnalysisManager ()
 Returns the current analysis manager. More...
 
void copyOptionValuesFrom (const Pass *other)
 Copy the option values from 'other', which is another instance of this pass. More...
 
- Static Protected Member Functions inherited from mlir::OperationPass< OpT >
static bool classof (const Pass *pass)
 Support isa/dyn_cast functionality. More...
 

Detailed Description

An adaptor pass used to run operation passes over nested operations.

Definition at line 25 of file PassDetail.h.

Constructor & Destructor Documentation

◆ OpToOpPassAdaptor() [1/2]

OpToOpPassAdaptor::OpToOpPassAdaptor ( OpPassManager &&  mgr)

Definition at line 623 of file Pass.cpp.

◆ OpToOpPassAdaptor() [2/2]

mlir::detail::OpToOpPassAdaptor::OpToOpPassAdaptor ( const OpToOpPassAdaptor rhs)
default

Member Function Documentation

◆ getAdaptorName()

std::string OpToOpPassAdaptor::getAdaptorName ( )

Returns the adaptor pass name.

Definition at line 696 of file Pass.cpp.

References mlir::OpPassManager::getOpAnchorName().

◆ getDependentDialects()

void OpToOpPassAdaptor::getDependentDialects ( DialectRegistry dialects) const
overridevirtual

Populate the set of dependent dialects for the passes in the current adaptor.

Reimplemented from mlir::Pass.

Definition at line 627 of file Pass.cpp.

References mlir::OpPassManager::getDependentDialects().

◆ getParallelPassManagers()

MutableArrayRef<SmallVector<OpPassManager, 1> > mlir::detail::OpToOpPassAdaptor::getParallelPassManagers ( )
inline

Return the async pass managers held by this parallel adaptor.

Definition at line 54 of file PassDetail.h.

Referenced by prepareStatistics().

◆ getPassManagers()

MutableArrayRef<OpPassManager> mlir::detail::OpToOpPassAdaptor::getPassManagers ( )
inline

Returns the pass managers held by this adaptor.

Definition at line 47 of file PassDetail.h.

Referenced by prepareStatistics().

◆ runOnOperation() [1/2]

void OpToOpPassAdaptor::runOnOperation ( )
overridevirtual

The polymorphic API that runs the pass over the currently held operation.

Implements mlir::Pass.

Definition at line 706 of file Pass.cpp.

◆ runOnOperation() [2/2]

void OpToOpPassAdaptor::runOnOperation ( bool  verifyPasses)

Run the held pipeline over all operations.

Run the held pipeline over all nested operations.

Definition at line 712 of file Pass.cpp.

References getContext().

◆ tryMergeInto()

LogicalResult OpToOpPassAdaptor::tryMergeInto ( MLIRContext ctx,
OpToOpPassAdaptor rhs 
)

Try to merge the current pass adaptor into 'rhs'.

This will try to append the pass managers of this adaptor into those within rhs, or return failure if merging isn't possible. The main situation in which merging is not possible is if one of the adaptors has an any pipeline that is not compatible with a pass manager in the other adaptor. For example, if this adaptor has a func.func pipeline and rhs has an any pipeline that operates on FunctionOpInterface. In this situation the pipelines have a conflict (they both want to run on the same operations), so we can't merge.

Definition at line 632 of file Pass.cpp.

References mlir::detail::OpPassManagerImpl::canScheduleOn(), mlir::failure(), findPassManagerWithAnchor(), mlir::OpPassManager::getImpl(), mlir::OpPassManager::getOpAnchorName(), mlir::Pass::getOpName(), mlir::OpPassManager::getOpName(), mlir::detail::OpPassManagerImpl::mergeInto(), and mlir::success().

Friends And Related Function Documentation

◆ mlir::PassManager

friend class mlir::PassManager
friend

Definition at line 92 of file PassDetail.h.


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